Skip to content

Commit bb7131b

Browse files
author
Kevin Smith
committed
[MERGE #6190 @zenparsing] Move type transitions above def processing in backward pass
Merge pull request #6190 from zenparsing:adjust-slot-redux
2 parents 7a4a283 + 30e02ef commit bb7131b

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,6 +3021,11 @@ BackwardPass::ProcessBlock(BasicBlock * block)
30213021

30223022
bool hasLiveFields = (block->upwardExposedFields && !block->upwardExposedFields->IsEmpty());
30233023

3024+
if (this->tag == Js::DeadStorePhase && block->stackSymToFinalType != nullptr)
3025+
{
3026+
this->InsertTypeTransitionsAtPotentialKills();
3027+
}
3028+
30243029
IR::Opnd * opnd = instr->GetDst();
30253030
if (opnd != nullptr)
30263031
{
@@ -3069,11 +3074,6 @@ BackwardPass::ProcessBlock(BasicBlock * block)
30693074
TrackFloatSymEquivalence(instr);
30703075
}
30713076

3072-
if (this->tag == Js::DeadStorePhase && block->stackSymToFinalType != nullptr)
3073-
{
3074-
this->InsertTypeTransitionsAtPotentialKills();
3075-
}
3076-
30773077
opnd = instr->GetSrc1();
30783078
if (opnd != nullptr)
30793079
{
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// -maxinterpretcount:1 -maxsimplejitruncount:1 -bgjit-
2+
function test() {
3+
var f = function () {};
4+
f.p1 = 1;
5+
(function () {
6+
Object.defineProperty(f, 'length', { writable: true });
7+
f.length = undefined;
8+
f.p2 = 2;
9+
}());
10+
}
11+
12+
test();
13+
test();
14+
test();
15+
16+
print('Pass');

test/Optimizer/rlexe.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,4 +1617,10 @@
16171617
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1</compile-flags>
16181618
</default>
16191619
</test>
1620+
<test>
1621+
<default>
1622+
<files>aux_slot_type_transition_2.js</files>
1623+
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1</compile-flags>
1624+
</default>
1625+
</test>
16201626
</regress-exe>

0 commit comments

Comments
 (0)