Skip to content

Commit

Permalink
Use symRef with known obj index for known parms
Browse files Browse the repository at this point in the history
If known object information is avaible for the method receiver, use
known object index to create the parm symbol reference. Optimizations
can make use of the info without running global VP which is very
expensive and doesn't kick in at warm.

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
  • Loading branch information
Yi Zhang committed Jun 7, 2019
1 parent cca8f31 commit aa5579b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/compile/Method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ void TR_ResolvedMethod::makeParameterList(TR::ResolvedMethodSymbol *methodSym)
}
else
{
parmSymbol = methodSym->comp()->getSymRefTab()->createParameterSymbol(methodSym, 0, TR::Address);
TR::KnownObjectTable::Index knownObjectIndex = methodSym->getKnownObjectIndexForParm(0);
parmSymbol = methodSym->comp()->getSymRefTab()->createParameterSymbol(methodSym, 0, TR::Address, knownObjectIndex);
parmSymbol->setOrdinal(ordinal++);

int32_t len = classNameLen; // len is passed by reference and changes during the call
Expand Down
7 changes: 7 additions & 0 deletions compiler/il/symbol/OMRResolvedMethodSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,13 @@ void OMR::ResolvedMethodSymbol::clearProfilingOffsetInfo()
_bytecodeProfilingOffsets.clear();
}


TR::KnownObjectTable::Index
OMR::ResolvedMethodSymbol::getKnownObjectIndexForParm(int32_t ordinal)
{
return TR::KnownObjectTable::UNKNOWN;
}

//Explicit instantiations

template TR::ResolvedMethodSymbol * OMR::ResolvedMethodSymbol::create(TR_StackMemory m, TR_ResolvedMethod * rm, TR::Compilation * comp);
Expand Down
8 changes: 8 additions & 0 deletions compiler/il/symbol/OMRResolvedMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ class OMR_EXTENSIBLE ResolvedMethodSymbol : public TR::MethodSymbol

void addVariableSizeSymbol(TR::AutomaticSymbol *s);

/*
* \brief Get known object index of a parameter if there is any known object information available
*
* \parm ordinal
* the ordinal of a parameter including the receiver if the method is a virtual method
*/
TR::KnownObjectTable::Index getKnownObjectIndexForParm(int32_t ordinal);

mcount_t getResolvedMethodIndex() { return _methodIndex; }
TR_ResolvedMethod * getResolvedMethod() { return _resolvedMethod; }

Expand Down

0 comments on commit aa5579b

Please sign in to comment.