Age | Commit message (Collapse) | Author |
|
According to Launchable, these tests fail randomly
```
Failure:
TestStringMemory#test_byteslice_prefix [D:/a/ruby/ruby/src/test/ruby/test_string_memory.rb:33]:
<1> expected but was
<2>.
```
https://app.launchableinc.com/organizations/ruby/workspaces/ruby/data/test-paths/file%3Dtest%2Fruby%2Ftest_string_memory.rb%23%23%23class%3DTestStringMemory%23%23%23testcase%3Dtest_byteslice_prefix?testSessionStatus=flake
Notes:
Merged: https://github.com/ruby/ruby/pull/11295
|
|
(https://github.com/ruby/rdoc/pull/1144)
* Add a new ruby parser RDoc::Parser::PrismRuby
* Add a new ruby parser testcase independent from parser's internal implementation
* unknown meta method
* Use MethodSignatureVisitor only to scan params, block_params and calls_super
* Add calls_super test
* Drop ruby 2.6. Prism requires ruby >= 2.7
* Remove duplicated documentation comment from prism_ruby.rb
* Add test for wrong argument passed to metaprogramming method
* Rename visit_call_[DSL_METHOD_NAME] to make it distinguishable from visit_[NODE_TYPE]_node
* Method receiver switch of true/false/nil to a case statement
* Extract common part of add_method(by def keyword) and add meta_comment method
* Reuse consecutive comments array when collecting comments
* Simplify DSL call_node handling
* Refactor extracting method visibility arguments
https://github.com/ruby/rdoc/commit/fde99f1be6
|
|
For example, the following script leaks:
class MyRipper < Ripper
def initialize(src, &blk)
super(src)
@blk = blk
end
def compile_error(msg) = @blk.call(msg)
end
def call_parse = MyRipper.new("/") { |msg| return msg }.parse
10.times do
100_000.times do
call_parse
end
puts `ps -o rss= -p #{$$}`
end
Before:
93952
169040
244224
318784
394432
468224
544048
618560
693776
768384
After:
19776
19776
20352
20880
20912
21408
21328
21152
21472
20944
Notes:
Merged: https://github.com/ruby/ruby/pull/11287
|
|
method.
(https://github.com/ruby/rdoc/pull/1135)
* Unify top_level creation in tests
* Remove unnecessary file_name param from Parser.for
It should be always the same as the top_level's absolute_name, so there's
no point of taking it as a separate parameter.
https://github.com/ruby/rdoc/commit/97c497dfbb
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11284
|
|
default one
Previously, if you have bundler installed both as a regular gem and a
default gem, the default gem would be displayed by `gem list`.
https://github.com/rubygems/rubygems/commit/10a6b1736e
|
|
https://github.com/rubygems/rubygems/commit/775c35e197
|
|
The tests for Integer#ceil was accidentally placed in test_truncate.
|
|
[Bug #20654]
This commit fixes Integer#ceil and Float#ceil when the number is
negative and ndigits is large such that 10**ndigits is a bignum.
Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:
puts 1.ceil(-5) # => 100000
puts 1.ceil(-10) # => 10000000000
puts 1.ceil(-20) # => 0
This commit changes the last result so that it will return
100000000000000000000.
Notes:
Merged: https://github.com/ruby/ruby/pull/11257
|
|
[Bug #20654]
This commit fixes Integer#floor and Float#floor when the number is
negative and ndigits is large such that 10**ndigits is a bignum.
Previously, it would return 0 in such cases. However, this would cause
unexpected behaviour such as:
puts -1.floor(-5) # => -100000
puts -1.floor(-10) # => -10000000000
puts -1.floor(-20) # => 0
This commit changes the last result so that it will return
-100000000000000000000.
Notes:
Merged: https://github.com/ruby/ruby/pull/11257
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11267
Merged-By: nobu <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11254
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11254
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11254
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11276
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11273
|
|
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.98 to 0.9.99.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.98...v0.9.99)
---
updated-dependencies:
- dependency-name: rb-sys
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
https://github.com/rubygems/rubygems/commit/da7b71d188
|
|
This is slowing down benchmarks on x86, so lets revert it for now.
Notes:
Merged: https://github.com/ruby/ruby/pull/11275
|
|
Use an enum for the method arg instead of needing to add an id
that doesn't map to an actual method name.
$ ruby --dump=insns -e 'b = "x"; [v].pack("E*", buffer: b)'
before:
```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring "x" ( 1)[Li]
0002 setlocal_WC_0 b@0
0004 putself
0005 opt_send_without_block <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 newarray 1
0009 putchilledstring "E*"
0011 getlocal_WC_0 b@0
0013 opt_send_without_block <calldata!mid:pack, argc:2, kw:[#<Symbol:0x000000000023110c>], KWARG>
0015 leave
```
after:
```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring "x" ( 1)[Li]
0002 setlocal_WC_0 b@0
0004 putself
0005 opt_send_without_block <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 putchilledstring "E*"
0009 getlocal b@0, 0
0012 opt_newarray_send 3, 5
0015 leave
```
Notes:
Merged: https://github.com/ruby/ruby/pull/11249
|
|
[Bug #20653]
This commit refactors how Onigmo handles timeout. Instead of raising a
timeout error, onig_search will return a ONIGERR_TIMEOUT which the
caller can free memory, and then raise a timeout error.
This fixes a memory leak in String#start_with when the regexp times out.
For example:
regex = Regexp.new("^#{"(a*)" * 10_000}x$", timeout: 0.000001)
str = "a" * 1000000 + "x"
10.times do
100.times do
str.start_with?(regex)
rescue
end
puts `ps -o rss= -p #{$$}`
end
Before:
33216
51936
71152
81728
97152
103248
120384
133392
133520
133616
After:
14912
15376
15824
15824
16128
16128
16144
16144
16160
16160
Notes:
Merged: https://github.com/ruby/ruby/pull/11247
|
|
https://github.com/ruby/net-http/commit/ddb2a81aed
|
|
Hash.new no longer takes keyword arguments except for capacity, so we
should just use a method that takes keyword arguments instead.
Notes:
Merged: https://github.com/ruby/ruby/pull/11246
|
|
https://github.com/ruby/prism/commit/280517c325
|
|
[Bug #20650]
The capture group allocates memory that is leaked when it times out.
For example:
re = Regexp.new("^#{"(a*)" * 10_000}x$", timeout: 0.000001)
str = "a" * 1000000 + "x"
10.times do
100.times do
re =~ str
rescue Regexp::TimeoutError
end
puts `ps -o rss= -p #{$$}`
end
Before:
34688
56416
78288
100368
120784
140704
161904
183568
204320
224800
After:
16288
16288
16880
16896
16912
16928
16944
17184
17184
17200
Notes:
Merged: https://github.com/ruby/ruby/pull/11238
|
|
GitHub Actions macos-14 machine is stupid.
https://app.launchableinc.com/organizations/ruby/workspaces/ruby/data/test-paths/file%3Dtest%2Fruby%2Ftest_file.rb%23%23%23class%3DTestFile%23%23%23testcase%3Dtest_stat?organizationId=ruby&workspaceId=ruby&testPathId=file%3Dtest%2Fruby%2Ftest_file.rb%23%23%23class%3DTestFile%23%23%23testcase%3Dtest_stat&testSessionStatus=flake
Notes:
Merged: https://github.com/ruby/ruby/pull/11241
|
|
OpenSSL::ASN1 is being rewritten in Ruby. To make it easier, let's
remove dependency to the instance variables and the internal-use
function ossl_asn1_get_asn1type() outside OpenSSL::ASN1.
This also fixes the insufficient validation of the passed value with
its tagging.
https://github.com/ruby/openssl/commit/35a157462e
|
|
Fallback to the last token element in that case, for the backward
compatibilities.
Notes:
Merged: https://github.com/ruby/ruby/pull/11235
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11234
|
|
https://github.com/ruby/prism/commit/18a8597276
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11227
|
|
This commit introduce `RubyVM::AbstractSyntaxTree::Node#locations` method
and `RubyVM::AbstractSyntaxTree::Location` class.
Ruby AST node will hold multiple locations information.
`RubyVM::AbstractSyntaxTree::Node#locations` provides a way to access
these locations information.
`RubyVM::AbstractSyntaxTree::Location` is a class which holds these location information:
* `#first_lineno`
* `#first_column`
* `#last_lineno`
* `#last_column`
Notes:
Merged: https://github.com/ruby/ruby/pull/11226
|
|
https://github.com/ruby/prism/commit/5d5bf92be8
|
|
[Bug #20641] `Gem::BUNDLED_GEMS.warning?` adds a lot of extra
work on top of `require`. When the call end up atually loading code
the overhead is somewhat marginal.
However it's not uncommon for code to go some late `require` in some
paths, so it's expected that calling `require` with something already
required is somewhat fast, and `bundled_gems.rb` breaks this assumption.
To avoid this, we can have a fast path that in most case allow to
short-circuit all the heavy computations. If we extract the feature
basename and it doesn't match any of the bundled gems we care about
we can return very early.
With this change `require 'date'` is now only 1.33x slower on Ruby
3.3.3, than it was on Ruby 3.2.2, whereas before this change it
was at least 100x slower.
Notes:
Merged: https://github.com/ruby/ruby/pull/11208
|
|
Unparenthesize the argument and make `command_call` when calling with
`do`-block.
Notes:
Merged: https://github.com/ruby/ruby/pull/11216
|
|
call
Notes:
Merged: https://github.com/ruby/ruby/pull/11215
|
|
Enumerator#zip yields a single array, not multiple arguments,
so Enumerator::Lazy#zip should do the same.
Fixes [#20623]
Notes:
Merged: https://github.com/ruby/ruby/pull/11212
|
|
When calling a method that does not accept a positional splat
parameter with a splatted array with a ruby2_keywords flagged hash,
there is no need to duplicate the splatted array. Previously,
Ruby would duplicate the splatted array and potentially modify
it before flattening it to the VM stack
Use a similar approach as the f(*ary, **hash) optimization,
flattening the splatted array to the VM stack without modifying
it, and make any modifications needed to the VM stack.
Notes:
Merged: https://github.com/ruby/ruby/pull/11161
|
|
When calling a method that accepts keywords but not a keyword
splat with a splatted array with a ruby2_keywords flagged hash,
there is no need to duplicate the ruby2_keywords flagged hash,
since it will be accessed to get the keyword values, but it will
not be modified.
Notes:
Merged: https://github.com/ruby/ruby/pull/11161
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11161
|
|
This avoids an array allocation when calling a method that does
not accept a positional splat or keywords with both a positional
splat and keywords. Previously, Ruby would dup the positional
splat to append the keyword splat to it. Then it would flatten
the dupped positional splat array to the VM stack.
This flattens the given positional splat to the VM stack, then
adds the keyword splat hash after the last positional splat
element on the VM stack, avoiding the need to modify
the positional splat array.
Notes:
Merged: https://github.com/ruby/ruby/pull/11161
|
|
a: lvar), and other calls
The `f(arg, *arg, **arg, **arg)` case was previously not optimized.
The optimizer didn't optimize this case because of the multiple
keyword splats, and the compiler didn't optimize it because the
`f(*arg, **arg, **arg)` optimization added in
0ee3960685e283d8e75149a8777eb0109d41509a didn't apply.
I found it difficult to apply this optimization without changing
the `setup_args_core` API, since by the time you get to the ARGSCAT
case, you don't know whether you were called recursively or directly,
so I'm not sure if it was possible to know at that point whether the
array allocation could be avoided.
This changes the dup_rest argument in `setup_args_core` from an int
to a pointer to int. This allows us to track whether we have allocated
a caller side array for multiple splats or splat+post across
recursive calls. Check the pointed value (*dup_rest) to determine the
`splatarray` argument. If dup_rest is 1, then use `splatarray true`
(caller-side array allocation), then set *dup_rest back to 0, ensuring
only a single `splatarray true` per method call.
Before calling `setup_args_core`, check whether the array allocation
can be avoided safely using `splatarray false`. Optimizable cases are:
```
// f(*arg)
SPLAT
// f(1, *arg)
ARGSCAT
LIST
// f(*arg, **arg)
ARGSPUSH
SPLAT
HASH nd_brace=0
// f(1, *arg, **arg)
ARGSPUSH
ARGSCAT
LIST
HASH nd_brace=0
```
If so, dup_rest is set to 0 instead of 1 to avoid the allocation.
After calling `setup_args_core`, check the flag. If the flag
includes `VM_CALL_ARGS_SPLAT`, and the pointed value has changed,
indicating `splatarray true` was used, then also set
`VM_CALL_ARGS_SPLAT_MUT` in the flag.
My initial attempt at this broke the `f(*ary, &ary.pop)` test,
because we were not duplicating the ary in the splat even though
it was modified later (evaluation order issue). The initial attempt
would also break `f(*ary, **ary.pop)` or `f(*ary, kw: ary.pop)` cases
for the same reason. I added test cases for those evaluation
order issues.
Add setup_args_dup_rest_p static function that checks that a given
node is safe. Call that on the block pass node to determine if
the block pass node is safe. Also call it on each of the hash
key/value nodes to test that they are safe. If any are not safe,
then set dup_rest = 1 so that `splatarray true` will be used to
avoid the evaluation order issue.
This new approach has the affect of optimizing most cases of
literal keywords after positional splats. Previously, only
static keyword hashes after positional splats avoided array
allocation for the splat. Now, most dynamic keyword hashes
after positional splats also avoid array allocation.
Add allocation tests for dynamic keyword keyword hashes after
positional splats.
setup_args_dup_rest_p is currently fairly conservative. It
could definitely be expanded to handle additional node types
to reduce allocations in additional cases.
Notes:
Merged: https://github.com/ruby/ruby/pull/11161
|
|
https://github.com/rubygems/rubygems/commit/7ca06e139b
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11201
|
|
https://github.com/ruby/uri/commit/823697edb4
|
|
using RFC3986_PARSER
https://github.com/ruby/uri/commit/6f616d97fc
|
|
https://github.com/ruby/uri/commit/2e0f73f05e
|
|
https://github.com/ruby/uri/commit/0ab9abbf08
|
|
https://github.com/rubygems/rubygems/commit/155d8fd051
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11192
|
|
user-defined irbrc in TestIRB::ConfigValidationTest
(https://github.com/ruby/irb/pull/982)
https://github.com/ruby/irb/commit/632da0ff29
|