<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/asm/mod.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 code pages are not partially in-bounds</title>
<updated>2023-12-05T18:20:06+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-12-05T16:40:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a063969ec18c8f213d9c70471a29d0d31ec5850a'/>
<id>a063969ec18c8f213d9c70471a29d0d31ec5850a</id>
<content type='text'>
Helps understand page switching
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Helps understand page switching
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Simplify code page switching logic, remove an assert</title>
<updated>2023-12-05T18:20:06+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-12-05T15:22:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=695e5c179ed06761e47c700c6b31a26f48eee699'/>
<id>695e5c179ed06761e47c700c6b31a26f48eee699</id>
<content type='text'>
We have received a report of `assert!( !cb.has_dropped_bytes())` in
set_page() failing. The only explanation for this seems to be memory
allocation failing in write_byte(). The if condition implies that
`current_write_pos &lt; dst_pos &lt; mem_size`, which rules out failing to
encode the relative jump. The has_capacity() assert above not tripping
implies that we were in a place in the page where write_byte() did
attempt to write the byte and potentially made a syscall in the process.

Remove the assert, since memory allocation could fail. Also, return
failure if the destination is outside of the code region to detect that
out-of-memory situation quicker.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have received a report of `assert!( !cb.has_dropped_bytes())` in
set_page() failing. The only explanation for this seems to be memory
allocation failing in write_byte(). The if condition implies that
`current_write_pos &lt; dst_pos &lt; mem_size`, which rules out failing to
encode the relative jump. The has_capacity() assert above not tripping
implies that we were in a place in the page where write_byte() did
attempt to write the byte and potentially made a syscall in the process.

Remove the assert, since memory allocation could fail. Also, return
failure if the destination is outside of the code region to detect that
out-of-memory situation quicker.
</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: Add --yjit-perf (#8697)</title>
<updated>2023-10-18T21:07:03+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-10-18T21:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f51b92fe231266a1a184b8329d43520599d2017b'/>
<id>f51b92fe231266a1a184b8329d43520599d2017b</id>
<content type='text'>
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Skip adding past_page_bytes for past pages (#8433)</title>
<updated>2023-09-13T20:44:23+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-09-13T20:44:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b49be2a70fd715b15f69dae776ba37d9b8d3a3fb'/>
<id>b49be2a70fd715b15f69dae776ba37d9b8d3a3fb</id>
<content type='text'>
YJIT: Skip adding past_pages_bytes for past pages</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
YJIT: Skip adding past_pages_bytes for past pages</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Make compiled_* stats available by default (#8379)</title>
<updated>2023-09-06T16:29:33+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-09-06T16:29:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a334077b7b4dfc2439afd9b429c2fcd9e4c3012e'/>
<id>a334077b7b4dfc2439afd9b429c2fcd9e4c3012e</id>
<content type='text'>
* YJIT: Make compiled_* stats available by default

* Update comment about default counters [ci skip]

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;

---------

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Make compiled_* stats available by default

* Update comment about default counters [ci skip]

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;

---------

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fix build on A64</title>
<updated>2023-04-11T23:35:30+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2023-04-11T23:35:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c767e6f0c272a83a046c05dffc01409ae8f16e11'/>
<id>c767e6f0c272a83a046c05dffc01409ae8f16e11</id>
<content type='text'>
Typo fix for the last commit (1432b37)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Typo fix for the last commit (1432b37)
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fix a compilation warning in x86_64</title>
<updated>2023-04-11T21:59:21+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-04-11T21:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1432b3768aad4cfd95d584077f76c617dcc62978'/>
<id>1432b3768aad4cfd95d584077f76c617dcc62978</id>
<content type='text'>
This is used only for arm64's cb.jmp_ptr_bytes().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is used only for arm64's cb.jmp_ptr_bytes().
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Reduce paddings if --yjit-exec-mem-size &lt;= 128 on arm64 (#7671)</title>
<updated>2023-04-11T15:02:52+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-04-11T15:02:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7297374c5e3dc2b66ee55d918b3f933e78dd23fd'/>
<id>7297374c5e3dc2b66ee55d918b3f933e78dd23fd</id>
<content type='text'>
* YJIT: Reduce paddings if --yjit-exec-mem-size &lt;= 128

on arm64

* YJIT: Define jmp_ptr_bytes on CodeBlock</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Reduce paddings if --yjit-exec-mem-size &lt;= 128

on arm64

* YJIT: Define jmp_ptr_bytes on CodeBlock</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Count the number of actually written bytes (#7658)</title>
<updated>2023-04-05T14:32:04+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-04-05T14:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=615a1bc470587614129c8a7f352286cf9d1c0fc6'/>
<id>615a1bc470587614129c8a7f352286cf9d1c0fc6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
