You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZJIT: Move string encoding flags loading to HIR (ruby#18894)
ClosesShopify#1051
The LIR generated without stats is the same, but now the `LoadField` can be deduped.
Same as ruby#18251 but without moving the `xor` to the HIR.
Generate HIR is now:
```
v31:CUInt64 = LoadField v29, :RBASIC_FLAGS@0x1040
v32:CUInt64 = LoadField v30, :RBASIC_FLAGS@0x1040
v33:StringExact = StringAppend v29, v30, recv_flags: v31, other_flags: v32
```
Compared with:
```
v31:StringExact = StringAppend v29, v30
```
### Benchmark
```
before: ruby 4.1.0dev (2026-09-17T02:33:06Z :detached: e6ec155) +PRISM [arm64-darwin25]
after: ruby 4.1.0dev (2026-09-17T03:27:34Z :detached: fc9a90e) +PRISM [arm64-darwin25]
---------- ------------- ------------- ------------- ------------
bench before (ms) after (ms) after 1st itr before/after
lobsters 636.7 ± 5.0% 631.6 ± 2.6% 0.999 1.008
railsbench 1175.6 ± 1.3% 1171.6 ± 1.3% 0.978 1.003
str_concat 41.7 ± 2.4% 42.3 ± 3.4% 1.006 0.984
---------- ------------- ------------- ------------- ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
0 commit comments