Commit d1ce6031

d1ce6031ff7eMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 4 files · +3 added · ~1 modified

Description

Fix VALUE==VALUE binary ops, add setivar/object-new-no-escape benchmarks, clear var table between resolve passes

  • VALUE==VALUE now produces C == (was unsupported)
  • Clear stale var entries after resolve_class_types to prevent method param names from polluting top-level variable inference
  • setivar_object: Spinel <0.01s vs CRuby 0.12s
  • setivar_young: Spinel <0.01s vs CRuby (similar)
  • object-new-no-escape: Spinel 0.03s vs CRuby 0.46s (15x)

Skipped: matmul (needs Float array), gcbench/splay (nil-typed ivars)

73/73 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
d1ce6031ff7e
Parent
f43a7ea7746c

examples/bm_object_new_no_escape.rbaddedView file

1+# object-new-no-escape benchmark (from yjit-bench)
2+
3+class Point
4+ attr_reader :x, :y
5+ def initialize(x, y)
6+ @x = x
7+ @y = y
8+ end
9+end
10+
11+def test
12+ a = Point.new(1, 2)
13+ b = Point.new(1, 2)
14+ if a.x == b.x && a.y == b.y
15+ 1
16+ else
17+ 0
18+ end
19+end
20+
21+total = 0
22+i = 0
23+while i < 1000000
24+ total = total + test
25+ i = i + 1
26+end
27+puts total
28+puts "done"