Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/compiler/optimizer/InlinerTempForJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5731,6 +5731,7 @@ TR_InlinerFailureReason TR_J9InlinerPolicy::checkIfTargetInlineable(TR_CallTarge
case TR::java_lang_invoke_MethodHandle_asType:
case TR::java_lang_invoke_Invokers_checkVarHandleGenericType:
case TR::java_lang_invoke_Invokers_checkGenericType:
case TR::java_lang_invoke_MethodHandleImpl_isCompileConstant:
return DontInline_Callee;
default:
break;
Expand Down
17 changes: 17 additions & 0 deletions runtime/compiler/optimizer/J9ValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,24 @@ void J9::ValuePropagation::constrainRecognizedMethod(TR::Node *node)
}
break;
}
case TR::java_lang_invoke_MethodHandleImpl_isCompileConstant: {
TR::Node *mhNode = node->getFirstChild();
bool isGlobal;
logprintf(trace(), log, "Trying to fold MethodHandleImpl.isCompileConstant\n");
TR::VPConstraint *mhConstraint = getConstraint(mhNode, isGlobal);
if (mhConstraint && mhConstraint->getKnownObject() && mhConstraint->isNonNullObject()) {
transformCallToIconstInPlaceOrInDelayedTransformations(_curTree, 1, isGlobal, true, false);
logprintf(trace(), log, "MethodHandleImpl.isCompileConstant folded to true\n");
return;
}

if (!lastTimeThrough())
return;

transformCallToIconstInPlaceOrInDelayedTransformations(_curTree, 0, isGlobal, true, false);
logprintf(trace(), log, "MethodHandleImpl.isCompileConstant folded to false\n");
break;
}
default:
break;
}
Expand Down