Skip to content

Commit

Permalink
Update monitor elimination to use new monitor API
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Zhang <[email protected]>
  • Loading branch information
Yi Zhang committed Mar 25, 2020
1 parent af00250 commit e7be341
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions runtime/compiler/optimizer/MonitorElimination.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1566,10 +1566,17 @@ void TR::MonitorElimination::transformMonitorsIntoTMRegions()
TR::Node *monitorObject = TR::Node::copy(monitor->getMonitorNode()->getFirstChild());
monitorObject->setReferenceCount(0);
TR::Node *tstartNode = TR::Node::createWithRoomForFive(TR::tstart, persistentFailNode, transientFailNode,fallThroughNode,monitorObject);
#ifdef OLD_MONITOR_API
if(monitor->getMonitorNode()->hasMonitorClassInNode())
tstartNode->setMonitorClassInNode(monitor->getMonitorNode()->getMonitorClassInNode());
tstartNode->setMonitorClassInNode(monitor->getMonitorNode()->getMonitorClassInNode());
else
tstartNode->setMonitorClassInNode(NULL);
tstartNode->setMonitorClassInNode(NULL);
#else
if(monitor->getMonitorNode()->hasMonitorInfoInNode())
tstartNode->setMonitorInfoInNode(monitor->getMonitorNode()->getMonitorInfoInNode());
else
tstartNode->setMonitorInfoInNode(NULL);
#endif
tstartNode->setSymbolReference(comp()->getSymRefTab()->findOrCreateTransactionEntrySymbolRef(comp()->getMethodSymbol()));
TR::TreeTop *tstarttt = TR::TreeTop::create(comp(),tstartNode,NULL,NULL);

Expand Down

0 comments on commit e7be341

Please sign in to comment.