Skip to content

Commit

Permalink
Merge pull request #3036 from 0dvictor/nullchk
Browse files Browse the repository at this point in the history
Fix for missing NULLCHK in Unsafe atomics
  • Loading branch information
andrewcraik authored Sep 27, 2018
2 parents a245695 + 6d025e4 commit a9a160d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/compiler/optimizer/J9RecognizedCallTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ void J9::RecognizedCallTransformer::process_java_lang_StringUTF16_toBytes(TR::Tr
void J9::RecognizedCallTransformer::processUnsafeAtomicCall(TR::TreeTop* treetop, TR::Node* node, TR::SymbolReferenceTable::CommonNonhelperSymbol helper)
{
node->setSymbolReference(comp()->getSymRefTab()->findOrCreateCodeGenInlinedHelper(helper));
if (treetop->getNode()->getOpCodeValue() == TR::NULLCHK)
{
auto nullchk = comp()->getSymRefTab()->findOrCreateNullCheckSymbolRef(comp()->getMethodSymbol());
treetop->insertBefore(TR::TreeTop::create(comp(), TR::Node::createWithSymRef(TR::NULLCHK, 1, 1, TR::Node::create(node, TR::PassThrough, 1, node->getChild(0)), nullchk)));
treetop->getNode()->setSymbolReference(NULL);
TR::Node::recreate(treetop->getNode(), TR::treetop);
}
node->removeChild(0);

bool safeToSkipDiamond = !strncmp(comp()->getCurrentMethod()->classNameChars(), "java/util/concurrent/atomic/", strlen("java/util/concurrent/atomic/"));

TR_Array<TR::Node*> params(trMemory(), node->getNumChildren()-2);
Expand Down

0 comments on commit a9a160d

Please sign in to comment.