Skip to content

Commit

Permalink
Overload incRefCountForOpaquePseudoRegister in OpenJ9
Browse files Browse the repository at this point in the history
This patch overloads J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister in
OpenJ9 with less parameters. This is the 2/6 step to simpify this
function.

Issue: eclipse-omr/omr#1855
Signed-off-by: Bohao(Aaron) Wang <aaronwang0407@gmail.com>
  • Loading branch information
wbh123456 committed May 29, 2019
1 parent 501661c commit 03919df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions runtime/compiler/z/codegen/J9CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,24 @@ J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister(TR::Node * node, TR::Co
}
}

//AN OVERLOAD OF ABOVE FUNCTION; DOES EXACTLY THE SAME JOB
void
J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister(TR::Node * node)
{
if (node->getOpaquePseudoRegister())
{
TR_OpaquePseudoRegister *reg = node->getOpaquePseudoRegister();
TR_StorageReference *ref = reg->getStorageReference();
if (ref && ref->isNodeBased() && ref->getNodeReferenceCount() > 0)
{
if (self()->traceBCDCodeGen())
self()->comp()->getDebug()->trace("\tnode %s (%p) with storageRef #%d (%s): increment nodeRefCount %d->%d when artificially incrementing ref count\n",
node->getOpCode().getName(),node,ref->getReferenceNumber(),self()->comp()->getDebug()->getName(ref->getSymbol()),ref->getNodeReferenceCount(),ref->getNodeReferenceCount()+1);
ref->incrementNodeReferenceCount();
}
}
}

TR::Instruction* J9::Z::CodeGenerator::generateVMCallHelperSnippet(TR::Instruction* cursor, TR::LabelSymbol* vmCallHelperSnippetLabel)
{
TR::Compilation* comp = self()->comp();
Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/z/codegen/J9CodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator
#endif

void incRefCountForOpaquePseudoRegister(TR::Node * node, TR::CodeGenerator * cg, TR::Compilation * comp);
//OVERLOAD THE ABOVE FUNCTION
void incRefCountForOpaquePseudoRegister(TR::Node * node);

/** \brief
* Generates a VM call helper sequence along with the necessary metadata in the instruction stream which when
Expand Down

0 comments on commit 03919df

Please sign in to comment.