<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit.c, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>ZJIT: Use rb_zjit_writebarrier_check_immediate() instead of rb_gc_writebarrier() in gen_write_barrier()</title>
<updated>2025-12-16T20:00:27+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-12-16T15:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5e27581c3b3782f731ada9f83129c5c17a8f8c49'/>
<id>5e27581c3b3782f731ada9f83129c5c17a8f8c49</id>
<content type='text'>
* To avoid calling rb_gc_writebarrier() with an immediate value in gen_write_barrier(),
  and avoid the LIR jump issue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* To avoid calling rb_gc_writebarrier() with an immediate value in gen_write_barrier(),
  and avoid the LIR jump issue.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Remove unused includes from zjit.c</title>
<updated>2025-12-10T21:35:00+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-12-09T03:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=96c804de1f6a495c339f85069a648d37dadfbc80'/>
<id>96c804de1f6a495c339f85069a648d37dadfbc80</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Prohibit ZJIT support with USE_FLONUM=0 (#15471)</title>
<updated>2025-12-10T05:18:03+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-10T05:18:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ec862b41dc9aaa2a22d80961b62417a347bc84ec'/>
<id>ec862b41dc9aaa2a22d80961b62417a347bc84ec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add `NUM2PTR` and `PTR2NUM` macros</title>
<updated>2025-12-10T03:09:50+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-12-10T03:09:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3636277dc5837bcedcd5ef43d49423194064a676'/>
<id>3636277dc5837bcedcd5ef43d49423194064a676</id>
<content type='text'>
These macros have been defined here and there, so collect them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These macros have been defined here and there, so collect them.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Add dump to file for --zjit-stats (#15414)</title>
<updated>2025-12-09T23:14:49+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden@aidenfoxivey.com</email>
</author>
<published>2025-12-09T23:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=29c29c2b7e972359ab83038c5dc27a7e53ae65c7'/>
<id>29c29c2b7e972359ab83038c5dc27a7e53ae65c7</id>
<content type='text'>
* ZJIT: Add dump to file for --zjit-stats

* ZJIT: Rename --zjit-stats=quiet to --zjit-stats-quiet</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ZJIT: Add dump to file for --zjit-stats

* ZJIT: Rename --zjit-stats=quiet to --zjit-stats-quiet</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed by `misspell -w -error -source=text`</title>
<updated>2025-12-09T08:48:57+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-12-09T08:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79c57d747f7d1e6253a6df7b624a9930cb8a523c'/>
<id>79c57d747f7d1e6253a6df7b624a9930cb8a523c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Avoid binding to `rb_iseq_constant_body`</title>
<updated>2025-12-05T20:49:25+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-12-03T21:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=109ddd291ebc4f07f786e7b4ed277b20e3faaa8a'/>
<id>109ddd291ebc4f07f786e7b4ed277b20e3faaa8a</id>
<content type='text'>
Its definition changes depending on e.g. whether there is YJIT in the
build.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Its definition changes depending on e.g. whether there is YJIT in the
build.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: add support for lazy `RubyVM::ZJIT.enable`</title>
<updated>2025-11-18T16:35:09+00:00</updated>
<author>
<name>Godfrey Chan</name>
<email>godfreykfc@gmail.com</email>
</author>
<published>2025-11-17T16:15:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f84bbb423836d9d0d018b8ab71ecceb5868fd5be'/>
<id>f84bbb423836d9d0d018b8ab71ecceb5868fd5be</id>
<content type='text'>
This implements Shopify#854:

- Splits boot-time and enable-time initialization,
  tracks progress with `InitializationState` enum

- Introduces `RubyVM::ZJIT.enable` Ruby method for
  enabling the JIT lazily, if not already enabled

- Introduces `--zjit-disable` flag, which can be
  used alongside the other `--zjit-*` flags but
  prevents enabling the JIT at boot time

- Adds ZJIT infra to support JIT hooks, but this
  is not currently exercised (Shopify/ruby#667)

Left for future enhancements:

- Support kwargs for overriding the CLI flags in
  `RubyVM::ZJIT.enable`

Closes Shopify#854
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements Shopify#854:

- Splits boot-time and enable-time initialization,
  tracks progress with `InitializationState` enum

- Introduces `RubyVM::ZJIT.enable` Ruby method for
  enabling the JIT lazily, if not already enabled

- Introduces `--zjit-disable` flag, which can be
  used alongside the other `--zjit-*` flags but
  prevents enabling the JIT at boot time

- Adds ZJIT infra to support JIT hooks, but this
  is not currently exercised (Shopify/ruby#667)

Left for future enhancements:

- Support kwargs for overriding the CLI flags in
  `RubyVM::ZJIT.enable`

Closes Shopify#854
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Untag block handler (#15085)</title>
<updated>2025-11-06T20:07:02+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-06T20:07:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38d31dc49bb3b94cd1577117c52210c9035ddf1e'/>
<id>38d31dc49bb3b94cd1577117c52210c9035ddf1e</id>
<content type='text'>
Storing the tagged block handler in profiles is not GC-safe (nice catch,
Kokubun). Store the untagged block handler instead.

Fix bug in https://github.com/ruby/ruby/pull/15051</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Storing the tagged block handler in profiles is not GC-safe (nice catch,
Kokubun). Store the untagged block handler instead.

Fix bug in https://github.com/ruby/ruby/pull/15051</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Profile specific objects for invokeblock (#15051)</title>
<updated>2025-11-05T20:01:17+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-05T20:01:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=02267417da32bf480f7050ff2ab182076aa0ad83'/>
<id>02267417da32bf480f7050ff2ab182076aa0ad83</id>
<content type='text'>
I made a special kind of `ProfiledType` that looks at specific objects, not just their classes/shapes (https://github.com/ruby/ruby/pull/15051). Then I profiled some of our benchmarks.

For lobsters:

```
Top-6 invokeblock handler (100.0% of total 1,064,155):
        megamorphic: 494,931 (46.5%)
   monomorphic_iseq: 337,171 (31.7%)
        polymorphic: 113,381 (10.7%)
  monomorphic_ifunc:  52,260 ( 4.9%)
  monomorphic_other:  38,970 ( 3.7%)
        no_profiles:  27,442 ( 2.6%)
```

For railsbench:

```
Top-6 invokeblock handler (100.0% of total 2,529,104):
   monomorphic_iseq: 834,452 (33.0%)
        megamorphic: 818,347 (32.4%)
        polymorphic: 632,273 (25.0%)
  monomorphic_ifunc: 224,243 ( 8.9%)
  monomorphic_other:  19,595 ( 0.8%)
        no_profiles:     194 ( 0.0%)
```

For shipit:

```
Top-6 invokeblock handler (100.0% of total 2,104,148):
        megamorphic: 1,269,889 (60.4%)
        polymorphic:   411,475 (19.6%)
        no_profiles:   173,367 ( 8.2%)
  monomorphic_other:   118,619 ( 5.6%)
   monomorphic_iseq:    84,891 ( 4.0%)
  monomorphic_ifunc:    45,907 ( 2.2%)
```

Seems like a monomorphic case for a specific ISEQ actually isn't a bad way of going about this, at least to start...</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I made a special kind of `ProfiledType` that looks at specific objects, not just their classes/shapes (https://github.com/ruby/ruby/pull/15051). Then I profiled some of our benchmarks.

For lobsters:

```
Top-6 invokeblock handler (100.0% of total 1,064,155):
        megamorphic: 494,931 (46.5%)
   monomorphic_iseq: 337,171 (31.7%)
        polymorphic: 113,381 (10.7%)
  monomorphic_ifunc:  52,260 ( 4.9%)
  monomorphic_other:  38,970 ( 3.7%)
        no_profiles:  27,442 ( 2.6%)
```

For railsbench:

```
Top-6 invokeblock handler (100.0% of total 2,529,104):
   monomorphic_iseq: 834,452 (33.0%)
        megamorphic: 818,347 (32.4%)
        polymorphic: 632,273 (25.0%)
  monomorphic_ifunc: 224,243 ( 8.9%)
  monomorphic_other:  19,595 ( 0.8%)
        no_profiles:     194 ( 0.0%)
```

For shipit:

```
Top-6 invokeblock handler (100.0% of total 2,104,148):
        megamorphic: 1,269,889 (60.4%)
        polymorphic:   411,475 (19.6%)
        no_profiles:   173,367 ( 8.2%)
  monomorphic_other:   118,619 ( 5.6%)
   monomorphic_iseq:    84,891 ( 4.0%)
  monomorphic_ifunc:    45,907 ( 2.2%)
```

Seems like a monomorphic case for a specific ISEQ actually isn't a bad way of going about this, at least to start...</pre>
</div>
</content>
</entry>
</feed>
