summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-24[ruby/zlib] [Bug #18358] Fix crash in zlib when in progressPeter Zhu
When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called recursively inside the block, a crash can occur because of an use-after-free bug. https://github.com/ruby/zlib/commit/50fb8a0338
2021-11-24[ruby/cgi] Bump versionYusuke Endoh
https://github.com/ruby/cgi/commit/c9c800715e
2021-11-24[ruby/cgi] When parsing cookies, only decode the valuesNobuyoshi Nakada
https://github.com/ruby/cgi/commit/052eb3a828
2021-11-24[ruby/cgi] Fix integer overflowNobuyoshi Nakada
Make use of the check in rb_alloc_tmp_buffer2. https://hackerone.com/reports/1328463 https://github.com/ruby/cgi/commit/c728632c1c
2021-11-24test/ruby/test_iseq.rb: Use __LINE__ to make the error log easy to seeYusuke Endoh
2021-11-23Enhanced RDoc for Float#next_float (#5160)Burdette Lamar
* Enhanced RDoc for Float#next_float Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-23Add setclassvariable to yjit (#5127)Eileen M. Uchitelle
Implements setclassvariable in yjit. Note that this version is not faster than the standard version because we aren't handling the inline cache in assembly. This is still important to implement because it will prevent yjit from exiting in methods that call both a cvar setter and other code that yjit can compile. Co-authored-by: Aaron Patterson tenderlove@ruby-lang.org Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2021-11-24* 2021-11-24 [ci skip]git
2021-11-23Speed up Ractors for Variable Width AllocationPeter Zhu
This commit adds a Ractor cache for every size pool. Previously, all VWA allocated objects used the slowpath and locked the VM. On a micro-benchmark that benchmarks String allocation: VWA turned off: 29.196591 0.889709 30.086300 ( 9.434059) VWA before this commit: 29.279486 41.477869 70.757355 ( 12.527379) VWA after this commit: 16.782903 0.557117 17.340020 ( 4.255603) Notes: Merged: https://github.com/ruby/ruby/pull/5151
2021-11-23Assign temporary ID to anonymous ID [Bug #18250]Nobuyoshi Nakada
Dumped iseq binary can not have unnamed symbols/IDs, and ID 0 is stored instead. As `struct rb_id_table` disallows ID 0, also for the distinction, re-assign a new temporary ID based on the local variable table index when loading from the binary, as well as the parser. Notes: Merged: https://github.com/ruby/ruby/pull/5157
2021-11-23Add an extra failing test case for [Bug #18250]Jean Boussier
The parameter being called `req` specifically causes an assertion error: ``` Assertion failed: (key != 0), function hash_table_raw_insert, file id_table.c, line 153. ``` Renaming the parameter or removing the `*` doesn't reproduce. Notes: Merged: https://github.com/ruby/ruby/pull/5157
2021-11-23Add Class#subclassesJean Boussier
Implements [Feature #18273] Returns an array containing the receiver's direct subclasses without singleton classes. Notes: Merged: https://github.com/ruby/ruby/pull/5045
2021-11-23Suppress the “experimental" warnings for `IO::Buffer`Nobuyoshi Nakada
As this warning is emitted just once per processes, needs in each files when parallel testing.
2021-11-22What's Here section for Integer (#5155)Burdette Lamar
* What's Here section for Integer Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-22Avoid assert failure when NULL EC is expectedAlan Wu
After 5680c38c75aeb5cbd219aafa8eb48c315f287d97, postponed job APIs now expect to be called on native threads not managed by Ruby and handles getting a NULL execution context. However, in debug builds the change runs into an assertion failure with GET_EC() which asserts that EC is non-NULL. Avoid the assertion failure by passing `false` for `expect_ec` instead as the intention is to handle when there is no EC. Add a test from John Crepezzi and John Hawthorn to exercise this situation. See GH-4108 See GH-5094 [Bug #17573] Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: John Crepezzi <john.crepezzi@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/5156 Merged-By: XrXr
2021-11-22YJIT: Make block invalidation more robustAlan Wu
This commit adds an entry_exit field to block_t for use in invalidate_block_version(). By patching the start of the block while invalidating it, invalidate_block_version() can function correctly while there is no executable memory left for new branch stubs. This change additionally fixes correctness for situations where we cannot patch incoming jumps to the invalidated block. In situations such as Shopify/yjit#226, the address to the start of the block is saved and used later, possibly after the block is invalidated. The assume_* family of function now generate block->entry_exit before remembering blocks for invalidation. RubyVM::YJIT.simulate_oom! is introduced for testing out of memory conditions. The test for it is disabled for now because OOM triggers other failure conditions not addressed by this commit. Fixes Shopify/yjit#226 Notes: Merged: https://github.com/ruby/ruby/pull/5145
2021-11-22Enhanced RDoc for Float (#5153)Burdette Lamar
Treats: #> #>= #< #<= #eql? #nan? #infinite? #finite? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-23* 2021-11-23 [ci skip]git
2021-11-22Removes unused HEAP_PAGE_BITMAP_PLANES constant from gc.cJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/4154
2021-11-22Make RCLASS_EXT(c)->subclasses a doubly linked listMatt Valentine-House
Updating RCLASS_PARENT_SUBCLASSES and RCLASS_MODULE_SUBCLASSES while compacting can trigger the read barrier. This commit makes RCLASS_SUBCLASSES a doubly linked list with a dedicated head object so that we can add and remove entries from the list without having to touch an object in the Ruby heap Notes: Merged: https://github.com/ruby/ruby/pull/5125
2021-11-22* 2021-11-22 [ci skip]git
2021-11-22[rubygems/rubygems] Clarify `bundle viz` deprecationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7f22fe56b3
2021-11-21Throttle pull-requests only [ci skip]Nobuyoshi Nakada
2021-11-21Ignore preprocessed C++ files [ci skip]Nobuyoshi Nakada
2021-11-21Update dependenciesNobuyoshi Nakada
2021-11-21Stop including node.h from vm_debug.h only for `NODE`Nobuyoshi Nakada
2021-11-21Adjust formatNobuyoshi Nakada
2021-11-21[ruby/reline] Correct padding space calculationima1zumi
fix https://github.com/ruby/irb/issues/308 This bug occurred when `dialog.width - calculate_width(s, true)` was negative. When `dialog.width` is shorter than `old_dialog.width`, it calculates how much padding it has to do. However, there are cases where `s` is longer than `dialog.width`, as in the issue. In that case, `padding_space_with_escape_sequences` will crash. Here, `old_dialog.width` is longer than `dialog.width`, so I changed the padding width to `old_dialog.width - dialog.width`. https://github.com/ruby/reline/commit/c581c31e0f
2021-11-21Refactor hacky ID tables to struct rb_ast_id_table_tYusuke Endoh
The implementation of a local variable tables was represented as `ID*`, but it was very hacky: the first element is not an ID but the size of the table, and, the last element is (sometimes) a link to the next local table only when the id tables are a linked list. This change converts the hacky implementation to a normal struct. Notes: Merged: https://github.com/ruby/ruby/pull/5136
2021-11-20Enhanced RDoc for Float (#5150)Burdette Lamar
Treated (or previously treated): #quo #% #divmod #**` #eql? #<=> #== #hash Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-21* 2021-11-21 [ci skip]git
2021-11-21Fix setting struct member by public_sendNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5152
2021-11-20`struct_pos_num` is no longer usedNobuyoshi Nakada
2021-11-19Add YJIT codegen for objtostring (#5149)Adam Hess
This is the minimal correct objtostring implementation in YJIT. For correctness, it is important that to_string not get called on strings or subclasses of string. There is a new test for this behavior. A follow up should implement an optimized version for other types as performed in `vm_objtostring`. Co-authored-by: John Hawthorn <jhawthorn@github.com> Co-authored-by: John Hawthorn <jhawthorn@github.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2021-11-19Fix test_super_with_anonymous_block test to use anonymous blockJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/5147
2021-11-20* 2021-11-20 [ci skip]git
2021-11-19Enhanced RDoc for Float (#5144)Burdette Lamar
Treats: #to_s #coerce #+ #- #* #/ Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-11-19Do not document vendored files [ci skip]Nobuyoshi Nakada
Just duplications.
2021-11-19[rubygems/rubygems] Previous logic can mostly go nowDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3241b34055
2021-11-19[rubygems/rubygems] Allow `bundle update` to downgrade gems by changing the ↵David Rodríguez
Gemfile https://github.com/rubygems/rubygems/commit/6a19cca7e5
2021-11-19[rubygems/rubygems] Extract a converge_specs method for later reusing itDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e896e63ac3
2021-11-19[rubygems/rubygems] Avoid unnecessary loopDavid Rodríguez
https://github.com/rubygems/rubygems/commit/afaf868b68
2021-11-19gc.c: Fix a compile error on some crossbuildsYusuke Endoh
http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-wasm32_emscripten/log/20211118T233311Z.log.html.gz#make ``` compiling gc.c gc.c:10629:47: error: implicit conversion loses integer precision: 'unsigned long long' to 'size_t' (aka 'unsigned long') [-Werror,-Wshorten-64-to-32] SET(time, objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gc.c:10624:9: note: expanded from macro 'SET' return attr; \ ~~~~~~ ^~~~ gc.c:10629:47: error: implicit conversion loses integer precision: 'unsigned long long' to 'unsigned long' [-Werror,-Wshorten-64-to-32] SET(time, objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gc.c:10626:68: note: expanded from macro 'SET' rb_hash_aset(hash, gc_stat_symbols[gc_stat_sym_##name], SIZET2NUM(attr)); ~~~~~~~~~ ^~~~ 2 errors generated. ```
2021-11-19optimize `Struct` getter/setterKoichi Sasada
Introduce new optimized method type `OPTIMIZED_METHOD_TYPE_STRUCT_AREF/ASET` with index information. Notes: Merged: https://github.com/ruby/ruby/pull/5131
2021-11-19`rb_method_optimized_t` for further extensionKoichi Sasada
Now `rb_method_optimized_t optimized` field is added to represent optimized method type. Notes: Merged: https://github.com/ruby/ruby/pull/5131
2021-11-19use ULL2NUM directly.Koichi Sasada
@nobu pointed out that ULL (unsigned long long) should have at least 64 bits so ULL2NUM(uint64_t) is not problem. Notes: Merged: https://github.com/ruby/ruby/pull/4757
2021-11-19GC measurement featureKoichi Sasada
* `GC.measure_total_time = true` enables total time measurement (default: true) * `GC.measure_total_time` returns current flag. * `GC.total_time` returns measured total time in nano seconds. * `GC.stat(:time)` (and Hash) returns measured total time in milli seconds. Notes: Merged: https://github.com/ruby/ruby/pull/4757
2021-11-19support `GC.stat(:time)` take 2Koichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/4757
2021-11-18Optimize dynamic string interpolation for symbol/true/false/nil/0-9Jeremy Evans
This provides a significant speedup for symbol, true, false, nil, and 0-9, class/module, and a small speedup in most other cases. Speedups (using included benchmarks): :symbol :: 60% 0-9 :: 50% Class/Module :: 50% nil/true/false :: 20% integer :: 10% [] :: 10% "" :: 3% One reason this approach is faster is it reduces the number of VM instructions for each interpolated value. Initial idea, approach, and benchmarks from Eric Wong. I applied the same approach against the master branch, updating it to handle the significant internal changes since this was first proposed 4 years ago (such as CALL_INFO/CALL_CACHE -> CALL_DATA). I also expanded it to optimize true/false/nil/0-9/class/module, and added handling of missing methods, refined methods, and RUBY_DEBUG. This renames the tostring insn to anytostring, and adds an objtostring insn that implements the optimization. This requires making a few functions non-static, and adding some non-static functions. This disables 4 YJIT tests. Those tests should be reenabled after YJIT optimizes the new objtostring insn. Implements [Feature #13715] Co-authored-by: Eric Wong <e@80x24.org> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Co-authored-by: Koichi Sasada <ko1@atdot.net> Notes: Merged: https://github.com/ruby/ruby/pull/5002 Merged-By: jeremyevans <code@jeremyevans.net>
2021-11-18Anonymous block forwarding allows a method to forward a passedJeremy Evans
block to another method without having to provide a name for the block parameter. Implements [Feature #11256] Co-authored-by: Yusuke Endoh mame@ruby-lang.org Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org Notes: Merged: https://github.com/ruby/ruby/pull/5051