Skip to content

Commit

Permalink
Merge pull request eclipse-openj9#8006 from cathyzhyi/ea
Browse files Browse the repository at this point in the history
Initialize header of stack allocated object
  • Loading branch information
andrewcraik authored Dec 11, 2019
2 parents 5fcbbbb + 92aae0b commit 74f2071
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions runtime/compiler/optimizer/EscapeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6377,34 +6377,11 @@ void TR_EscapeAnalysis::makeLocalObject(Candidate *candidate)
traceMsg(comp(), " }\n");
}

//bool insertInitAtStart = false;
//if (referenceSlots)
// {
// for (i = 0; referenceSlots[i]; i++)
// {
// insertInitAtStart = true;
// break;
// }
// }

TR::TreeTop *insertionPoint;
TR::Node *nodeToUseInInit;
//if (insertInitAtStart)
if ( referenceSlots
|| (candidate->_kind != TR::New) // 174954: array size field must be initialized in the first block until we put a sumref on TR::arraylength
|| candidate->isInsideALoop())
{
nodeToUseInInit = allocationNode->duplicateTree();
insertionPoint = comp()->getStartTree();
}
else
{
nodeToUseInInit = allocationNode;
insertionPoint = candidate->_treeTop;
}

// Initialize the header of the local object
//
TR::Node *nodeToUseInInit = allocationNode->duplicateTree();
TR::TreeTop *insertionPoint = comp()->getStartTree();

if (candidate->_kind == TR::New)
comp()->fej9()->initializeLocalObjectHeader(comp(), nodeToUseInInit, insertionPoint);
else
Expand Down

0 comments on commit 74f2071

Please sign in to comment.