| Age | Commit message (Collapse) | Author |
|
heredoc (#13000)
Notes:
Merged-By: tompng <tomoyapenguin@gmail.com>
|
|
limit
|
|
(https://github.com/ruby/etc/pull/55)
https://bugs.ruby-lang.org/issues/21204
TestEtc#test_ractor_parallel is only failing intermittently on ModGC workflow after 87fb0c4. So, we'll skip this test on ModGC workflow.
https://github.com/ruby/etc/commit/fb037c5162
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
https://github.com/ruby/json/commit/1b16a82980
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
By leveraging the `on_load` callback we can move all this logic
out of the parser. Which mean we no longer have to duplicate
that logic in both parser and that we'll later be able to extract
it entirely from the gem.
https://github.com/ruby/json/commit/f411ddf1ce
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
And substitute the return value like `Marshal.load` doesm
which I can only assume was the intent.
This also open the door to re-implement all the `create_addition`
logic in `json/common.rb`.
https://github.com/ruby/json/commit/73d2137fd3
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
https://github.com/ruby/json/commit/1ca7efed1f
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
https://github.com/ruby/json/commit/01c47a0555
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
https://github.com/ruby/json/commit/6508455d82
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
|
|
Anonymous positional splats cannot be directly accessed, they can
only be passed as splats to other methods. So if an anonymous
positional splat would be empty, you can use a shared frozen
empty array to save an allocation.
```ruby
def a(*) end
a()
```
This is similar to how anonymous empty keyword splats are optimized,
except those use `nil` instead of a shared empty frozen hash.
This updates the allocation tests to check that the array allocations
are avoided where possible.
It also makes a small change to test_iseq.rb to ensure an unfrozen
hash is passed as the value of an anonymous splat parameter.
Notes:
Merged: https://github.com/ruby/ruby/pull/12596
|
|
* If this fails, please revert this commit in ruby/etc
to keep the repos sync'ed.
https://github.com/ruby/etc/commit/87fb0c4a83
|
|
https://github.com/ruby/etc/commit/18c12c084c
|
|
* It seems much slower on macOS (locally on Linux it's always < 1 second).
https://github.com/ruby/etc/commit/9e46857011
|
|
This is messing up the CRuby sync, so moving them out of the test
directory will make this easier.
https://github.com/ruby/prism/commit/7ba13bfb68
|
|
The following method call:
```ruby
a(*nil)
```
A method call such as `a(*nil)` previously allocated an array, because
it calls `nil.to_a`, but I have determined this array allocation is
unnecessary. The instructions in this case are:
```
0000 putself ( 1)[Li]
0001 putnil
0002 splatarray false
0004 opt_send_without_block <calldata!mid:a, argc:1, ARGS_SPLAT|FCALL>
0006 leave
```
The method call uses `ARGS_SPLAT` without `ARGS_SPLAT_MUT`, so the
returned array doesn't need to be mutable. I believe all cases where
`splatarray false` are used allow the returned object to be frozen,
since the `false` means to not duplicate the array. The optimization
in this case is to have `splatarray false` push a shared empty frozen
array, instead of calling `nil.to_a` to return a newly allocated array.
There is a slightly backwards incompatibility with this optimization,
in that `nil.to_a` is not called. However, I believe the new behavior
of `*nil` not calling `nil.to_a` is more consistent with how `**nil`
does not call `nil.to_hash`. Also, so much Ruby code would break if
`nil.to_a` returned something different from the empty hash, that it's
difficult to imagine anyone actually doing that in real code, though
we have a few tests/specs for that.
I think it would be bad for consistency if `*nil` called `nil.to_a`
in some cases and not others, so this changes other cases to not
call `nil.to_a`:
For `[*nil]`, this uses `splatarray true`, which now allocates a
new array for a `nil` argument without calling `nil.to_a`.
For `[1, *nil]`, this uses `concattoarray`, which now returns
the first array if the second array is `nil`.
This updates the allocation tests to check that the array allocations
are avoided where possible.
Implements [Feature #21047]
Notes:
Merged: https://github.com/ruby/ruby/pull/12597
|
|
Fix https://github.com/ruby/psych/pull/644
https://github.com/ruby/psych/commit/b1ade765ba
|
|
(#12996)
TestThreadInstrumentation#test_sleeping_inside_ractor is a flaky and failing intermittently. Additionally, Launchable reported this test as a top flaky test. (Link: https://app.launchableinc.com/organizations/ruby/workspaces/ruby/insights/unhealthy-tests)
It failed only failed intermittently on ModGC workflow, so I'm gonna skip this test on ModGC workflow.
Notes:
Merged-By: ono-max <onoto1998@gmail.com>
|
|
This decouples `gem exec` behavior (and tests) from the sort order of
the gemspec.
https://github.com/rubygems/rubygems/commit/911cd29159
|
|
... because it is flaky
Notes:
Merged: https://github.com/ruby/ruby/pull/12992
|
|
|
|
This commit provides an alternative implementation for a
long → decimal conversion.
The main difference is that it uses an algorithm pulled from
https://github.com/jeaiii/itoa.
The source there is C++, it was converted by hand to C for
inclusion with this gem.
jeaiii's algorithm is covered by the MIT License, see source code.
On addition this version now also generates the string directly into
the fbuffer, foregoing the need to run a separate memory copy.
As a result, I see a speedup of 32% on Apple Silicon M1 for an
integer set of benchmarks.
|
|
Globally changing the behavior of the library is a bad idea, as
many different libraries may rely on `json` and may not expect it
and likely never tested that a different default config works for them.
If you need to change the behavior of JSON, it's best to do it only
locally, and not globally.
In addition the new `JSON::Coder` interface is much more suited for
that.
Another reason for the deprecation is that it's impossible to
make `JSON.load` and `JSON.dump` Ractor-safe with such API.
https://github.com/ruby/json/commit/172762c6e4
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12977
|
|
* Because it uses RbConfig::CONFIG.
* See https://github.com/ruby/ruby/actions/runs/14069312270/job/39399502142#step:12:947
https://github.com/ruby/etc/commit/12dbe03b6a
|
|
* See https://bugs.ruby-lang.org/issues/21115
https://github.com/ruby/etc/commit/ae62b7619c
|
|
Adds a test case
fix
https://github.com/ruby/json/commit/fa5bdf87cb
|
|
reproducible builds.
https://github.com/rubygems/rubygems/commit/1d5a627398
Notes:
Merged: https://github.com/ruby/ruby/pull/12968
|
|
When `gem exec foo` is run, and "foo" is a gem that has multiple
executables, none of them named "foo", raise an error explaining the
situation and telling user to be more specific.
Currently the first command in the executables array is run, but this
may come as surprising sometimes, so better raise an error.
https://github.com/rubygems/rubygems/commit/acda5d8f6e
Notes:
Merged: https://github.com/ruby/ruby/pull/12968
|
|
Notes:
Merged-By: eregon <eregontp@gmail.com>
|
|
[Bug #21195]
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
A space is added only when the source path is found.
|
|
|
|
https://github.com/ruby/prism/commit/0073266cad
|
|
https://github.com/ruby/prism/commit/fd96a6821f
Notes:
Merged: https://github.com/ruby/ruby/pull/12958
|
|
It's not my favorite api but for users that currently use the same thing
from `parser`, moving over is more difficult
than it needs to be.
If you plan to support both old and new ruby versions, you definitly need to
branch somewhere on the ruby version
to either choose prism or parser.
But with prism you then need to enumerate all the versions again and choose the correct one.
Also, don't recommend to use `Prism::Translation::Parser` in docs. It's version-less
but actually always just uses Ruby 3.4 which is probably
not what the user intended.
Note: parser also warns when the patch version doesn't match what it expects. But I don't think prism has such a concept,
and anyways it would require releases anytime ruby releases, which I don't think is very desirable
https://github.com/ruby/prism/commit/77177f9e92
|
|
Blocks insert a leading `nop` instruction in order to execute a "block
call" tracepoint. Block compilation unconditionally inserts a leading
`nop` plus a label after the instruction:
https://github.com/ruby/ruby/blob/641f15b1c6bd8921407a1f045573d3b0605f00d3/prism_compile.c#L6867-L6869
This `nop` instruction is used entirely for firing the block entry
tracepoint. The label exists so that the block can contain a loop but
the block entry tracepoint is executed only once.
For example, the following code is an infinite loop, but should only
execute the b_call tracepoint once:
```ruby
-> { redo }.call
```
Previous to this commit, we would eliminate the `nop` instruction, but
only if there were no other jump instructions inside the block. This
means that the following code would still contain a leading `nop` even
though the label following the `nop` is unused:
```ruby
-> { nil if bar }
```
```
== disasm: #<ISeq:block in <main>@test.rb:1 (1,2)-(1,17)> (catch: FALSE)
0000 nop ( 1)[Bc]
0001 putself [Li]
0002 opt_send_without_block <calldata!mid:bar, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0004 branchunless 8
0006 putnil
0007 leave [Br]
0008 putnil
0009 leave [Br]
```
This commit checks to see if the label inserted after the `nop` is
actually a jump target. If it's not a jump target, then we should be
safe to eliminate the leading `nop`:
```
> build-master/miniruby --dump=insns test.rb
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(1,17)>
0000 putspecialobject 1 ( 1)[Li]
0002 send <calldata!mid:lambda, argc:0, FCALL>, block in <main>
0005 leave
== disasm: #<ISeq:block in <main>@test.rb:1 (1,2)-(1,17)>
0000 putself ( 1)[LiBc]
0001 opt_send_without_block <calldata!mid:bar, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 branchunless 7
0005 putnil
0006 leave [Br]
0007 putnil
0008 leave [Br]
```
We have a test for b_call tracepoints that use `redo` here:
https://github.com/ruby/ruby/blob/aebf96f371c8d874398e0041b798892e545fa206/test/ruby/test_settracefunc.rb#L1728-L1736
Notes:
Merged: https://github.com/ruby/ruby/pull/12957
|
|
Instead of requiring the consumer to provide a list of all events which
they wish to handle, we can give them to option of dynamically detecting
them, by scanning the listener's public methods.
This approach is similar to that used by Minitest (scanning for `test_`
methods) and Rails generators (running all public methods in the order
they are defined).
While this is slower than specifying a hard coded list, the penalty is
only during registration. There is no change the the behaviour of
dispatching the events.
https://github.com/ruby/prism/commit/781ebed743
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12925
|
|
https://github.com/ruby/prism/commit/c02429765b
|
|
builder class
In https://github.com/ruby/prism/pull/3494 I added a bit of code
so that using the new builder doesn't break stuff.
This code can be dropped when it is enforced that builder
is _always_ the correct subclass (and makes future issues like that unlikely).
https://github.com/ruby/prism/commit/193d4b806d
|
|
|
|
|
|
Since `rb_bug` does not always take Ruby frame info during SEGV, the
source file path may not be output.
```
1) Failure:
TestRubyOptions#test_crash_report_script [/tmp/ruby/src/trunk_gcc11/test/ruby/test_rubyoptions.rb:907]:
Expected /
bug\.rb:(?:1:)?\s\[BUG\]\sSegmentation\sfault.*\n
/x
to match
"[BUG] Segmentation fault at 0x000003e900328766\n"+
```
http://ci.rvm.jp/results/trunk_gcc11@ruby-sp2-noble-docker/5663880
|
|
[Bug #21029]
Notes:
Merged: https://github.com/ruby/ruby/pull/12949
|
|
https://github.com/ruby/prism/commit/2afe89f8ce
|
|
This can get triggered even if the list of statements only contains
a single statement. This is necessary to properly support compiling
```ruby
defined? (;a)
defined? (a;)
```
as "expression". Previously these were parsed as statements lists
with single statements in them.
https://github.com/ruby/prism/commit/b63b5d67a9
|
|
```
(a,), = []
PARSER====================
s(:masgn,
s(:mlhs,
s(:mlhs,
s(:lvasgn, :a))),
s(:array))
PRISM====================
s(:masgn,
s(:mlhs,
s(:lvasgn, :a)),
s(:array))
```
https://github.com/ruby/prism/commit/8aa1f4690e
|
|
In https://github.com/ruby/prism/commit/26370079291a420c6b2b7be5cdbd5c609da62f21 I added tests but didn't modify them correctly
https://github.com/ruby/prism/commit/de021e74de
|