Skip to content

Commit b987511

Browse files
committed
.
1 parent 5a3c545 commit b987511

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

zjit/src/hir/opt_tests.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,6 +3573,46 @@ mod hir_opt_tests {
35733573
");
35743574
}
35753575

3576+
#[test]
3577+
fn test_specialize_multiple_monomorphic_setivar_with_shape_transition() {
3578+
eval("
3579+
def test
3580+
@foo = 1
3581+
@bar = 2
3582+
end
3583+
test
3584+
");
3585+
assert_snapshot!(hir_string("test"), @r"
3586+
fn test@<compiled>:3:
3587+
bb0():
3588+
EntryPoint interpreter
3589+
v1:BasicObject = LoadSelf
3590+
Jump bb2(v1)
3591+
bb1(v4:BasicObject):
3592+
EntryPoint JIT(0)
3593+
Jump bb2(v4)
3594+
bb2(v6:BasicObject):
3595+
v10:Fixnum[1] = Const Value(1)
3596+
PatchPoint SingleRactorMode
3597+
v25:HeapBasicObject = GuardType v6, HeapBasicObject
3598+
v26:HeapBasicObject = GuardShape v25, 0x1000
3599+
StoreField v26, :@foo@0x1001, v10
3600+
WriteBarrier v26, v10
3601+
v29:CUInt32[4194311] = Const CUInt32(4194311)
3602+
StoreField v26, :_shape_id@0x1002, v29
3603+
v16:Fixnum[2] = Const Value(2)
3604+
PatchPoint SingleRactorMode
3605+
v31:HeapBasicObject = GuardType v6, HeapBasicObject
3606+
v32:HeapBasicObject = GuardShape v31, 0x1003
3607+
StoreField v32, :@bar@0x1004, v16
3608+
WriteBarrier v32, v16
3609+
v35:CUInt32[4194312] = Const CUInt32(4194312)
3610+
StoreField v32, :_shape_id@0x1002, v35
3611+
CheckInterrupts
3612+
Return v16
3613+
");
3614+
}
3615+
35763616
#[test]
35773617
fn test_dont_specialize_setivar_with_t_data() {
35783618
eval("

0 commit comments

Comments
 (0)