Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pleath authored and akroshg committed Dec 10, 2018
1 parent 69a259c commit c04787f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
6 changes: 0 additions & 6 deletions lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2852,12 +2852,6 @@ GlobOpt::OptDst(
{
this->FinishOptPropOp(instr, opnd->AsPropertySymOpnd());
}
else if (instr->m_opcode == Js::OpCode::StElemI_A ||
instr->m_opcode == Js::OpCode::StElemI_A_Strict ||
instr->m_opcode == Js::OpCode::InitComputedProperty)
{
this->KillObjectHeaderInlinedTypeSyms(this->currentBlock, false);
}

if (opnd->IsIndirOpnd() && !this->IsLoopPrePass())
{
Expand Down
28 changes: 25 additions & 3 deletions lib/Backend/GlobOptFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,20 @@ GlobOpt::ProcessFieldKills(IR::Instr *instr, BVSparse<JitArenaAllocator> *bv, bo
Assert(dstOpnd != nullptr);
KillLiveFields(this->lengthEquivBv, bv);
KillLiveElems(dstOpnd->AsIndirOpnd(), bv, inGlobOpt, instr->m_func);
if (inGlobOpt)
{
KillObjectHeaderInlinedTypeSyms(this->currentBlock, false);
}
break;

case Js::OpCode::InitComputedProperty:
case Js::OpCode::InitGetElemI:
case Js::OpCode::InitSetElemI:
KillLiveElems(dstOpnd->AsIndirOpnd(), bv, inGlobOpt, instr->m_func);
if (inGlobOpt)
{
KillObjectHeaderInlinedTypeSyms(this->currentBlock, false);
}
break;

case Js::OpCode::DeleteElemI_A:
Expand Down Expand Up @@ -394,6 +404,10 @@ GlobOpt::ProcessFieldKills(IR::Instr *instr, BVSparse<JitArenaAllocator> *bv, bo
case Js::OpCode::InlineArrayPush:
case Js::OpCode::InlineArrayPop:
KillLiveFields(this->lengthEquivBv, bv);
if (inGlobOpt)
{
KillObjectHeaderInlinedTypeSyms(this->currentBlock, false);
}
break;

case Js::OpCode::InlineeStart:
Expand All @@ -410,10 +424,18 @@ GlobOpt::ProcessFieldKills(IR::Instr *instr, BVSparse<JitArenaAllocator> *bv, bo
fnHelper = instr->GetSrc1()->AsHelperCallOpnd()->m_fnHelper;

// Kill length field for built-ins that can update it.
if(nullptr != this->lengthEquivBv && (fnHelper == IR::JnHelperMethod::HelperArray_Shift || fnHelper == IR::JnHelperMethod::HelperArray_Splice
|| fnHelper == IR::JnHelperMethod::HelperArray_Unshift))
if(fnHelper == IR::JnHelperMethod::HelperArray_Shift
|| fnHelper == IR::JnHelperMethod::HelperArray_Splice
|| fnHelper == IR::JnHelperMethod::HelperArray_Unshift)
{
KillLiveFields(this->lengthEquivBv, bv);
if (nullptr != this->lengthEquivBv)
{
KillLiveFields(this->lengthEquivBv, bv);
}
if (inGlobOpt)
{
KillObjectHeaderInlinedTypeSyms(this->currentBlock, false);
}
}

if ((fnHelper == IR::JnHelperMethod::HelperRegExp_Exec)
Expand Down

0 comments on commit c04787f

Please sign in to comment.