aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/internal/intern
Commit message (Collapse)AuthorAgeFilesLines
* Rename rb_ary_tmp_new to rb_ary_hidden_newPeter Zhu2022-07-261-3/+3
| | | | | | rb_ary_tmp_new suggests that the array is temporary in some way, but that's not true, it just creates an array that's hidden and not on the transient heap. This commit renames it to rb_ary_hidden_new.
* Restore rb_exec_recursive_outerJohn Hawthorn2022-06-151-2/+1
| | | | This was a public method, so we should probably keep it.
* Make method id explicit in rb_exec_recursive_outerJohn Hawthorn2022-06-101-1/+2
| | | | | | | | | | | | | | Previously, because opt_aref and opt_aset don't push a frame, when they would call rb_hash to determine the hash value of the key, the initial level of recursion would incorrectly use the method id at the top of the stack instead of "hash". This commit replaces rb_exec_recursive_outer with rb_exec_recursive_outer_mid, which takes an explicit method id, so that we can make the hash calculation behave consistently. rb_exec_recursive_outer was documented as being internal, so I believe this should be okay to change.
* Expose `rb_hash_new_capa(long)`Jean Boussier2022-04-261-0/+11
| | | | | | | | [Feature #18683] This allows parsers and similar libraries to create Hashes of a certain capacity in advance. It's useful when the key and values are streamed, hence `bulk_insert()` can't be used.
* Finer-grained constant cache invalidation (take 2)Kevin Newton2022-04-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This commit reintroduces finer-grained constant cache invalidation. After 8008fb7 got merged, it was causing issues on token-threaded builds (such as on Windows). The issue was that when you're iterating through instruction sequences and using the translator functions to get back the instruction structs, you're either using `rb_vm_insn_null_translator` or `rb_vm_insn_addr2insn2` depending if it's a direct-threading build. `rb_vm_insn_addr2insn2` does some normalization to always return to you the non-trace version of whatever instruction you're looking at. `rb_vm_insn_null_translator` does not do that normalization. This means that when you're looping through the instructions if you're trying to do an opcode comparison, it can change depending on the type of threading that you're using. This can be very confusing. So, this commit creates a new translator function `rb_vm_insn_normalizing_translator` to always return the non-trace version so that opcode comparisons don't have to worry about different configurations. [Feature #18589]
* Revert "Finer-grained inline constant cache invalidation"Nobuyoshi Nakada2022-03-251-7/+0
| | | | | | | | | | | | 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-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-11/+0
| | | | | | In the past, many internal functions are declared in intern.h under include/ruby directory, because there were no headers for internal use.
* [Feature #18491] Drop support for HP-UXPeter Zhu2022-01-181-3/+0
| | | | | IA64 support was dropped in ticket #15894, so we can drop support for HP-UX.
* [DOC] Fix a typo in a docNobuyoshi Nakada2022-01-131-1/+1
|
* Remove declarations of deprecated functionsNobuyoshi Nakada2021-12-301-12/+0
|
* Remove tainted and trusted featuresNobuyoshi Nakada2021-12-264-143/+0
| | | | Already these had been announced to be removed in 3.2.
* Improved exception usage/classes.Samuel Williams2021-12-211-0/+2
|
* intern/select/posix.h: remove unused parameter from rb_fd_dupYuta Saito2021-12-111-2/+1
| | | | This unused parameter seems to be accidently introduced by https://github.com/ruby/ruby/commit/9e6e39c
* Add Class#subclassesJean Boussier2021-11-231-1/+14
| | | | | | | Implements [Feature #18273] Returns an array containing the receiver's direct subclasses without singleton classes.
* revival of must_not_null()卜部昌平2021-11-111-8/+6
| | | | | | | | Presence of RBIMPL_ATTR_NONNULL let C compilers to eliminate must_not_null(). Because null pointers are not allowed to exist there are no reason to call the function. In reality null pointers are still passed to those functions in a number of ways. Runtime check for them are definitely nice to have. fix [Feature#18280]
* rb_file_size: add doxygen卜部昌平2021-11-111-0/+17
| | | | Must not be a bad idea to improve documents. [ci skip]
* size_t is not for file sizeNobuyoshi Nakada2021-11-101-1/+1
|
* IO::Buffer for scheduler interface.Samuel Williams2021-11-101-0/+2
|
* [Feature #18290] Deprecate rb_gc_force_recycle and remove ↵Peter Zhu2021-11-081-0/+2
| | | | | | | | invalidate_mark_stack_chunk This commit deprecates rb_gc_force_recycle and coverts it to a no-op function. Also removes invalidate_mark_stack_chunk since only rb_gc_force_recycle uses it.
* Fix typosNobuyoshi Nakada2021-11-022-3/+3
|
* Add Class#descendantsJeremy Evans2021-10-261-0/+13
| | | | | | | | Doesn't include receiver or singleton classes. Implements [Feature #14394] Co-authored-by: fatkodima <fatkodima123@gmail.com> Co-authored-by: Benoit Daloze <eregontp@gmail.com>
* Deprecate include/prepend in refinements and add Refinement#import_methods ↵Shugo Maeda2021-10-211-0/+8
| | | | | | | | | | instead Refinement#import_methods imports methods from modules. Unlike Module#include, it copies methods and adds them into the refinement, so the refinement is activated in the imported methods. [Bug #17429] [ruby-core:101639]
* rb_fiber_raise(): add doxygen卜部昌平2021-09-301-9/+23
| | | | Must not be a bad idea to improve documents.
* Expose `rb_fiber_raise` and tidy up the internal implementation.Samuel Williams2021-09-201-0/+2
|
* suppress GCC's -Wmissing-attribute卜部昌平2021-09-101-0/+2
| | | | I was not aware of this because I use clang these days.
* rb_ary_new_from_values: can take NULLs卜部昌平2021-09-101-1/+0
| | | | Explicit check done at runtime.
* postscript about rb_mutex_sleep卜部昌平2021-09-101-2/+11
| | | | Asked ko1 about the design. [ci skip]
* include/ruby/internal/intern/array.h: add doxygen卜部昌平2021-09-101-39/+619
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/bignum.h: add doxygen卜部昌平2021-09-101-36/+777
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/class.h: add doxygen卜部昌平2021-09-101-23/+314
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/compar.h: add doxygen卜部昌平2021-09-101-2/+30
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/complex.h: add doxygen卜部昌平2021-09-101-4/+197
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/cont.h: add doxygen卜部昌平2021-09-101-3/+201
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/dir.h: add doxygen卜部昌平2021-09-101-0/+9
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/enum.h: add doxygen卜部昌平2021-09-101-1/+41
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/enumerator.h: add doxygen卜部昌平2021-09-101-10/+189
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/error.h: add doxygen卜部昌平2021-09-101-17/+236
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/eval.h: add doxygen卜部昌平2021-09-101-9/+172
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/file.h: add doxygen卜部昌平2021-09-101-9/+159
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/gc.h: add doxygen卜部昌平2021-09-101-19/+352
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/hash.h: add doxygen卜部昌平2021-09-101-19/+279
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/io.h: add doxygen卜部昌平2021-09-101-21/+612
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/load.h: add doxygen卜部昌平2021-09-101-9/+183
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/marshal.h: add doxygen卜部昌平2021-09-101-2/+79
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/numeric.h: add doxygen卜部昌平2021-09-101-10/+175
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/object.h: add doxygen卜部昌平2021-09-101-42/+521
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/parse.h: add doxygen卜部昌平2021-09-101-11/+142
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/proc.h: add doxygen卜部昌平2021-09-101-17/+317
| | | | Must not be a bad idea to improve documents. [ci skip]
* include/ruby/internal/intern/process.h: add doxygen卜部昌平2021-09-101-5/+232
| | | | Must not be a bad idea to improve documents. [ci skip]