Skip to content

Commit

Permalink
Avoid symbol reference sharing for dummy resolved methods
Browse files Browse the repository at this point in the history
It's possible to encounter an unresolved call, then to resolve its CP
entry in another thread, and finally encounter another call with the
same CP index, which is now resolved. In this situation, sharing is
usually prevented due to the !(resolvedMethod && symRef->isUnresolved())
condition. However, a dummy resolved method does not satisfy
symRef->isUnresolved().

It's important not to share the symbol reference because the dummy
resolved method used in the unresolved case may expect arguments of a
different type or a different number of arguments from the real resolved
method.
  • Loading branch information
jdmpapin committed Sep 1, 2021
1 parent ac3ab48 commit a0db673
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/compile/OMRSymbolReferenceTable.cpp
Expand Up @@ -1450,7 +1450,7 @@ OMR::SymbolReferenceTable::findOrCreateMethodSymbol(
&& owningMethodIndex == symRef->getOwningMethodIndex()
&& cpIndex != -1
&& symRef->getSymbol()->getMethodSymbol()->getMethodKind() == callKind
&& !(resolvedMethod && symRef->isUnresolved())
&& !(resolvedMethod && (symRef->isUnresolved() || symRef->getSymbol()->isDummyResolvedMethod()))
)
return symRef;
}
Expand Down

0 comments on commit a0db673

Please sign in to comment.