<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src, branch master</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Stop boxing cdhash offsets</title>
<updated>2026-05-18T05:58:32+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-17T20:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d036506b15e0fe34a36b00cfd461d409b1fcc97d'/>
<id>d036506b15e0fe34a36b00cfd461d409b1fcc97d</id>
<content type='text'>
Now that they're no longer a RHash instance, we don't
have to box the offsets, we can directly srore the raw
values, and stop marking them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that they're no longer a RHash instance, we don't
have to box the offsets, we can directly srore the raw
values, and stop marking them.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use IMEMO to store `cdhash`</title>
<updated>2026-05-18T05:58:32+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-17T12:40:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=99dc513d155484a1291394e953a5cdfd6dab92e1'/>
<id>99dc513d155484a1291394e953a5cdfd6dab92e1</id>
<content type='text'>
RHash isn't a good fit for storing `cdhash` as this force to allow
arbitrary hash types into RHash, which doesn't work with AR tables.

It also cause the cdhash to be larger than needed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RHash isn't a good fit for storing `cdhash` as this force to allow
arbitrary hash types into RHash, which doesn't work with AR tables.

It also cause the cdhash to be larger than needed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace subclasses linked list with weakref array</title>
<updated>2026-05-14T01:36:51+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2026-05-07T09:01:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f71840a230f07c2aaf1944ae03e138dd0ba68d12'/>
<id>f71840a230f07c2aaf1944ae03e138dd0ba68d12</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>shapes: Rename `TOO_COMPLEX` in just `COMPLEX`</title>
<updated>2026-05-06T08:10:16+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-06T06:42:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4eeec614bb9379ebac78ecc4fa98238a8311d9eb'/>
<id>4eeec614bb9379ebac78ecc4fa98238a8311d9eb</id>
<content type='text'>
The `too_` prefix wasn't consistently used and just make the
thing longer for no benefit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `too_` prefix wasn't consistently used and just make the
thing longer for no benefit.
</pre>
</div>
</content>
</entry>
<entry>
<title>shape.c: transition to complex when `max_capacity` is reached</title>
<updated>2026-05-06T07:02:02+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-04-29T08:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=678d86f5e46d57432169d0d5eaf71a41c6d21526'/>
<id>678d86f5e46d57432169d0d5eaf71a41c6d21526</id>
<content type='text'>
Now that we have 1024B slots, we can store up to 126 fields inline.

Objects larger than this are rare if not non-existent, hence we can
get rid of the `malloc` path for imemo/fields and simply transition
to `TOO_COMPLEX`.

This additionally allows to shrink `attr_index_t` from 16 to 8B.

Note: the ZJIT "ivar on extended" tests are renamed as "complex" because
"extended" AKA malloc allocated imemo/fields no longer exists.
They're now complex fields, AKA st tables.

rb_class_allocate_instance: start as complex when over max_fields

If `RCLASS_MAX_IV_COUNT` is over `max_fields`, allocating a large
slot to end up transitioning to `TOO_COMPLEX` is wasteful.

We might as well start as complex directly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have 1024B slots, we can store up to 126 fields inline.

Objects larger than this are rare if not non-existent, hence we can
get rid of the `malloc` path for imemo/fields and simply transition
to `TOO_COMPLEX`.

This additionally allows to shrink `attr_index_t` from 16 to 8B.

Note: the ZJIT "ivar on extended" tests are renamed as "complex" because
"extended" AKA malloc allocated imemo/fields no longer exists.
They're now complex fields, AKA st tables.

rb_class_allocate_instance: start as complex when over max_fields

If `RCLASS_MAX_IV_COUNT` is over `max_fields`, allocating a large
slot to end up transitioning to `TOO_COMPLEX` is wasteful.

We might as well start as complex directly.
</pre>
</div>
</content>
</entry>
<entry>
<title>vm_insnhelper.c: refactor and optimize setivar cache revalidation</title>
<updated>2026-05-04T15:41:37+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-04T13:55:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a2ba1ed43b9eb66a8c2d100644cd7bda7116efd6'/>
<id>a2ba1ed43b9eb66a8c2d100644cd7bda7116efd6</id>
<content type='text'>
By only storing shape offsets in the cache, we're able to still
match two equal objects that happen to be in different heaps, as
well as to validate the object is neither frozen nor complex.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By only storing shape offsets in the cache, we're able to still
match two equal objects that happen to be in different heaps, as
well as to validate the object is neither frozen nor complex.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor shape transition functions</title>
<updated>2026-05-03T09:36:26+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-03T07:10:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c9b53473e37ec106cb77940b99f5ef0541758e92'/>
<id>c9b53473e37ec106cb77940b99f5ef0541758e92</id>
<content type='text'>
Expose both `rb_obj_shape_` functions that take a `VALUE`
and `rb_shape_` functions that take a `shape_id`.

Make common transition functions such as `complex` and `frozen`
inlineable.

Also get rid of RB_SET_SHAPE_ID and rb_set_boxed_class_shape_id.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Expose both `rb_obj_shape_` functions that take a `VALUE`
and `rb_shape_` functions that take a `shape_id`.

Make common transition functions such as `complex` and `frozen`
inlineable.

Also get rid of RB_SET_SHAPE_ID and rb_set_boxed_class_shape_id.
</pre>
</div>
</content>
</entry>
<entry>
<title>jits: don't assume `attr_index_t` is u16</title>
<updated>2026-05-02T16:08:12+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-02T12:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=db26919bd033dde6a07d18572c621c6959de300f'/>
<id>db26919bd033dde6a07d18572c621c6959de300f</id>
<content type='text'>
Extracted from: https://github.com/ruby/ruby/pull/16817

It's likely that it will be u8 soon.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extracted from: https://github.com/ruby/ruby/pull/16817

It's likely that it will be u8 soon.
</pre>
</div>
</content>
</entry>
<entry>
<title>shape.c: reorganize rb_shape_tree_t</title>
<updated>2026-05-02T09:38:42+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-05-02T07:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9afb8a65ebcc1a1817fed532056196dd97ae7b78'/>
<id>9afb8a65ebcc1a1817fed532056196dd97ae7b78</id>
<content type='text'>
Embed and shrink the capacities array so that it can be queried
more efficiently.

Move `next_shape_id` and `cache_size` outside of the struct on their
own cache line, as they're expected to be incremented atomically from
concurrent threads, so we want to avoid false sharing.
The also don't need to be exposed to the rest of the VM.

Get rid of `root_shape` as it's always equal to `shape_list`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Embed and shrink the capacities array so that it can be queried
more efficiently.

Move `next_shape_id` and `cache_size` outside of the struct on their
own cache line, as they're expected to be incremented atomically from
concurrent threads, so we want to avoid false sharing.
The also don't need to be exposed to the rest of the VM.

Get rid of `root_shape` as it's always equal to `shape_list`.
</pre>
</div>
</content>
</entry>
<entry>
<title>YJIT: Replace std::mem::transmute with pointer casting</title>
<updated>2026-04-29T22:22:24+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2026-04-10T19:05:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4d56fc62c10dba7e38bb73add87f02f71a918b1d'/>
<id>4d56fc62c10dba7e38bb73add87f02f71a918b1d</id>
<content type='text'>
As the documentation puts it, transmute is "incredibly unsafe". We can
express what we need to with pointer casts in these closure FFI
situations, so let's use pointer casts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the documentation puts it, transmute is "incredibly unsafe". We can
express what we need to with pointer casts in these closure FFI
situations, so let's use pointer casts.
</pre>
</div>
</content>
</entry>
</feed>
