<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/defs/id.def, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Binding#implicit_parameters, etc. support the implicit "it" parameter</title>
<updated>2025-12-12T14:24:50+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2025-12-12T07:43:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=129d74c96b0b8f1b93704b34e66d2c18f4835e1b'/>
<id>129d74c96b0b8f1b93704b34e66d2c18f4835e1b</id>
<content type='text'>
[Bug #21049]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21049]
</pre>
</div>
</content>
</entry>
<entry>
<title>prepare IDs for `Ractor::monitor`</title>
<updated>2025-05-31T09:29:02+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-05-31T04:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7b75b1f2da85b3862d4cebe176f41cf044ed6e7f'/>
<id>7b75b1f2da85b3862d4cebe176f41cf044ed6e7f</id>
<content type='text'>
To prevent the following strange error, prepare IDs at first.

```
     &lt;internal:ractor&gt;:596:in 'Ractor#monitor': symbol :exited is already registered with 98610c (fatal)
             from &lt;internal:ractor&gt;:550:in 'Ractor#join'
             from &lt;internal:ractor&gt;:574:in 'Ractor#value'
             from bootstraptest.test_ractor.rb_2013_1309.rb:12:in '&lt;main&gt;'
```

BTW, the error should be fixed on ID management system.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To prevent the following strange error, prepare IDs at first.

```
     &lt;internal:ractor&gt;:596:in 'Ractor#monitor': symbol :exited is already registered with 98610c (fatal)
             from &lt;internal:ractor&gt;:550:in 'Ractor#join'
             from &lt;internal:ractor&gt;:574:in 'Ractor#value'
             from bootstraptest.test_ractor.rb_2013_1309.rb:12:in '&lt;main&gt;'
```

BTW, the error should be fixed on ID management system.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Bug #20965] Define `it` like an ordinary argument" (#12418)</title>
<updated>2024-12-23T04:46:50+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-12-23T04:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=667a0f9f928be843a0810f2c61b633be1f8cd46a'/>
<id>667a0f9f928be843a0810f2c61b633be1f8cd46a</id>
<content type='text'>
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"

Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"

Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20965] Define `it` like an ordinary argument (#12398)</title>
<updated>2024-12-19T07:12:16+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-19T07:12:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46fec0f62a1803d44edb8b06e39ac0f358e56670'/>
<id>46fec0f62a1803d44edb8b06e39ac0f358e56670</id>
<content type='text'>
Also fixes [Bug #20955]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also fixes [Bug #20955]</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #20884] Reserve "Ruby" toplevel name</title>
<updated>2024-12-12T08:45:06+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-12T06:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4d86f3bf6d1fe7bf7d4b25fc42f7aba9f401bbb4'/>
<id>4d86f3bf6d1fe7bf7d4b25fc42f7aba9f401bbb4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Warn when redefining __id__ as well as object_id</title>
<updated>2024-11-30T04:41:00+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2024-11-27T00:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f1dda5ed011b79d0d7bd31b09b55b5e19d8abd0c'/>
<id>f1dda5ed011b79d0d7bd31b09b55b5e19d8abd0c</id>
<content type='text'>
[Feature #20912]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #20912]
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize instructions when creating an array just to call `include?` (#12123)</title>
<updated>2024-11-26T19:31:08+00:00</updated>
<author>
<name>Randy Stauner</name>
<email>randy.stauner@shopify.com</email>
</author>
<published>2024-11-26T19:31:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1dd40ec18a55ff46f52d0ba44ff5d7923f57c08f'/>
<id>1dd40ec18a55ff46f52d0ba44ff5d7923f57c08f</id>
<content type='text'>
* Add opt_duparray_send insn to skip the allocation on `#include?`

If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.

This adds a BOP for include? and tracks redefinition for it on Array.

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;

* YJIT: Implement opt_duparray_send include_p

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;

* Update opt_newarray_send to support simple forms of include?(arg)

Similar to opt_duparray_send but for non-static arrays.

* YJIT: Implement opt_newarray_send include_p

---------

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add opt_duparray_send insn to skip the allocation on `#include?`

If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.

This adds a BOP for include? and tracks redefinition for it on Array.

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;

* YJIT: Implement opt_duparray_send include_p

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;

* Update opt_newarray_send to support simple forms of include?(arg)

Similar to opt_duparray_send but for non-static arrays.

* YJIT: Implement opt_newarray_send include_p

---------

Co-authored-by: Andrew Novoselac &lt;andrew.novoselac@shopify.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Expand opt_newarray_send to support Array#pack with buffer keyword arg</title>
<updated>2024-07-29T20:26:58+00:00</updated>
<author>
<name>Randy Stauner</name>
<email>randy.stauner@shopify.com</email>
</author>
<published>2024-07-20T17:03:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=acbb8d4fb56ac3b5894991760a075dbef78d10e3'/>
<id>acbb8d4fb56ac3b5894991760a075dbef78d10e3</id>
<content type='text'>
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: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,34)&gt;
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                 &lt;calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0007 newarray                               1
0009 putchilledstring                       "E*"
0011 getlocal_WC_0                          b@0
0013 opt_send_without_block                 &lt;calldata!mid:pack, argc:2, kw:[#&lt;Symbol:0x000000000023110c&gt;], KWARG&gt;
0015 leave
```

after:

```
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,34)&gt;
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                 &lt;calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0007 putchilledstring                       "E*"
0009 getlocal                               b@0, 0
0012 opt_newarray_send                      3, 5
0015 leave
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,34)&gt;
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                 &lt;calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0007 newarray                               1
0009 putchilledstring                       "E*"
0011 getlocal_WC_0                          b@0
0013 opt_send_without_block                 &lt;calldata!mid:pack, argc:2, kw:[#&lt;Symbol:0x000000000023110c&gt;], KWARG&gt;
0015 leave
```

after:

```
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,34)&gt;
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                 &lt;calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0007 putchilledstring                       "E*"
0009 getlocal                               b@0, 0
0012 opt_newarray_send                      3, 5
0015 leave
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce a specialize instruction for Array#pack</title>
<updated>2024-05-23T19:11:50+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-05-23T18:23:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=49fcd33e136ee2fe8720183b63a41bb6ef8d615c'/>
<id>49fcd33e136ee2fe8720183b63a41bb6ef8d615c</id>
<content type='text'>
Instructions for this code:

```ruby
  # frozen_string_literal: true

[a].pack("C")
```

Before this commit:

```
== disasm: #&lt;ISeq:&lt;main&gt;@test.rb:1 (1,0)-(3,13)&gt;
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 &lt;calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0003 newarray                               1
0005 putobject                              "C"
0007 opt_send_without_block                 &lt;calldata!mid:pack, argc:1, ARGS_SIMPLE&gt;
0009 leave
```

After this commit:

```
== disasm: #&lt;ISeq:&lt;main&gt;@test.rb:1 (1,0)-(3,13)&gt;
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 &lt;calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0003 putobject                              "C"
0005 opt_newarray_send                      2, :pack
0008 leave
```

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instructions for this code:

```ruby
  # frozen_string_literal: true

[a].pack("C")
```

Before this commit:

```
== disasm: #&lt;ISeq:&lt;main&gt;@test.rb:1 (1,0)-(3,13)&gt;
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 &lt;calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0003 newarray                               1
0005 putobject                              "C"
0007 opt_send_without_block                 &lt;calldata!mid:pack, argc:1, ARGS_SIMPLE&gt;
0009 leave
```

After this commit:

```
== disasm: #&lt;ISeq:&lt;main&gt;@test.rb:1 (1,0)-(3,13)&gt;
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 &lt;calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE&gt;
0003 putobject                              "C"
0005 opt_newarray_send                      2, :pack
0008 leave
```

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Emit special instruction for array literal + .(hash|min|max)</title>
<updated>2023-04-19T00:16:22+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2022-06-07T00:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c5fc1ce975ecdf1c6818714e47579c5d3531c4ca'/>
<id>c5fc1ce975ecdf1c6818714e47579c5d3531c4ca</id>
<content type='text'>
This commit introduces a new instruction `opt_newarray_send` which is
used when there is an array literal followed by either the `hash`,
`min`, or `max` method.

```
[a, b, c].hash
```

Will emit an `opt_newarray_send` instruction.  This instruction falls
back to a method call if the "interested" method has been monkey
patched.

Here are some examples of the instructions generated:

```
$ ./miniruby --dump=insns -e '[@a, @b].max'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,12)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :max
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].min'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,12)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :min
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].hash'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,13)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :hash
0009 leave
```

[Feature #18897] [ruby-core:109147]

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit introduces a new instruction `opt_newarray_send` which is
used when there is an array literal followed by either the `hash`,
`min`, or `max` method.

```
[a, b, c].hash
```

Will emit an `opt_newarray_send` instruction.  This instruction falls
back to a method call if the "interested" method has been monkey
patched.

Here are some examples of the instructions generated:

```
$ ./miniruby --dump=insns -e '[@a, @b].max'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,12)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :max
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].min'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,12)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :min
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].hash'
== disasm: #&lt;ISeq:&lt;main&gt;@-e:1 (1,0)-(1,13)&gt; (catch: FALSE)
0000 getinstancevariable                    :@a, &lt;is:0&gt;               (   1)[Li]
0003 getinstancevariable                    :@b, &lt;is:1&gt;
0006 opt_newarray_send                      2, :hash
0009 leave
```

[Feature #18897] [ruby-core:109147]

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
