summaryrefslogtreecommitdiff
path: root/include/ruby/backward.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Finer-grained inline constant cache invalidation"Nobuyoshi Nakada2022-03-251-0/+2
| | | | | | | | | | | | This reverts commits for [Feature #18589]: * 8008fb7352abc6fba433b99bf20763cf0d4adb38 "Update formatting per feedback" * 8f6eaca2e19828e92ecdb28b0fe693d606a03f96 "Delete ID from constant cache table if it becomes empty on ISEQ free" * 629908586b4bead1103267652f8b96b1083573a8 "Finer-grained inline constant cache invalidation" MSWin builds on AppVeyor have been crashing since the merger.
* Finer-grained inline constant cache invalidationKevin Newton2022-03-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current behavior - caches depend on a global counter. All constant mutations cause caches to be invalidated. ```ruby class A B = 1 end def foo A::B # inline cache depends on global counter end foo # populate inline cache foo # hit inline cache C = 1 # global counter increments, all caches are invalidated foo # misses inline cache due to `C = 1` ``` Proposed behavior - caches depend on name components. Only constant mutations with corresponding names will invalidate the cache. ```ruby class A B = 1 end def foo A::B # inline cache depends constants named "A" and "B" end foo # populate inline cache foo # hit inline cache C = 1 # caches that depend on the name "C" are invalidated foo # hits inline cache because IC only depends on "A" and "B" ``` Examples of breaking the new cache: ```ruby module C # Breaks `foo` cache because "A" constant is set and the cache in foo depends # on "A" and "B" class A; end end B = 1 ``` We expect the new cache scheme to be invalidated less often because names aren't frequently reused. With the cache being invalidated less, we can rely on its stability more to keep our constant references fast and reduce the need to throw away generated code in YJIT.
* Mark `rb_clear_constant_cache` as internal use onlyNobuyoshi Nakada2022-01-201-0/+3
| | | | | | In the past, many internal functions are declared in intern.h under include/ruby directory, because there were no headers for internal use.
* Flush deprecation declarations for versions older than 3.0Nobuyoshi Nakada2021-12-301-50/+1
|
* include/ruby/backward.h: skip doxygen卜部昌平2021-09-101-1/+0
| | | | There is nothing interesting here. [ci skip]
* Fixed missing NORETURN on rb_mod_const_missingNobuyoshi Nakada2020-12-311-1/+1
|
* Defined RBIMPL_ATTR_DEPRECATED_INTERNALNobuyoshi Nakada2020-12-311-12/+12
| | | | | Get rid of duplicate attributes, which may be warned or ignored except for the first.
* Replaced deprecation macrosNobuyoshi Nakada2020-12-301-28/+21
| | | | | | * DECLARE_DEPRECATED_FEATURE with RBIMPL_ATTR_DEPRECATED_SINCE * DECLARE_DEPRECATED_INTERNAL_FEATURE with RBIMPL_ATTR_INTERNAL And moved function declarations outside both.
* RUBY_SHOW_COPYRIGHT_TO_DIE: flip the default卜部昌平2020-08-271-5/+2
| | | | | | | | | | Commit 7aab062ef3772c7e8e50fc872a1647918c76dbba says: > ruby_show_version() will no longer exits the process, if > RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0. This will be the default in > the future. 3.0 is a good timing for that "future".
* RClassDeprecated: delete卜部昌平2020-08-271-9/+0
| | | | It has been deprecated for 5 years since 1f2255604087e9a7d7efcb2df61b5ca0e2daa200.
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-3/+3
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-3/+3
| | | | This shall fix compile errors.
* add #include guard hack卜部昌平2020-04-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | According to MSVC manual (*1), cl.exe can skip including a header file when that: - contains #pragma once, or - starts with #ifndef, or - starts with #if ! defined. GCC has a similar trick (*2), but it acts more stricter (e. g. there must be _no tokens_ outside of #ifndef...#endif). Sun C lacked #pragma once for a looong time. Oracle Developer Studio 12.5 finally implemented it, but we cannot assume such recent version. This changeset modifies header files so that each of them include strictly one #ifndef...#endif. I believe this is the most portable way to trigger compiler optimizations. [Bug #16770] *1: https://docs.microsoft.com/en-us/cpp/preprocessor/once *2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-0/+4
| | | Split ruby.h
* Renamed ruby_finalize_{0,1}Nobuyoshi Nakada2019-08-131-0/+10
| | | | And pass rb_execution_context_t as an argument.
* remove "deprecated" for rb_frame_method_id_and_class [Bug #15300]ko12018-12-241-3/+0
| | | | | | | | | | | | * include/ruby/backward.h (rb_frame_method_id_and_class): we had labeled `rb_frame_method_id_and_class()` as deprecated because MRI internal doesn't use it, but we found there are user of this API in external C-extensions. Now we don't have proper alternative API and no time to make alternative API, so I remove "deprecated" label. [Bug #15300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: removed stale declarationsnobu2018-09-051-4/+0
| | | | | | | | * include/ruby/backward.h (rb_complex_set_real, rb_complex_set_imag): removed useless declarations which have been deprecated from the beginning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: rename "rb_frozen_class_p" to "rb_class_modify_check"mame2018-07-271-0/+3
| | | | | | | | | | Just refactoring. Despite its name, the function does NOT return a boolean but raises an exception when the class given is frozen. I don't think the new name "rb_class_modify_check" is the best, but it follows the precedeint "rb_ary_modify_check", and is definitely better than "*_p". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: adjusted NORETURN declarationnobu2018-02-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: rb_mod_const_missing is internal functionnobu2018-02-021-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c: partially revert r60558k0kubun2017-12-011-1/+1
| | | | | | | | | | | | | | | because it was actually used in https://github.com/tmm1/rbtrace/blob/v0.4.8/ext/rbtrace.c#L329 and deprecated in r60579 AFTER removal in r60558. ko1 agreed that we should keep just deprecated in Ruby 2.5 and remove it later, and I'm commiting this because I want to make rbtrace.gem installation successful. backward.h: modify r60579 to make rb_frame_method_id_and_class() compilable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: rb_frame_method_id_and_classnobu2017-10-301-0/+3
| | | | | | | * include/ruby/backward.h (rb_frame_method_id_and_class): moved a deprecated declaration from intern.h, for r60558. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: RClassDeprecatednobu2017-02-211-0/+8
| | | | | | | * include/ruby/backward.h (RClassDeprecated): move from ruby/ruby.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: move deprecated declarationnobu2017-02-211-0/+3
| | | | | | | * include/ruby/backward.h (rb_autoload): move declaration of deprecated function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove deprecated internal featurenobu2017-02-211-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: remove deprecated internal featuresnobu2017-02-211-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: remove deprecated functionsnobu2017-02-211-0/+4
| | | | | | | * complex.c (rb_complex_set_real, rb_complex_set_imag): remove functions deprecated at 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* backward.h: 2.2 deprecated featuresnobu2017-02-211-0/+20
| | | | | | | * include/ruby/backward.h (DECLARE_DEPRECATED_FEATURE): move features deprecated at 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove backward macrosnobu2016-06-141-5/+0
| | | | | | | | * include/ruby/backward.h (rb_cFixnum, rb_cBignum): remove the backward compatibility macros, to fail incompatible extension libraries earily. [Bug #12427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Integer unification macronobu2016-06-131-0/+5
| | | | | | | | | | | * include/ruby/ruby.h (RUBY_INTEGER_UNIFICATION): macro to tell if Integer is integrated. [ruby-core:75718][Bug #12427] * include/ruby/backward.h, internal.h (rb_cFixnum, rb_cBignum): fallback to rb_cInteger. * bignum.c, numeric.c, ext/json/generator/generator.{c,h}: use the macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.c: no exit in ruby_show_copyrightnobu2016-01-071-0/+20
* include/ruby/backward.h (ruby_show_copyright_to_die): for source code backward compatibility. * ruby.c (process_options): return Qtrue to exit the process successfully. * version.c (ruby_show_copyright): no longer exit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e