Skip to content

Commit

Permalink
Remove the createOrFindClonedNode function in OMR
Browse files Browse the repository at this point in the history
TR::Node *createOrFindClonedNode function in OMR::CodeGenerator has only
relevance to the OpenJ9 project. Therefore, remove it from OMR and
relocate it to the J9::CodeGenerator instead. In addition, fix the
spelling mistake on _uncommonedNodes and relocate it from OMR to J9.

Signed-off-by: Bohao(Aaron) Wang <[email protected]>
  • Loading branch information
wbh123456 committed May 21, 2019
1 parent 2d1e785 commit 8d0708b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
22 changes: 0 additions & 22 deletions compiler/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ OMR::CodeGenerator::CodeGenerator() :
_implicitExceptionPoint(0),
_localsThatAreStored(NULL),
_numLocalsWhenStoreAnalysisWasDone(-1),
_uncommmonedNodes(self()->comp()->trMemory(), stackAlloc),
_ialoadUnneeded(self()->comp()->trMemory()),
_symRefTab(self()->comp()->getSymRefTab()),
_vmThreadRegister(NULL),
Expand Down Expand Up @@ -1293,27 +1292,6 @@ bool OMR::CodeGenerator::areAssignableGPRsScarce()
return (self()->getMaximumNumbersOfAssignableGPRs() <= threshold);
}

// J9
//
TR::Node *
OMR::CodeGenerator::createOrFindClonedNode(TR::Node *node, int32_t numChildren)
{
TR_HashId index;
if (!_uncommmonedNodes.locate(node->getGlobalIndex(), index))
{
// has not been uncommoned already, clone and store for later
TR::Node *clone = TR::Node::copy(node, numChildren);
_uncommmonedNodes.add(node->getGlobalIndex(), index, clone);
node = clone;
}
else
{
// found previously cloned node
node = (TR::Node *) _uncommmonedNodes.getData(index);
}
return node;
}


// returns true iff, based on opcodes and offsets if two store/load/address nodes are definitely disjoint (i.e. guaranteed not to overlap)
// any combination of stores,loads and address nodes are allowed as node1 and node2
Expand Down
5 changes: 1 addition & 4 deletions compiler/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class OMR_EXTENSIBLE CodeGenerator

TR_BitVector *_localsThatAreStored;
int32_t _numLocalsWhenStoreAnalysisWasDone;
TR_HashTabInt _uncommmonedNodes; // uncommoned nodes keyed by the original nodes
List<TR_Pair<TR::Node, int32_t> > _ialoadUnneeded;

public:
Expand Down Expand Up @@ -1389,9 +1388,7 @@ class OMR_EXTENSIBLE CodeGenerator
return true;
}

// --------------------------------------------------------------------------

TR::Node *createOrFindClonedNode(TR::Node *node, int32_t numChildren);
// --------------------------------------------------------------------------

bool constantAddressesCanChangeSize(TR::Node *node);
bool profiledPointersRequireRelocation();
Expand Down

0 comments on commit 8d0708b

Please sign in to comment.