<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/defs/id.def, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<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>
<entry>
<title>Move `attached_object` into `rb_classext_struct`</title>
<updated>2023-02-16T07:14:44+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-02-15T14:18:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1a4b4cd7f8b53fc52191c1ddcf3f624a5e687c24'/>
<id>1a4b4cd7f8b53fc52191c1ddcf3f624a5e687c24</id>
<content type='text'>
Given that signleton classes don't have an allocator,
we can re-use these bytes to store the attached object
in `rb_classext_struct` without making it larger.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Given that signleton classes don't have an allocator,
we can re-use these bytes to store the attached object
in `rb_classext_struct` without making it larger.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use a BOP for Hash#default</title>
<updated>2022-12-17T22:51:49+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2022-12-15T18:46:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fbaa5db44a3b0622e2755fd00e0519a603aa9bcb'/>
<id>fbaa5db44a3b0622e2755fd00e0519a603aa9bcb</id>
<content type='text'>
On a hash miss we need to call default if it is redefined in order to
return the default value to be used. Previously we checked this with
rb_method_basic_definition_p, which avoids the method call but requires
a method lookup.

This commit replaces the previous check with BASIC_OP_UNREDEFINED_P and
a new BOP_DEFAULT. We still need to fall back to
rb_method_basic_definition_p when called on a subclasss of hash.

    |                |compare-ruby|built-ruby|
    |:---------------|-----------:|---------:|
    |hash_aref_miss  |       2.692|     3.531|
    |                |           -|     1.31x|

Co-authored-by: Daniel Colson &lt;danieljamescolson@gmail.com&gt;
Co-authored-by: "Ian C. Anderson" &lt;ian@iancanderson.com&gt;
Co-authored-by: Jack McCracken &lt;me@jackmc.xyz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On a hash miss we need to call default if it is redefined in order to
return the default value to be used. Previously we checked this with
rb_method_basic_definition_p, which avoids the method call but requires
a method lookup.

This commit replaces the previous check with BASIC_OP_UNREDEFINED_P and
a new BOP_DEFAULT. We still need to fall back to
rb_method_basic_definition_p when called on a subclasss of hash.

    |                |compare-ruby|built-ruby|
    |:---------------|-----------:|---------:|
    |hash_aref_miss  |       2.692|     3.531|
    |                |           -|     1.31x|

Co-authored-by: Daniel Colson &lt;danieljamescolson@gmail.com&gt;
Co-authored-by: "Ian C. Anderson" &lt;ian@iancanderson.com&gt;
Co-authored-by: Jack McCracken &lt;me@jackmc.xyz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce `IO.new(..., path:)` and promote `File#path` to `IO#path`. (#6867)</title>
<updated>2022-12-08T05:19:53+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-12-08T05:19:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6fd5d2dc003bda5ce0685abd2b975d7ac7079d46'/>
<id>6fd5d2dc003bda5ce0685abd2b975d7ac7079d46</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Generate token ID indexes in id.def</title>
<updated>2022-09-08T09:18:56+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-09-08T06:25:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a977c663123f7256f51201ed8390dc84adf63cf6'/>
<id>a977c663123f7256f51201ed8390dc84adf63cf6</id>
<content type='text'>
Separate the logic accross the tables from the template view for
id.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Separate the logic accross the tables from the template view for
id.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a Module#const_added callback</title>
<updated>2022-01-14T10:30:07+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-05-22T10:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8d05047d72d0a4b97f57b23bddbca639375bbd03'/>
<id>8d05047d72d0a4b97f57b23bddbca639375bbd03</id>
<content type='text'>
[Feature #17881]

Works similarly to `method_added` but for constants.

```ruby
Foo::BAR = 42 # call Foo.const_added(:FOO)
class Foo::Baz; end # call Foo.const_added(:Baz)
Foo.autoload(:Something, "path") # call Foo.const_added(:Something)
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #17881]

Works similarly to `method_added` but for constants.

```ruby
Foo::BAR = 42 # call Foo.const_added(:FOO)
class Foo::Baz; end # call Foo.const_added(:Baz)
Foo.autoload(:Something, "path") # call Foo.const_added(:Something)
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Show verbose error messages when single pattern match fails</title>
<updated>2021-08-15T00:38:24+00:00</updated>
<author>
<name>Kazuki Tsujimoto</name>
<email>kazuki@callcc.net</email>
</author>
<published>2021-08-15T00:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4568ba071107a139b9f02fc17aa12f998181abf1'/>
<id>4568ba071107a139b9f02fc17aa12f998181abf1</id>
<content type='text'>
    [0] =&gt; [0, *, a]
    #=&gt; [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError)

Ignore test failures of typeprof caused by this change for now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    [0] =&gt; [0, *, a]
    #=&gt; [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError)

Ignore test failures of typeprof caused by this change for now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Predefine recursive key ID</title>
<updated>2021-07-27T06:40:27+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-07-27T00:28:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=82191da2a28c8da0f1049ca6d814c9da992c39a1'/>
<id>82191da2a28c8da0f1049ca6d814c9da992c39a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Added intern_ids.rb</title>
<updated>2021-07-27T06:40:27+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-07-27T00:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0754cc4888bf96c77504c385d7aab0068202aa8f'/>
<id>0754cc4888bf96c77504c385d7aab0068202aa8f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Method reference operator"</title>
<updated>2019-11-12T08:24:48+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-10-23T16:06:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fb6a489af2765a3b56e301adf0019af6bbad6156'/>
<id>fb6a489af2765a3b56e301adf0019af6bbad6156</id>
<content type='text'>
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b.
[Feature #16275]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b.
[Feature #16275]
</pre>
</div>
</content>
</entry>
</feed>
