Skip to content

Commit

Permalink
Field PRE for multi-level field loads involving LdSlot/LdSlotArr
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatd committed May 12, 2018
1 parent 3647daf commit 0c15d38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ GlobOpt::SetLoopFieldInitialValue(Loop *loop, IR::Instr *instr, PropertySym *pro
}
IR::Instr * defInstr = objectSym->GetInstrDef();
IR::Opnd * src1 = defInstr->GetSrc1();
while (!(src1 && src1->IsSymOpnd() && src1->AsSymOpnd()->IsPropertySymOpnd()))
while (!(src1 && src1->IsSymOpnd() && src1->AsSymOpnd()->m_sym->IsPropertySym()))
{
if (src1 && src1->IsRegOpnd() && src1->AsRegOpnd()->GetStackSym()->IsSingleDef())
{
Expand Down Expand Up @@ -17131,8 +17131,9 @@ GlobOpt::PRE::InsertSymDefinitionInLandingPad(StackSym * sym, Loop * loop, Sym *
}

IR::Opnd * symDefInstrSrc1 = symDefInstr->GetSrc1();
if (symDefInstrSrc1->IsSymOpnd() && symDefInstrSrc1->AsSymOpnd()->IsPropertySymOpnd())
if (symDefInstrSrc1->IsSymOpnd())
{
Assert(symDefInstrSrc1->AsSymOpnd()->m_sym->IsPropertySym());
// $L1
// T1 = o.x (v1|T3)
// T2 = T1.y (v2|T4) <-- T1 is not live in the loop landing pad
Expand All @@ -17141,7 +17142,7 @@ GlobOpt::PRE::InsertSymDefinitionInLandingPad(StackSym * sym, Loop * loop, Sym *
// Trying to make T1 live in the landing pad

// o.x
PropertySym* propSym = symDefInstrSrc1->AsSymOpnd()->AsPropertySymOpnd()->GetPropertySym();
PropertySym* propSym = symDefInstrSrc1->AsSymOpnd()->m_sym->AsPropertySym();

if (candidates->candidatesBv->Test(propSym->m_id))
{
Expand Down
10 changes: 5 additions & 5 deletions lib/Runtime/Library/JavascriptArray.inl
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,12 @@ SECOND_PASS:
LinkSegments((Js::SparseArraySegment<T>*)startPrev, current);
current->length = startOffset + length + growby;
current->CheckLengthvsSize();
}
if (current == head && HasNoMissingValues())
{
if (ScanForMissingValues<T>(startOffset + length, current->length))
if (current == head && HasNoMissingValues())
{
SetHasNoMissingValues(false);
if (ScanForMissingValues<T>(startOffset + length, current->length))
{
SetHasNoMissingValues(false);
}
}
}
}
Expand Down

0 comments on commit 0c15d38

Please sign in to comment.