<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/invariants.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>YJIT: Deallocate `struct Block` to plug memory leaks</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-29T21:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a0b0365e905e1ac51998ace7e6fc723406a2f157'/>
<id>a0b0365e905e1ac51998ace7e6fc723406a2f157</id>
<content type='text'>
Previously we essentially never freed block even after invalidation.
Their reference count never reached zero for a couple of reasons:
1. `Branch::block` formed a cycle with the block holding the branch
2. Strong count on a branch that has ever contained a stub never
   reached 0 because we increment the `.clone()` call for
   `BranchRef::into_raw()` didn't have a matching decrement.

It's not safe to immediately deallocate blocks during
invalidation since `branch_stub_hit()` can end up
running with a branch pointer from an invalidated branch.
To plug the leaks, we wait until code GC or global invalidation and
deallocate the blocks for iseqs that are definitely not running.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we essentially never freed block even after invalidation.
Their reference count never reached zero for a couple of reasons:
1. `Branch::block` formed a cycle with the block holding the branch
2. Strong count on a branch that has ever contained a stub never
   reached 0 because we increment the `.clone()` call for
   `BranchRef::into_raw()` didn't have a matching decrement.

It's not safe to immediately deallocate blocks during
invalidation since `branch_stub_hit()` can end up
running with a branch pointer from an invalidated branch.
To plug the leaks, we wait until code GC or global invalidation and
deallocate the blocks for iseqs that are definitely not running.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Deallocate when assumptions tables are empty</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:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b30248f74a8f6ce37a78f07597c7c5452ff50abd'/>
<id>b30248f74a8f6ce37a78f07597c7c5452ff50abd</id>
<content type='text'>
When we run global invalidation for TracePoints or code GC, we clear out
all blocks in our assumptions table but we don't deallocate the backing
buffers. Let's reclaim some memory during these rare events.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we run global invalidation for TracePoints or code GC, we clear out
all blocks in our assumptions table but we don't deallocate the backing
buffers. Let's reclaim some memory during these rare events.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Skip padding jumps to side exits on Arm (#6790)</title>
<updated>2022-11-22T20:57:17+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-22T20:57:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=63f4a7a1ec3433cc985503e3ca342e4a9ebda257'/>
<id>63f4a7a1ec3433cc985503e3ca342e4a9ebda257</id>
<content type='text'>
YJIT: Skip padding jumps to side exits

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
YJIT: Skip padding jumps to side exits

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;

Co-authored-by: Maxime Chevalier-Boisvert &lt;maxime.chevalierboisvert@shopify.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Stop wrapping CmePtr with CmeDependency (#6747)</title>
<updated>2022-11-16T23:30:29+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-16T23:30:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6de4032e407b5e4bcf837332b9980a5892282df8'/>
<id>6de4032e407b5e4bcf837332b9980a5892282df8</id>
<content type='text'>
* YJIT: Stop wrapping CmePtr with CmeDependency

* YJIT: Fix an outdated comment [ci skip]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Stop wrapping CmePtr with CmeDependency

* YJIT: Fix an outdated comment [ci skip]</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Invalidate redefined methods only through cme (#6734)</title>
<updated>2022-11-15T20:57:43+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-15T20:57:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1125274c4e8aeffd8609ced41c05d26d45b9b5ad'/>
<id>1125274c4e8aeffd8609ced41c05d26d45b9b5ad</id>
<content type='text'>
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;

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;

Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</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>Code clean around unused code for some architectures or features (#6581)</title>
<updated>2022-10-18T18:19:41+00:00</updated>
<author>
<name>Jimmy Miller</name>
<email>jimmy.miller@shopify.com</email>
</author>
<published>2022-10-18T18:19:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b2ba71df9efd2e484cce955a398f2894702c7de0'/>
<id>b2ba71df9efd2e484cce955a398f2894702c7de0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow passing a Rust closure to rb_iseq_callback (#6575)</title>
<updated>2022-10-18T16:07:11+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-10-18T16:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7166c9bb78e20531a9cbb372e460ecd12603b5e'/>
<id>e7166c9bb78e20531a9cbb372e460ecd12603b5e</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 creating payloads for non-JITed ISEQs (#6549)</title>
<updated>2022-10-14T19:45:00+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-10-14T19:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=53e0e5e8df8648e23278e4811e634671de9e1af1'/>
<id>53e0e5e8df8648e23278e4811e634671de9e1af1</id>
<content type='text'>
* YJIT: Count freed ISEQs

* YJIT: Avoid creating payloads for non-JITed ISEQs</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* YJIT: Count freed ISEQs

* YJIT: Avoid creating payloads for non-JITed ISEQs</pre>
</div>
</content>
</entry>
<entry>
<title>A bunch of clippy auto fixes for yjit (#6476)</title>
<updated>2022-09-30T15:14:55+00:00</updated>
<author>
<name>Jimmy Miller</name>
<email>jimmy.miller@shopify.com</email>
</author>
<published>2022-09-30T15:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=31461c7e0eab4963ccc8649ea8ebf27979132c0c'/>
<id>31461c7e0eab4963ccc8649ea8ebf27979132c0c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
