Skip to content

Commit

Permalink
Merge pull request #20551 from gita-omr/known_aload
Browse files Browse the repository at this point in the history
Use node's known object index in VectorAPIExpansion
  • Loading branch information
jdmpapin authored Nov 13, 2024
2 parents 34e3574 + f9cac71 commit ab5676f
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions runtime/compiler/optimizer/VectorAPIExpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,20 +657,30 @@ TR_VectorAPIExpansion::getJ9ClassFromClassNode(TR::Compilation *comp, TR::Node *
return NULL;

TR::SymbolReference *symRef = classNode->getSymbolReference();
if (symRef)

TR::KnownObjectTable::Index knownObjectIndex = TR::KnownObjectTable::UNKNOWN;

if (symRef && symRef->hasKnownObjectIndex())
{
if (symRef->hasKnownObjectIndex())
{
TR_J9VMBase *fej9 = comp->fej9();
knownObjectIndex = symRef->getKnownObjectIndex();
}
else if (classNode->hasKnownObjectIndex())
{
knownObjectIndex = classNode->getKnownObjectIndex();
}

TR::VMAccessCriticalSection getDataTypeFromClassNodeSection(fej9);
if (knownObjectIndex != TR::KnownObjectTable::UNKNOWN)
{
TR_J9VMBase *fej9 = comp->fej9();

uintptr_t javaLangClass = comp->getKnownObjectTable()->getPointer(symRef->getKnownObjectIndex());
J9Class *j9class = (J9Class *)(intptr_t)fej9->getInt64Field(javaLangClass, "vmRef");
TR::VMAccessCriticalSection getDataTypeFromClassNodeSection(fej9);

return j9class;
}
uintptr_t javaLangClass = comp->getKnownObjectTable()->getPointer(knownObjectIndex);
J9Class *j9class = (J9Class *)(intptr_t)fej9->getInt64Field(javaLangClass, "vmRef");

return j9class;
}

return NULL;
}

Expand Down

0 comments on commit ab5676f

Please sign in to comment.