Skip to content

Commit

Permalink
Abort ILGen for non supported features in AOT
Browse files Browse the repository at this point in the history
Constant Dynamic, Method Handle Constant, and Method Type Constant
 is not currently supported in AOT. Therefore, this
commit throws the appropriate exception in ILGen if this
condition is met. However, because all of these exceptions are a
TR::RecoverableILGenException, if the compiler is generating IL for an
inlined method, it will not abort the compile, but simply refuse to
inline that particular method.

Signed-off-by: Irwin D'Souza <[email protected]>
  • Loading branch information
dsouzai committed Apr 2, 2020
1 parent aa5bcee commit c33a120
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions runtime/compiler/ilgen/Walker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5456,6 +5456,13 @@ TR_J9ByteCodeIlGenerator::loadFromCP(TR::DataType type, int32_t cpIndex)
case TR::Address:
if (method()->isConstantDynamic(cpIndex))
{
if (comp()->compileRelocatableCode())
{
if (comp()->getOption(TR_TraceILGen))
traceMsg(comp(), " Constant Dynamic not supported in AOT.\n");
comp()->failCompilation<J9::AOTHasConstantDynamic>("Constant Dynamic not supported in AOT.");
}

bool isCondyUnresolved = _methodSymbol->getResolvedMethod()->isUnresolvedConstantDynamic(cpIndex);
J9UTF8 *returnTypeUtf8 = (J9UTF8 *)_methodSymbol->getResolvedMethod()->getConstantDynamicTypeFromCP(cpIndex);
int returnTypeUtf8Length = J9UTF8_LENGTH(returnTypeUtf8);
Expand Down Expand Up @@ -5678,11 +5685,23 @@ TR_J9ByteCodeIlGenerator::loadFromCP(TR::DataType type, int32_t cpIndex)
}
else if (method()->isMethodHandleConstant(cpIndex))
{
if (comp()->compileRelocatableCode())
{
if (comp()->getOption(TR_TraceILGen))
traceMsg(comp(), " Method Handle Constant not supported in AOT.\n");
comp()->failCompilation<J9::AOTHasMethodHandleConstant>("Method Handle Constant not supported in AOT.");
}
loadSymbol(TR::aload, symRefTab()->findOrCreateMethodHandleSymbol(_methodSymbol, cpIndex));
}
else
{
TR_ASSERT(method()->isMethodTypeConstant(cpIndex), "Address-type CP entry %d must be class, string, methodHandle, or methodType", cpIndex);
if (comp()->compileRelocatableCode())
{
if (comp()->getOption(TR_TraceILGen))
traceMsg(comp(), " Method Type Constant not supported in AOT.\n");
comp()->failCompilation<J9::AOTHasMethodTypeConstant>("Method Type Constant not supported in AOT.");
}
loadSymbol(TR::aload, symRefTab()->findOrCreateMethodTypeSymbol(_methodSymbol, cpIndex));
}
break;
Expand Down

0 comments on commit c33a120

Please sign in to comment.