<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/ruby_vm/rjit/insn_compiler.rb, 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>merge revision(s) f8abd24b1f28998157da1230b231419ef7b81722: [Backport #20522]</title>
<updated>2024-06-05T07:29:17+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-06-05T07:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e0fe6f70170924397b957d6cfa84774592b1c809'/>
<id>e0fe6f70170924397b957d6cfa84774592b1c809</id>
<content type='text'>
	Improve YJIT performance warning regression test

	[Bug #20522]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Improve YJIT performance warning regression test

	[Bug #20522]
</pre>
</div>
</content>
</entry>
<entry>
<title>Typofix under lib and test, tool directories</title>
<updated>2023-12-25T02:32:42+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-12-25T02:32:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=27ead9907db12a6ff955cd86a15a62ff1f064392'/>
<id>27ead9907db12a6ff955cd86a15a62ff1f064392</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>RJIT: Avoid retaining unrelated local variables in memory</title>
<updated>2023-12-22T07:00:18+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-12-22T06:57:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f263e447460eb952738f0318ca4e8dee4f4139a5'/>
<id>f263e447460eb952738f0318ca4e8dee4f4139a5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>RJIT: Minimize string allocations in InsnCompiler</title>
<updated>2023-12-22T05:59:33+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-12-22T05:59:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f3c82df944603a590771c83e1e58c51f83eb63cf'/>
<id>f3c82df944603a590771c83e1e58c51f83eb63cf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>RJIT: Convert opt_case_dispatch keys with #to_value</title>
<updated>2023-12-22T01:47:36+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-12-22T01:45:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9a3c49ee5d6dd3770c21ed8193e7efd64cd81a6e'/>
<id>9a3c49ee5d6dd3770c21ed8193e7efd64cd81a6e</id>
<content type='text'>
comptime_key is a Ruby object and the value is not valid in machine code.

This PR also implements `CMP r/m64, imm32 (Mod 01: [reg]+disp8)` that is
now needed for running mail.gem benchmark.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
comptime_key is a Ruby object and the value is not valid in machine code.

This PR also implements `CMP r/m64, imm32 (Mod 01: [reg]+disp8)` that is
now needed for running mail.gem benchmark.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor rb_shape_transition_shape_capa out</title>
<updated>2023-11-08T10:02:55+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-11-07T17:09:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d898e8d6f89fba34a9ee5c0e139f38ac807059e6'/>
<id>d898e8d6f89fba34a9ee5c0e139f38ac807059e6</id>
<content type='text'>
Right now the `rb_shape_get_next` shape caller need to
first check if there is capacity left, and if not call
`rb_shape_transition_shape_capa` before it can call `rb_shape_get_next`.

And on each of these it needs to checks if we got a TOO_COMPLEX
back.

All this logic is duplicated in the interpreter, YJIT and RJIT.

Instead we can have `rb_shape_get_next` do the capacity transition
when needed. The caller can compare the old and new shapes capacity
to know if resizing is needed. It also can check for TOO_COMPLEX
only once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Right now the `rb_shape_get_next` shape caller need to
first check if there is capacity left, and if not call
`rb_shape_transition_shape_capa` before it can call `rb_shape_get_next`.

And on each of these it needs to checks if we got a TOO_COMPLEX
back.

All this logic is duplicated in the interpreter, YJIT and RJIT.

Instead we can have `rb_shape_get_next` do the capacity transition
when needed. The caller can compare the old and new shapes capacity
to know if resizing is needed. It also can check for TOO_COMPLEX
only once.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor rb_shape_transition_shape_capa to not accept capacity</title>
<updated>2023-10-10T12:47:54+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-10-10T11:12:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5cc44f48c51974a84a40480477a4afd8901ae7e4'/>
<id>5cc44f48c51974a84a40480477a4afd8901ae7e4</id>
<content type='text'>
This way the groth factor is encapsulated, which allows
rb_shape_transition_shape_capa to be smarter about ideal sizes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This way the groth factor is encapsulated, which allows
rb_shape_transition_shape_capa to be smarter about ideal sizes.
</pre>
</div>
</content>
</entry>
<entry>
<title>RJIT: Remove Type::CArray and limit use of Type::CString</title>
<updated>2023-08-28T21:14:33+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-08-28T19:29:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=85aa28e8a65b0b0691bf18f4af13adf080638035'/>
<id>85aa28e8a65b0b0691bf18f4af13adf080638035</id>
<content type='text'>
See previous similar YJIT commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See previous similar YJIT commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove __bp__ and speed-up bmethod calls  (#8060)</title>
<updated>2023-07-17T17:57:58+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-07-17T17:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f302e725e10ae05e613e2c24cae0741f65f2db91'/>
<id>f302e725e10ae05e613e2c24cae0741f65f2db91</id>
<content type='text'>
Remove rb_control_frame_t::__bp__ and optimize bmethod calls

This commit removes the __bp__ field from rb_control_frame_t. It was
introduced to help MJIT, but since MJIT was replaced by RJIT, we can use
vm_base_ptr() to compute it from the SP of the previous control frame
instead. Removing the field avoids needing to set it up when pushing new
frames.

Simply removing __bp__ would cause crashes since RJIT and YJIT used a
slightly different stack layout for bmethod calls than the interpreter.
At the moment of the call, the two layouts looked as follows:

                   ┌────────────┐    ┌────────────┐
                   │ frame_base │    │ frame_base │
                   ├────────────┤    ├────────────┤
                   │    ...     │    │    ...     │
                   ├────────────┤    ├────────────┤
                   │    args    │    │    args    │
                   ├────────────┤    └────────────┘&lt;─prev_frame_sp
                   │  receiver  │
    prev_frame_sp─&gt;└────────────┘
                     RJIT &amp; YJIT      interpreter

Essentially, vm_base_ptr() needs to compute the address to frame_base
given prev_frame_sp in the diagrams. The presence of the receiver
created an off-by-one situation.

Make the interpreter use the layout the JITs use for iseq-to-iseq
bmethod calls. Doing so removes unnecessary argument shifting and
vm_exec_core() re-entry from the interpreter, yielding a speed
improvement visible through `benchmark/vm_defined_method.yml`:

     patched:   7578743.1 i/s
      master:   4796596.3 i/s - 1.58x  slower

C-to-iseq bmethod calls now store one more VALUE than before, but that
should have negligible impact on overall performance.

Note that re-entering vm_exec_core() used to be necessary for firing
TracePoint events, but that's no longer the case since
9121e57a5f50bc91bae48b3b91edb283bf96cb6b.

Closes ruby/ruby#6428</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove rb_control_frame_t::__bp__ and optimize bmethod calls

This commit removes the __bp__ field from rb_control_frame_t. It was
introduced to help MJIT, but since MJIT was replaced by RJIT, we can use
vm_base_ptr() to compute it from the SP of the previous control frame
instead. Removing the field avoids needing to set it up when pushing new
frames.

Simply removing __bp__ would cause crashes since RJIT and YJIT used a
slightly different stack layout for bmethod calls than the interpreter.
At the moment of the call, the two layouts looked as follows:

                   ┌────────────┐    ┌────────────┐
                   │ frame_base │    │ frame_base │
                   ├────────────┤    ├────────────┤
                   │    ...     │    │    ...     │
                   ├────────────┤    ├────────────┤
                   │    args    │    │    args    │
                   ├────────────┤    └────────────┘&lt;─prev_frame_sp
                   │  receiver  │
    prev_frame_sp─&gt;└────────────┘
                     RJIT &amp; YJIT      interpreter

Essentially, vm_base_ptr() needs to compute the address to frame_base
given prev_frame_sp in the diagrams. The presence of the receiver
created an off-by-one situation.

Make the interpreter use the layout the JITs use for iseq-to-iseq
bmethod calls. Doing so removes unnecessary argument shifting and
vm_exec_core() re-entry from the interpreter, yielding a speed
improvement visible through `benchmark/vm_defined_method.yml`:

     patched:   7578743.1 i/s
      master:   4796596.3 i/s - 1.58x  slower

C-to-iseq bmethod calls now store one more VALUE than before, but that
should have negligible impact on overall performance.

Note that re-entering vm_exec_core() used to be necessary for firing
TracePoint events, but that's no longer the case since
9121e57a5f50bc91bae48b3b91edb283bf96cb6b.

Closes ruby/ruby#6428</pre>
</div>
</content>
</entry>
<entry>
<title>Remove RARRAY_CONST_PTR_TRANSIENT</title>
<updated>2023-07-13T18:48:14+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-07-13T13:45:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=32231812845e5302bd457f7e4a534e7965d89d49'/>
<id>32231812845e5302bd457f7e4a534e7965d89d49</id>
<content type='text'>
RARRAY_CONST_PTR now does the same things as RARRAY_CONST_PTR_TRANSIENT.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RARRAY_CONST_PTR now does the same things as RARRAY_CONST_PTR_TRANSIENT.
</pre>
</div>
</content>
</entry>
</feed>
