Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Dec 11, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

alexcrocha and others added 12 commits December 10, 2025 20:30
Generating an object_id for any type other than T_OBJECT (and T_CLASS)
will inevitably allocate an IMEMO/fields objects, which isn't supported
in a NEWOBJ tracepoint.

See: https://bugs.ruby-lang.org/issues/21710#note-23
* ZJIT: Fold LoadField on frozen objects to constants

When accessing instance variables from frozen objects via attr_reader/
attr_accessor, fold the LoadField instruction to a constant at compile
time. This enables further optimizations like constant propagation.

- Add fold_getinstancevariable_frozen optimization in Function::optimize
- Check if receiver type has a known ruby_object() that is frozen
- Read the field value at compile time and replace with Const instruction
- Add 10 unit tests covering various value types (fixnum, string, symbol,
  nil, true/false) and negative cases (unfrozen, dynamic receiver)

* Run zjit-test-update

* Add a test that we don't fold non-BasicObject

* Small cleanups

---------

Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
So we don't expose builders to network flakiness which cannot be worked
around using cargo's --offline flag.
No point doing the manual size unit conversion for add. Sorry, no new
tests since there is no way to generate a LoadField with a negative
offset from ruby code AFAICT. Careful with the `as` casts.
Although the Ractor API is still experimental and may change, and there
may be some implementation issues, we should no longer say that there
are many.

Hopefully we can remove this warning entirely for Ruby 4.1
I believe this was accidentally left in as part of
2beb379
@pull pull bot locked and limited conversation to collaborators Dec 11, 2025
@pull pull bot added the ⤵️ pull label Dec 11, 2025
@pull pull bot merged commit c7d56e9 into turkdevops:master Dec 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants