summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTobias Lütke <tobi@shopify.com>2025-12-10 16:18:08 -0500
committerGitHub <noreply@github.com>2025-12-10 16:18:08 -0500
commitc8909030974772b4f19742bac55875e32674d27f (patch)
tree1ea61ef4d337b998a29114428175fdb772cccbb8 /test/ruby
parentccfd31162a8455ac2502ebaf90873b966a866216 (diff)
ZJIT: Fold LoadField on frozen objects to constants (#15483)
* 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>
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions