<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/asm/mod.rs, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[For ruby_3_2] Fix unused_mut Rust warnings (#8435)</title>
<updated>2023-09-16T04:06:39+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-09-16T04:06:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e159971e03102090e29f3555975498f75cf02f2c'/>
<id>e159971e03102090e29f3555975498f75cf02f2c</id>
<content type='text'>
Fix unused_mut Rust warnings

Rust version 1.71.0 and up issue these warnings. On GitHub CI, the
warnings were previously seen in -DYJIT_FORCE_ENABLE runs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix unused_mut Rust warnings

Rust version 1.71.0 and up issue these warnings. On GitHub CI, the
warnings were previously seen in -DYJIT_FORCE_ENABLE runs.</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) b78f871d838c168789648738e5c67b071beb8a19,ecd0cdaf820af789f355f1a18c31d6adfe8aad94: [Backport #19400]</title>
<updated>2023-03-04T06:39:47+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-03-04T06:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f93c7b9f58966fd04496bfeb2538fb1ff41f788e'/>
<id>f93c7b9f58966fd04496bfeb2538fb1ff41f788e</id>
<content type='text'>
	YJIT: Use the system page size when the code page size is too small
	 (#7267)

	Previously on ARM64 Linux systems that use 64 KiB pages
	(`CONFIG_ARM64_64K_PAGES=y`), YJIT was panicking on boot due to a failed
	assertion.

	The assertion was making sure that code GC can free the last code page
	that YJIT manages without freeing unrelated memory. YJIT prefers picking
	16 KiB as the granularity at which to free code memory, but when the
	system can only free at 64 KiB granularity, that is not possible.

	The fix is to use the system page size as the code page size when the
	system page size is 64 KiB. Continue to use 16 KiB as the code page size
	on common systems that use 16/4 KiB pages.

	Add asserts to code_gc() and free_page() about code GC's assumptions.

	Fixes [Bug #19400]
	---
	 yjit/src/asm/mod.rs    | 78 ++++++++++++++++++++++++++++++++------------------
	 yjit/src/codegen.rs    |  2 --
	 yjit/src/virtualmem.rs | 13 +++++++++
	 3 files changed, 63 insertions(+), 30 deletions(-)

	YJIT: Fix assertion for partially mapped last pages (#7337)

	Follows up [Bug #19400]
	---
	 test/ruby/test_yjit.rb | 19 +++++++++++++++++++
	 yjit/src/asm/mod.rs    |  2 +-
	 yjit/src/virtualmem.rs | 18 +++++++++++++-----
	 3 files changed, 33 insertions(+), 6 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	YJIT: Use the system page size when the code page size is too small
	 (#7267)

	Previously on ARM64 Linux systems that use 64 KiB pages
	(`CONFIG_ARM64_64K_PAGES=y`), YJIT was panicking on boot due to a failed
	assertion.

	The assertion was making sure that code GC can free the last code page
	that YJIT manages without freeing unrelated memory. YJIT prefers picking
	16 KiB as the granularity at which to free code memory, but when the
	system can only free at 64 KiB granularity, that is not possible.

	The fix is to use the system page size as the code page size when the
	system page size is 64 KiB. Continue to use 16 KiB as the code page size
	on common systems that use 16/4 KiB pages.

	Add asserts to code_gc() and free_page() about code GC's assumptions.

	Fixes [Bug #19400]
	---
	 yjit/src/asm/mod.rs    | 78 ++++++++++++++++++++++++++++++++------------------
	 yjit/src/codegen.rs    |  2 --
	 yjit/src/virtualmem.rs | 13 +++++++++
	 3 files changed, 63 insertions(+), 30 deletions(-)

	YJIT: Fix assertion for partially mapped last pages (#7337)

	Follows up [Bug #19400]
	---
	 test/ruby/test_yjit.rb | 19 +++++++++++++++++++
	 yjit/src/asm/mod.rs    |  2 +-
	 yjit/src/virtualmem.rs | 18 +++++++++++++-----
	 3 files changed, 33 insertions(+), 6 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 188688a53e7708d25ab80e14d05e70ffcf792e13: [Backport #19385]</title>
<updated>2023-02-03T05:13:09+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-02-03T05:13:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=535d863f34e6c36a2378683e7c2d3b7369e3d076'/>
<id>535d863f34e6c36a2378683e7c2d3b7369e3d076</id>
<content type='text'>
	[PATCH 1/4] YJIT: Move CodegenGlobals::freed_pages into an Rc

	This allows for supplying a freed_pages vec in Rust tests. We need it so we
	can test scenarios that occur after code GC.
	---
	 yjit/src/asm/mod.rs | 48 +++++++++++++++++++++++++++++++++------------
	 yjit/src/codegen.rs | 16 ++++-----------
	 2 files changed, 39 insertions(+), 25 deletions(-)

	Subject: [PATCH 2/4] YJIT: other_cb is None in tests

	Since the other cb is in CodegenGlobals, and we want Rust tests to be
	self-contained.
	---
	 yjit/src/asm/mod.rs | 1 +
	 1 file changed, 1 insertion(+)

	Subject: [PATCH 3/4] YJIT: ARM64: Move functions out of arm64_emit()

	---
	 yjit/src/backend/arm64/mod.rs | 180 +++++++++++++++++-----------------
	 1 file changed, 90 insertions(+), 90 deletions(-)

	Subject: [PATCH 4/4] YJIT: ARM64: Fix long jumps to labels

	Previously, with Code GC, YJIT panicked while trying to emit a B.cond
	instruction with an offset that is not encodable in 19 bits. This only
	happens when the code in an assembler instance straddles two pages.

	To fix this, when we detect that a jump to a label can land on a
	different page, we switch to a fresh new page and regenerate all the
	code in the assembler there. We still assume that no one assembler has
	so much code that it wouldn't fit inside a fresh new page.

	[Bug #19385]
	---
	 yjit/src/backend/arm64/mod.rs | 65 ++++++++++++++++++++++++++++++++---
	 1 file changed, 60 insertions(+), 5 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH 1/4] YJIT: Move CodegenGlobals::freed_pages into an Rc

	This allows for supplying a freed_pages vec in Rust tests. We need it so we
	can test scenarios that occur after code GC.
	---
	 yjit/src/asm/mod.rs | 48 +++++++++++++++++++++++++++++++++------------
	 yjit/src/codegen.rs | 16 ++++-----------
	 2 files changed, 39 insertions(+), 25 deletions(-)

	Subject: [PATCH 2/4] YJIT: other_cb is None in tests

	Since the other cb is in CodegenGlobals, and we want Rust tests to be
	self-contained.
	---
	 yjit/src/asm/mod.rs | 1 +
	 1 file changed, 1 insertion(+)

	Subject: [PATCH 3/4] YJIT: ARM64: Move functions out of arm64_emit()

	---
	 yjit/src/backend/arm64/mod.rs | 180 +++++++++++++++++-----------------
	 1 file changed, 90 insertions(+), 90 deletions(-)

	Subject: [PATCH 4/4] YJIT: ARM64: Fix long jumps to labels

	Previously, with Code GC, YJIT panicked while trying to emit a B.cond
	instruction with an offset that is not encodable in 19 bits. This only
	happens when the code in an assembler instance straddles two pages.

	To fix this, when we detect that a jump to a label can land on a
	different page, we switch to a fresh new page and regenerate all the
	code in the assembler there. We still assume that no one assembler has
	so much code that it wouldn't fit inside a fresh new page.

	[Bug #19385]
	---
	 yjit/src/backend/arm64/mod.rs | 65 ++++++++++++++++++++++++++++++++---
	 1 file changed, 60 insertions(+), 5 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Remove --yjit-code-page-size (#6865)</title>
<updated>2022-12-05T22:43:17+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2022-12-05T22:43:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=235fc50447c13b054d8849ef2fcdac55ef1f5f9c'/>
<id>235fc50447c13b054d8849ef2fcdac55ef1f5f9c</id>
<content type='text'>
Certain code page sizes don't work and can cause crashes, so having this
value available as a command-line option is a bit dangerous. Remove it
and turn it into a constant instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Certain code page sizes don't work and can cause crashes, so having this
value available as a command-line option is a bit dangerous. Remove it
and turn it into a constant instead.</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Fix IseqPayload::pages memory bloat</title>
<updated>2022-11-30T17:23:50+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2022-11-29T20:37:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=03f1e6a2aa8aa1d5aef79a33a243372a457f0fa2'/>
<id>03f1e6a2aa8aa1d5aef79a33a243372a457f0fa2</id>
<content type='text'>
HashSet::clear() doesn't deallocate the backing buffer and shrink the
capacity. Replace with a 0-capcity set instead so we reclaim some memory
each code GC.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HashSet::clear() doesn't deallocate the backing buffer and shrink the
capacity. Replace with a 0-capcity set instead so we reclaim some memory
each code GC.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Use NonNull pointer for CodePtr (#6792)</title>
<updated>2022-11-23T17:02:05+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-23T17:02:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d88adaad7ea4761bd36c957260667840472fd2dc'/>
<id>d88adaad7ea4761bd36c957260667840472fd2dc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Include actual memory region size in stats (#6736)</title>
<updated>2022-11-15T23:20:02+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-15T23:20:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0d384ce6e627539d17f9307e522cb98bbca1ace3'/>
<id>0d384ce6e627539d17f9307e522cb98bbca1ace3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Reset dropped_bytes when patching code</title>
<updated>2022-11-08T21:09:02+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2022-11-07T21:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5d95cd99f4ed425c416cc91e8986a3402d5b557a'/>
<id>5d95cd99f4ed425c416cc91e8986a3402d5b557a</id>
<content type='text'>
We switch to a new page when we detect dropped_bytes flipping from false
to true. Previously, when we patch code for invalidation during code gc,
we start with the flag being set to true, so we failed to apply patches
that straddle pages. We would write out jumps half way and then stop,
which left the code corrupted.

Reset the flag before patching so we patch across pages properly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We switch to a new page when we detect dropped_bytes flipping from false
to true. Previously, when we patch code for invalidation during code gc,
we start with the flag being set to true, so we failed to apply patches
that straddle pages. We would write out jumps half way and then stop,
which left the code corrupted.

Reset the flag before patching so we patch across pages properly.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Free pages after ObjectSpace API usages (#6676)</title>
<updated>2022-11-07T15:48:26+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-07T15:48:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7442cb461b32de2eec3b37f52d80752d30627de0'/>
<id>7442cb461b32de2eec3b37f52d80752d30627de0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Make Code GC metrics available for non-stats builds (#6665)</title>
<updated>2022-11-03T17:41:35+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-03T17:41:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ea77aa2fd0899820752df7de6077a3b847a20aee'/>
<id>ea77aa2fd0899820752df7de6077a3b847a20aee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
