Skip to content

Commit 748e484

Browse files
committed
.
1 parent 0a60a56 commit 748e484

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

zjit/src/hir/opt_tests.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7367,14 +7367,15 @@ mod hir_opt_tests {
73677367
#[test]
73687368
fn test_optimize_getivar_polymorphic() {
73697369
set_call_threshold(3);
7370-
eval("
7370+
eval(r#"
73717371
class C
73727372
def foo_then_bar
73737373
@foo = 1
73747374
@bar = 2
73757375
end
73767376
73777377
def bar_then_foo
7378+
1000.times { |i| instance_variable_set(:"@v#{i}", i) }
73787379
@bar = 3
73797380
@foo = 4
73807381
end
@@ -7388,9 +7389,9 @@ mod hir_opt_tests {
73887389
O2.bar_then_foo
73897390
O1.foo
73907391
O2.foo
7391-
");
7392+
"#);
73927393
assert_snapshot!(hir_string_proc("C.instance_method(:foo)"), @"
7393-
fn foo@<compiled>:13:
7394+
fn foo@<compiled>:14:
73947395
bb1():
73957396
EntryPoint interpreter
73967397
v1:BasicObject = LoadSelf
@@ -7406,17 +7407,18 @@ mod hir_opt_tests {
74067407
v14:CShape[0x1001] = Const CShape(0x1001)
74077408
v15:CBool = IsBitEqual v12, v14
74087409
IfTrue v15, bb5()
7409-
v19:CShape[0x1002] = Const CShape(0x1002)
7410-
v20:CBool = IsBitEqual v12, v19
7411-
IfTrue v20, bb6()
7412-
v24:BasicObject = GetIvar v11, :@foo
7413-
Jump bb4(v24)
7410+
v20:CShape[0x1002] = Const CShape(0x1002)
7411+
v21:CBool = IsBitEqual v12, v20
7412+
IfTrue v21, bb6()
7413+
v25:BasicObject = GetIvar v11, :@foo
7414+
Jump bb4(v25)
74147415
bb5():
7415-
v17:BasicObject = LoadField v11, :@foo@0x1003
7416-
Jump bb4(v17)
7416+
v17:CPtr = LoadField v11, :_as_heap@0x1003
7417+
v18:BasicObject = LoadField v17, :@foo@0x1004
7418+
Jump bb4(v18)
74177419
bb6():
7418-
v22:BasicObject = LoadField v11, :@foo@0x1004
7419-
Jump bb4(v22)
7420+
v23:BasicObject = LoadField v11, :@foo@0x1003
7421+
Jump bb4(v23)
74207422
bb4(v13:BasicObject):
74217423
CheckInterrupts
74227424
Return v13

0 commit comments

Comments
 (0)