Skip to content

Commit

Permalink
Correct typos mentioning classDepthAndFlags field
Browse files Browse the repository at this point in the history
Code in OMR supports the JIT compiler in generating IL to access the
J9Class field classDepthAndFlags field in the downstream OpenJ9 project.
In many cases, that code incorrectly refers to the field as
classAndDepthFlags.

This commit adds new duplicate definitions of the methods and enum
values that correct the name.  Once the downstream project removes
references to the obsolete methods, the obsolete definitions will be
removed.
  • Loading branch information
hzongaro committed May 8, 2024
1 parent 1bcf969 commit 59be3a5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions compiler/compile/OMRNonHelperSymbols.enum
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
componentClassSymbol,
isArraySymbol,
isClassAndDepthFlagsSymbol,
isClassDepthAndFlagsSymbol = isClassAndDepthFlagsSymbol,
isClassFlagsSymbol,
vftSymbol,
currentThreadSymbol,
Expand Down
8 changes: 7 additions & 1 deletion compiler/compile/OMRSymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ OMR::SymbolReferenceTable::findClassIsArraySymbolRef()
}


TR::SymbolReference *
OMR::SymbolReferenceTable::findClassDepthAndFlagsSymbolRef()
{
return element(isClassDepthAndFlagsSymbol);
}

TR::SymbolReference *
OMR::SymbolReferenceTable::findClassAndDepthFlagsSymbolRef()
{
Expand Down Expand Up @@ -2142,7 +2148,7 @@ const char *OMR::SymbolReferenceTable::_commonNonHelperSymbolNames[] =
"<addressOfClassOfMethod>",
"<componentClass>",
"<isArray>",
"<isClassAndDepthFlags>",
"<isClassDepthAndFlags>",
"<isClassFlags>",
"<vft>",
"<currentThread>",
Expand Down
2 changes: 2 additions & 0 deletions compiler/compile/OMRSymbolReferenceTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class SymbolReferenceTable
componentClassAsPrimitiveSymbol,
isArraySymbol,
isClassAndDepthFlagsSymbol,
isClassDepthAndFlagsSymbol = isClassAndDepthFlagsSymbol,
initializeStatusFromClassSymbol,
isClassFlagsSymbol,
vftSymbol,
Expand Down Expand Up @@ -773,6 +774,7 @@ class SymbolReferenceTable
TR::SymbolReference * findDescriptionWordFromPtrSymbolRef();
TR::SymbolReference * findClassFlagsSymbolRef();
TR::SymbolReference * findClassAndDepthFlagsSymbolRef();
TR::SymbolReference * findClassDepthAndFlagsSymbolRef();
TR::SymbolReference * findArrayComponentTypeSymbolRef();
TR::SymbolReference * findClassIsArraySymbolRef();
TR::SymbolReference * findHeaderFlagsSymbolRef() { return element(headerFlagsSymbol); }
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/LoopVersioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8105,7 +8105,7 @@ bool TR_LoopVersioner::suppressInvarianceAndPrivatization(TR::SymbolReference *s
return true;

// Class flags are mutable.
case TR::SymbolReferenceTable::isClassAndDepthFlagsSymbol:
case TR::SymbolReferenceTable::isClassDepthAndFlagsSymbol:
return true;

#ifdef J9_PROJECT_SPECIFIC
Expand Down
4 changes: 2 additions & 2 deletions compiler/optimizer/VPHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ bool simplifyJ9ClassFlags(OMR::ValuePropagation *vp, TR::Node *node, bool isLong
TR::VPConstraint *base = vp->getConstraint(node->getFirstChild(), isGlobal);
TR::SymbolReference *symRef = node->getSymbolReference();

if (symRef == vp->comp()->getSymRefTab()->findClassAndDepthFlagsSymbolRef() &&
if (symRef == vp->comp()->getSymRefTab()->findClassDepthAndFlagsSymbolRef() &&
base &&
base->isJ9ClassObject() == TR_yes &&
base->getClassType() &&
Expand Down Expand Up @@ -7647,7 +7647,7 @@ TR::Node *constrainIand(OMR::ValuePropagation *vp, TR::Node *node)
firstChild = firstChild->getChild(0);

if ((firstChild->getOpCodeValue() == TR::iloadi || firstChild->getOpCodeValue() == TR::lloadi) &&
(firstChild->getSymbolReference() == vp->comp()->getSymRefTab()->findClassAndDepthFlagsSymbolRef()) &&
(firstChild->getSymbolReference() == vp->comp()->getSymRefTab()->findClassDepthAndFlagsSymbolRef()) &&
(rhs->getLowInt() == TR::Compiler->cls.flagValueForArrayCheck(vp->comp())))
{
if (vp->trace())
Expand Down
2 changes: 1 addition & 1 deletion compiler/ras/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ static const char *commonNonhelperSymbolNames[] =
"<componentClass>",
"<componentClassAsPrimitive>",
"<isArray>",
"<isClassAndDepthFlags>",
"<isClassDepthAndFlags>",
"<initializeStatusFromClass>",
"<isClassFlags>",
"<vft>",
Expand Down

0 comments on commit 59be3a5

Please sign in to comment.