<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/backend/ir.rs, 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>YJIT: Assert no patch overlap on pos_marker (#9048)</title>
<updated>2023-11-28T15:41:14+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-11-28T15:41:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=476a231e7e2c2a370ea9f47c9b62e8d6d3d9442d'/>
<id>476a231e7e2c2a370ea9f47c9b62e8d6d3d9442d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Auto fix for clippy::clone_on_copy</title>
<updated>2023-11-10T21:55:56+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-11-10T20:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0a93ea4808d0d5c2cd0a757abe664e572036fe80'/>
<id>0a93ea4808d0d5c2cd0a757abe664e572036fe80</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Use u32 for CodePtr to save 4 bytes each</title>
<updated>2023-11-07T22:43:43+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-10-16T22:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a1c61f0ae5f5ecaa7d8289942b78e6b0c77118fe'/>
<id>a1c61f0ae5f5ecaa7d8289942b78e6b0c77118fe</id>
<content type='text'>
We've long had a size restriction on the code memory region such that a
u32 could refer to everything. This commit capitalizes on this
restriction by shrinking the size of `CodePtr` to be 4 bytes from 8.

To derive a full raw pointer from a `CodePtr`, one needs a base pointer.
Both `CodeBlock` and `VirtualMemory` can be used for this purpose. The
base pointer is readily available everywhere, except for in the case of
the `jit_return` "branch". Generalize lea_label() to lea_jump_target()
in the IR to delay deriving the `jit_return` address until `compile()`,
when the base pointer is available.

On railsbench, this yields roughly a 1% reduction to `yjit_alloc_size`
(58,397,765 to 57,742,248).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've long had a size restriction on the code memory region such that a
u32 could refer to everything. This commit capitalizes on this
restriction by shrinking the size of `CodePtr` to be 4 bytes from 8.

To derive a full raw pointer from a `CodePtr`, one needs a base pointer.
Both `CodeBlock` and `VirtualMemory` can be used for this purpose. The
base pointer is readily available everywhere, except for in the case of
the `jit_return` "branch". Generalize lea_label() to lea_jump_target()
in the IR to delay deriving the `jit_return` address until `compile()`,
when the base pointer is available.

On railsbench, this yields roughly a 1% reduction to `yjit_alloc_size`
(58,397,765 to 57,742,248).
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Return Option from asm.compile() for has_dropped_bytes()</title>
<updated>2023-10-19T18:56:35+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-10-18T17:34:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cdc2a18541a42e63a8a0a3c2c5b72978ace01afa'/>
<id>cdc2a18541a42e63a8a0a3c2c5b72978ace01afa</id>
<content type='text'>
So that we get a reminder to check CodeBlock::has_dropped_bytes().
Internally, asm.compile() already checks it, and this patch just
propagates it out to the caller with a `#[must_use]`.

Code GC logic moved out one level in entry_stub_hit(), so the body
can freely use `?`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that we get a reminder to check CodeBlock::has_dropped_bytes().
Internally, asm.compile() already checks it, and this patch just
propagates it out to the caller with a `#[must_use]`.

Code GC logic moved out one level in entry_stub_hit(), so the body
can freely use `?`
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Enable the dead_code lint and delete some dead code</title>
<updated>2023-10-19T15:50:36+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-10-18T23:36:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9d9aa63e8240fe2226e756e59876d7b3fe908f1d'/>
<id>9d9aa63e8240fe2226e756e59876d7b3fe908f1d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fix clippy::redundant_locals</title>
<updated>2023-10-17T22:36:23+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2023-10-17T21:49:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=36ee5d8ca824836e10ef18191d789a8b34f87fee'/>
<id>36ee5d8ca824836e10ef18191d789a8b34f87fee</id>
<content type='text'>
&gt; note: `#[deny(clippy::redundant_locals)]` on by default

On Rust 1.73.0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
&gt; note: `#[deny(clippy::redundant_locals)]` on by default

On Rust 1.73.0.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Avoid writing return value to memory in `leave`</title>
<updated>2023-10-05T19:53:05+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-09-30T02:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=41a6e4bdf9738e2cf1ea356422a429efeeb5a8f0'/>
<id>41a6e4bdf9738e2cf1ea356422a429efeeb5a8f0</id>
<content type='text'>
Previously, at the end of `leave` we did
`*caller_cfp-&gt;sp = return_value`, like the interpreter.
With future changes that leaves the SP field uninitialized for C frames,
this will become problematic. For cases like returning from
`rb_funcall()`, the return value was written above the stack and
never read anyway (callers use the copy in the return register).

Leave the return value in a register at the end of `leave` and have the
code at `cfp-&gt;jit_return` decide what to do with it. This avoids the
unnecessary memory write mentioned above. For JIT-to-JIT returns, it goes
through `asm.stack_push()` and benefits from register allocation for
stack temporaries.

Mostly flat on benchmarks, with maybe some marginal speed improvements.

Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, at the end of `leave` we did
`*caller_cfp-&gt;sp = return_value`, like the interpreter.
With future changes that leaves the SP field uninitialized for C frames,
this will become problematic. For cases like returning from
`rb_funcall()`, the return value was written above the stack and
never read anyway (callers use the copy in the return register).

Leave the return value in a register at the end of `leave` and have the
code at `cfp-&gt;jit_return` decide what to do with it. This avoids the
unnecessary memory write mentioned above. For JIT-to-JIT returns, it goes
through `asm.stack_push()` and benefits from register allocation for
stack temporaries.

Mostly flat on benchmarks, with maybe some marginal speed improvements.

Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Chain-guard opt_mult overflow (#8554)</title>
<updated>2023-09-30T01:55:48+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-09-30T01:55:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b67e3fd3ee9969a0c92867bec365104f2b43897'/>
<id>0b67e3fd3ee9969a0c92867bec365104f2b43897</id>
<content type='text'>
* YJIT: Chain-guard opt_mult overflow

* YJIT: Support regenerating Jo after Mul</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Chain-guard opt_mult overflow

* YJIT: Support regenerating Jo after Mul</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Avoid creating a vector in get_temp_regs() (#8446)</title>
<updated>2023-09-16T01:41:00+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-09-16T01:41:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9aeb6e72db7a049a620a6d10836992dc9d0cf3b3'/>
<id>9aeb6e72db7a049a620a6d10836992dc9d0cf3b3</id>
<content type='text'>
* YJIT: Avoid creating a vector in get_temp_regs()

Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;

* Remove unused import

---------

Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Avoid creating a vector in get_temp_regs()

Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;

* Remove unused import

---------

Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fix and enable the unused_imports warning</title>
<updated>2023-09-15T20:15:15+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-09-15T20:15:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0996cf5593b212314221a7c2a72b8a52ece35e94'/>
<id>0996cf5593b212314221a7c2a72b8a52ece35e94</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
