Skip to content

Commit ff94204

Browse files
Kevin SmithKevin Smith
authored andcommitted
Move type transition before use processing in backward pass.
When we insert type transitions, we need to know whether an aux slot pointer is in use so that we can correctly generate AdjustObjTypeReloadAyxSlotPtr intrs. Since use processing can clear aux slot syms from the upward exposed set, we move type transitions before use processing.
1 parent 76d3624 commit ff94204

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,6 +3062,11 @@ BackwardPass::ProcessBlock(BasicBlock * block)
30623062
TrackFloatSymEquivalence(instr);
30633063
}
30643064

3065+
if (this->tag == Js::DeadStorePhase && block->stackSymToFinalType != nullptr)
3066+
{
3067+
this->InsertTypeTransitionsAtPotentialKills();
3068+
}
3069+
30653070
opnd = instr->GetSrc1();
30663071
if (opnd != nullptr)
30673072
{
@@ -3738,11 +3743,6 @@ BackwardPass::ProcessBlock(BasicBlock * block)
37383743
"We didn't remove lazy bailout after prepass even though we don't need it?"
37393744
);
37403745

3741-
if (block->stackSymToFinalType != nullptr)
3742-
{
3743-
this->InsertTypeTransitionsAtPotentialKills();
3744-
}
3745-
37463746
// NoImplicitCallUses transfers need to be processed after determining whether implicit calls need to be disabled
37473747
// for the current instruction, because the instruction where the def occurs also needs implicit calls disabled.
37483748
// Array value type for the destination needs to be updated before transfers have been processed by
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
function test0(){
2+
function f() { obj.p9 = obj.p1 }
3+
let obj = {};
4+
obj.p1 = null;
5+
obj.p2 = null;
6+
obj.p3 = null;
7+
obj.p4 = null;
8+
obj.p5 = null;
9+
obj.p6 = null;
10+
obj.p7 = null;
11+
obj.p8 = null;
12+
f();
13+
+obj.p9;
14+
};
15+
16+
// generate profile
17+
test0();
18+
19+
// Run Simple JIT
20+
test0();
21+
22+
// run JITted code
23+
test0();
24+
25+
print("Pass");

test/Optimizer/rlexe.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,4 +1605,10 @@
16051605
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1 -force:inline</compile-flags>
16061606
</default>
16071607
</test>
1608+
<test>
1609+
<default>
1610+
<files>aux_slot_type_transition.js</files>
1611+
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1</compile-flags>
1612+
</default>
1613+
</test>
16081614
</regress-exe>

0 commit comments

Comments
 (0)