<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/backend/arm64, 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: Avoid a register spill on arm64 (#9014)</title>
<updated>2023-11-22T23:13:32+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-11-22T23:13:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=926bfc3bc0cfea976533c8eba8cda1fa298124e2'/>
<id>926bfc3bc0cfea976533c8eba8cda1fa298124e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Invoke PosMarker callbacks only with solid positions</title>
<updated>2023-11-10T16:51:05+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-11-09T17:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38fe710e08db3d93b6225f9c41c18c672e602d7f'/>
<id>38fe710e08db3d93b6225f9c41c18c672e602d7f</id>
<content type='text'>
Previously, PosMarker callbacks ran even when the assembler failed to
assemble its contents due to insufficient space. This was problematic
because when Assembler::compile() failed, the callbacks were given
positions that have no valid code, contrary to general expectation.

For example, we use a PosMarker callback to record VM instruction
boundaries and patch in jumps to exits in case the guest program starts
tracing, however, previously, we could record a location near the end of
the code block, where there is no space to patch in jumps. I suspect
this is the cause of the recent occurrences of rare random failures on
GitHub Actions with the invariants.rs:529 "can rewrite existing code"
message. `--yjit-perf` also uses PosMarker and had a similar issue.

Buffer the list of callbacks to fire, and only fire them when all code
in the assembler are written out successfully. It's more intuitive this
way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, PosMarker callbacks ran even when the assembler failed to
assemble its contents due to insufficient space. This was problematic
because when Assembler::compile() failed, the callbacks were given
positions that have no valid code, contrary to general expectation.

For example, we use a PosMarker callback to record VM instruction
boundaries and patch in jumps to exits in case the guest program starts
tracing, however, previously, we could record a location near the end of
the code block, where there is no space to patch in jumps. I suspect
this is the cause of the recent occurrences of rare random failures on
GitHub Actions with the invariants.rs:529 "can rewrite existing code"
message. `--yjit-perf` also uses PosMarker and had a similar issue.

Buffer the list of callbacks to fire, and only fire them when all code
in the assembler are written out successfully. It's more intuitive this
way.
</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: Delete some dead code and enable lints</title>
<updated>2023-11-03T18:47:41+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-11-03T18:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38bdb9d0da1647a9b91463183a9b61330243d908'/>
<id>38bdb9d0da1647a9b91463183a9b61330243d908</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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: 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: implement fast path for integer multiplication in opt_mult (#8204)</title>
<updated>2023-08-18T14:05:32+00:00</updated>
<author>
<name>Maxime Chevalier-Boisvert</name>
<email>maxime.chevalierboisvert@shopify.com</email>
</author>
<published>2023-08-18T14:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=314eed8a5ec9f1b46624b277dde75f8079026b7b'/>
<id>314eed8a5ec9f1b46624b277dde75f8079026b7b</id>
<content type='text'>
* YJIT: implement fast path for integer multiplication in opt_mult

* Update yjit/src/codegen.rs

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* Implement mul with overflow checking on arm64

* Fix missing semicolon

* Add arm splitting for lshift, rshift, urshift

---------

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: implement fast path for integer multiplication in opt_mult

* Update yjit/src/codegen.rs

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* Implement mul with overflow checking on arm64

* Fix missing semicolon

* Add arm splitting for lshift, rshift, urshift

---------

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: add mul() instruction to backend IR (#8195)</title>
<updated>2023-08-10T18:47:03+00:00</updated>
<author>
<name>Maxime Chevalier-Boisvert</name>
<email>maxime.chevalierboisvert@shopify.com</email>
</author>
<published>2023-08-10T18:47:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b5b34c1f84ffbc87004d4761621040e3ceb3542d'/>
<id>b5b34c1f84ffbc87004d4761621040e3ceb3542d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
