<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_variable.rb, branch v4.0.3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Ensure we don't dereference fields_obj as Qundef</title>
<updated>2025-11-27T00:13:38+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-11-26T22:02:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5bef7577b3b336a709935dd39e69abcf397c4684'/>
<id>5bef7577b3b336a709935dd39e69abcf397c4684</id>
<content type='text'>
We rely on the GC to clear this when the GC is run on another EC than
the cache.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We rely on the GC to clear this when the GC is run on another EC than
the cache.
</pre>
</div>
</content>
</entry>
<entry>
<title>Clear fields obj when removing</title>
<updated>2025-11-27T00:13:38+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-11-26T21:33:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=970b18e9a94ff3e6496fb7324cff0798ffec6f24'/>
<id>970b18e9a94ff3e6496fb7324cff0798ffec6f24</id>
<content type='text'>
This fixes a bug where the gen_fields_cache could become invalid when
the last ivar was removed. Also adds more assertions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a bug where the gen_fields_cache could become invalid when
the last ivar was removed. Also adds more assertions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused variable warning</title>
<updated>2025-09-12T11:44:39+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-08-22T09:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38ec296ce5e7e4cf0ac49b2fa43eec9e6a53e269'/>
<id>38ec296ce5e7e4cf0ac49b2fa43eec9e6a53e269</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Populate ivar caches for types other than T_OBJECT</title>
<updated>2025-08-28T07:25:51+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-08-27T16:13:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7fb87ee3a826a387e5bfb9edea059f1aa065462'/>
<id>e7fb87ee3a826a387e5bfb9edea059f1aa065462</id>
<content type='text'>
`vm_setinstancevariable` had a codepath to try to match the inline
cache for types other than T_OBJECT, but the cache population path
in `vm_setivar_slowpath` was exclusive to T_OBJECT, so `vm_setivar_default`
would never match anything.

This commit improves `vm_setivar_slowpath` so that it is capable of
filling the cache for all types, and adds a `vm_setivar_class` codepath
for `T_CLASS` and `T_MODULE`.

`vm_setivar`, `vm_setivar_default` and `vm_setivar_class` could be unified,
but based on the very explicit `NOINLINE` I assume they were split to minimize
codesize.

```
compare-ruby: ruby 3.5.0dev (2025-08-27T14:58:58Z merge-vm-setivar-d.. 5b749d8e53) +PRISM [arm64-darwin24]
built-ruby: ruby 3.5.0dev (2025-08-27T16:30:31Z setivar-cache-gene.. 4fe78ff296) +PRISM [arm64-darwin24]

|                         |compare-ruby|built-ruby|
|:------------------------|-----------:|---------:|
|vm_ivar_set_on_instance  |     161.809|   164.688|
|                         |           -|     1.02x|
|vm_ivar_set_on_generic   |      58.769|   115.638|
|                         |           -|     1.97x|
|vm_ivar_set_on_class     |      70.034|   141.042|
|                         |           -|     2.01x|
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`vm_setinstancevariable` had a codepath to try to match the inline
cache for types other than T_OBJECT, but the cache population path
in `vm_setivar_slowpath` was exclusive to T_OBJECT, so `vm_setivar_default`
would never match anything.

This commit improves `vm_setivar_slowpath` so that it is capable of
filling the cache for all types, and adds a `vm_setivar_class` codepath
for `T_CLASS` and `T_MODULE`.

`vm_setivar`, `vm_setivar_default` and `vm_setivar_class` could be unified,
but based on the very explicit `NOINLINE` I assume they were split to minimize
codesize.

```
compare-ruby: ruby 3.5.0dev (2025-08-27T14:58:58Z merge-vm-setivar-d.. 5b749d8e53) +PRISM [arm64-darwin24]
built-ruby: ruby 3.5.0dev (2025-08-27T16:30:31Z setivar-cache-gene.. 4fe78ff296) +PRISM [arm64-darwin24]

|                         |compare-ruby|built-ruby|
|:------------------------|-----------:|---------:|
|vm_ivar_set_on_instance  |     161.809|   164.688|
|                         |           -|     1.02x|
|vm_ivar_set_on_generic   |      58.769|   115.638|
|                         |           -|     1.97x|
|vm_ivar_set_on_class     |      70.034|   141.042|
|                         |           -|     2.01x|
```
</pre>
</div>
</content>
</entry>
<entry>
<title>variable.c: handle cleared fields_obj in genfields cache</title>
<updated>2025-08-21T12:17:29+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-08-21T11:24:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b6bf44ae0f0196c58a07e13ac1bd7adafd13f8b2'/>
<id>b6bf44ae0f0196c58a07e13ac1bd7adafd13f8b2</id>
<content type='text'>
[Bug #21547]

Followup: https://github.com/ruby/ruby/pull/14201

When adding an instance variable and the IMEMO/fields need to be
larger, we allocate a new one and clear the old one.

Since the old one may still be in other ec's cache, on a hit we must
check the IMEMO/fields isn't a stale one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21547]

Followup: https://github.com/ruby/ruby/pull/14201

When adding an instance variable and the IMEMO/fields need to be
larger, we allocate a new one and clear the old one.

Since the old one may still be in other ec's cache, on a hit we must
check the IMEMO/fields isn't a stale one.
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress warnings for variables</title>
<updated>2025-07-15T15:03:04+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-07-15T15:03:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=35660ec17d7257810fd64e1e12e92c58f4eaa2ca'/>
<id>35660ec17d7257810fd64e1e12e92c58f4eaa2ca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip test_exivar_resize_with_compaction_stress on s390x</title>
<updated>2025-06-15T04:41:29+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-06-15T02:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c88c2319a85c0006d0800e06a1effd08310b434d'/>
<id>c88c2319a85c0006d0800e06a1effd08310b434d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix generic_ivar_set_shape_field for table rebuild</title>
<updated>2025-06-14T06:29:41+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-06-14T01:52:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5342d9130beb44f9aa1dddbb7f6276bf01c7404f'/>
<id>5342d9130beb44f9aa1dddbb7f6276bf01c7404f</id>
<content type='text'>
[Bug #21438]

Previously GC could trigger a table rebuild of the generic fields
st_table in the middle of calling the st_update callback. This could
cause entries to be reallocated or rearranged and the update to be for
the wrong entry.

This commit adds an assertion to make that case easier to detect, and
replaces the st_update with a separate st_lookup and st_insert.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21438]

Previously GC could trigger a table rebuild of the generic fields
st_table in the middle of calling the st_update callback. This could
cause entries to be reallocated or rearranged and the update to be for
the wrong entry.

This commit adds an assertion to make that case easier to detect, and
replaces the st_update with a separate st_lookup and st_insert.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20992] Test for local variable name encodings</title>
<updated>2024-12-30T08:04:09+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-30T08:04:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5fec9308320e8b377681ef19b0cd46d53f94e8ac'/>
<id>5fec9308320e8b377681ef19b0cd46d53f94e8ac</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add test for many ivars</title>
<updated>2023-10-18T22:01:13+00:00</updated>
<author>
<name>Katherine Oelsner</name>
<email>octokatherine@github.com</email>
</author>
<published>2023-10-18T21:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0ac6fb225d15cbcd35b8122b151a17eaa92fafaf'/>
<id>0ac6fb225d15cbcd35b8122b151a17eaa92fafaf</id>
<content type='text'>
Co-authored-by: John Hawthorn &lt;john@hawthorn.email&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: John Hawthorn &lt;john@hawthorn.email&gt;
</pre>
</div>
</content>
</entry>
</feed>
