<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/insns.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>Ensure f(**kw, &amp;block) calls kw.to_hash before block.to_proc</title>
<updated>2023-12-09T21:15:47+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-11-08T23:56:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a950f230788d51e13d16596e37cb77e4cc6e2311'/>
<id>a950f230788d51e13d16596e37cb77e4cc6e2311</id>
<content type='text'>
Previously, block.to_proc was called first, by vm_caller_setup_arg_block.
kw.to_hash was called later inside CALLER_SETUP_ARG or setup_parameters_complex.

This adds a splatkw instruction that is inserted before sends with
ARGS_BLOCKARG and KW_SPLAT and without KW_SPLAT_MUT. This is not needed in the
KW_SPLAT_MUT case, because then you know the value is a hash, and you don't
need to call to_hash on it.

The splatkw instruction checks whether the second to top block is a hash,
and if not, replaces it with the value of calling to_hash on it (using
rb_to_hash_type).  As it is always before a send with ARGS_BLOCKARG and
KW_SPLAT, second to top is the keyword splat, and top is the passed block.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, block.to_proc was called first, by vm_caller_setup_arg_block.
kw.to_hash was called later inside CALLER_SETUP_ARG or setup_parameters_complex.

This adds a splatkw instruction that is inserted before sends with
ARGS_BLOCKARG and KW_SPLAT and without KW_SPLAT_MUT. This is not needed in the
KW_SPLAT_MUT case, because then you know the value is a hash, and you don't
need to call to_hash on it.

The splatkw instruction checks whether the second to top block is a hash,
and if not, replaces it with the value of calling to_hash on it (using
rb_to_hash_type).  As it is always before a send with ARGS_BLOCKARG and
KW_SPLAT, second to top is the keyword splat, and top is the passed block.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make expandarray compaction safe</title>
<updated>2023-12-01T22:13:56+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-11-30T15:51:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0aed37b973c66e9ff071a1f46944cb0c6151d2dc'/>
<id>0aed37b973c66e9ff071a1f46944cb0c6151d2dc</id>
<content type='text'>
The expandarray instruction can allocate an array, which can trigger
a GC compaction. However, since it does not increment the sp until the
end of the instruction, the objects it places on the stack are not
marked or reference updated by the GC, which can cause the objects to
move which leaves broken or incorrect objects on the stack.

This commit changes the instruction to be handles_sp so the sp is
incremented inside of the instruction right after the object is written
on the stack.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The expandarray instruction can allocate an array, which can trigger
a GC compaction. However, since it does not increment the sp until the
end of the instruction, the objects it places on the stack are not
marked or reference updated by the GC, which can cause the objects to
move which leaves broken or incorrect objects on the stack.

This commit changes the instruction to be handles_sp so the sp is
incremented inside of the instruction right after the object is written
on the stack.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fallback opt_getconstant_path for const_missing (#8623)</title>
<updated>2023-10-13T15:52:23+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-10-13T15:52:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5808999d30fc7c4fd74048a50129fd87b590b41c'/>
<id>5808999d30fc7c4fd74048a50129fd87b590b41c</id>
<content type='text'>
* YJIT: Fallback opt_getconstant_path for const_missing

* Fix a comment [ci skip]

* Remove a wrapper function</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Fallback opt_getconstant_path for const_missing

* Fix a comment [ci skip]

* Remove a wrapper function</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused opt_call_c_function insn (#7750)</title>
<updated>2023-04-22T06:58:07+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-04-22T06:58:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1702b0f438b2ac7c8b7d9c42bb5dfe23fad1df0f'/>
<id>1702b0f438b2ac7c8b7d9c42bb5dfe23fad1df0f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
<entry>
<title>Refactor jit_func_t and jit_exec</title>
<updated>2023-03-16T17:42:17+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-03-16T17:41:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9947574b9cad74fbf04fa44d49647c591590c511'/>
<id>9947574b9cad74fbf04fa44d49647c591590c511</id>
<content type='text'>
I closed https://github.com/ruby/ruby/pull/7543, but part of the diff
seems useful regardless, so I extracted it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I closed https://github.com/ruby/ruby/pull/7543, but part of the diff
seems useful regardless, so I extracted it.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Implement throw instruction (#7491)</title>
<updated>2023-03-14T20:39:06+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-03-14T20:39:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9a43c63d436568350333964a859fd14987a029f0'/>
<id>9a43c63d436568350333964a859fd14987a029f0</id>
<content type='text'>
* Break up jit_exec from vm_sendish

* YJIT: Implement throw instruction

* YJIT: Explain what rb_vm_throw does [ci skip]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Break up jit_exec from vm_sendish

* YJIT: Implement throw instruction

* YJIT: Explain what rb_vm_throw does [ci skip]</pre>
</div>
</content>
</entry>
<entry>
<title>rename `defined_ivar` to `definedivar`</title>
<updated>2023-03-09T15:37:11+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-03-09T15:34:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=262254dc7dd9b503ca01ab701eb5cdd96bce4c4d'/>
<id>262254dc7dd9b503ca01ab701eb5cdd96bce4c4d</id>
<content type='text'>
because non-opt instructions should contain `_` char.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
because non-opt instructions should contain `_` char.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add defined_ivar instruction</title>
<updated>2023-03-08T17:34:31+00:00</updated>
<author>
<name>Ole Friis Østergaard</name>
<email>olefriis@gmail.com</email>
</author>
<published>2023-02-28T12:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1a3f8e1c9f6ce4b1cd7236fdcdd17a8719654320'/>
<id>1a3f8e1c9f6ce4b1cd7236fdcdd17a8719654320</id>
<content type='text'>
This is a variation of the `defined` instruction, for use when we
are checking for an instance variable. Splitting this out as a
separate instruction lets us skip some checks, and it also allows
us to use an instance variable cache, letting shape analysis
speed up the operation further.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a variation of the `defined` instruction, for use when we
are checking for an instance variable. Splitting this out as a
separate instruction lets us skip some checks, and it also allows
us to use an instance variable cache, letting shape analysis
speed up the operation further.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove obsoleted MJIT_HEADER macro</title>
<updated>2023-03-07T06:29:35+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-03-07T06:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=290e26c729a083f4461d2497099d9e7eee814228'/>
<id>290e26c729a083f4461d2497099d9e7eee814228</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
