Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent VP Object.clone transformation under involuntary OSR #14071

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 26 additions & 21 deletions runtime/compiler/optimizer/J9ValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,8 @@ J9::ValuePropagation::innerConstrainAcall(TR::Node *node)
{
newTypeConstraint = TR::VPFixedClass::create(this, constraint->getClass());

if (!comp()->compileRelocatableCode())
if (!comp()->compileRelocatableCode()
&& comp()->getOSRMode() != TR::involuntaryOSR)
{
if (constraint->getClassType()
&& constraint->getClassType()->isArray() == TR_no
Expand All @@ -2353,28 +2354,32 @@ J9::ValuePropagation::innerConstrainAcall(TR::Node *node)
&& constraint->getClassType()->asResolvedClass() )
{
newTypeConstraint = TR::VPResolvedClass::create(this, constraint->getClass());
if (trace())
traceMsg(comp(), "Object Clone: Resolved Class of node %p \n", node);
if (enableDynamicObjectClone
&& constraint->getClassType()->isArray() == TR_no
&& !_objectCloneCalls.find(_curTree))
{
if (trace())
traceMsg(comp(), "Object Clone: Resolved Class of node %p object clone\n", node);
_objectCloneCalls.add(_curTree);
_objectCloneTypes.add(new (trStackMemory()) OMR::ValuePropagation::ObjCloneInfo(constraint->getClass(), false));
}
// Currently enabled for X86 as the required codegen support is implemented on X86 only.
// Remove the condition as other platforms receive support.
else if (comp()->cg()->getSupportsDynamicANewArray()
&& constraint->getClassType()->isArray() == TR_yes
&& !_arrayCloneCalls.find(_curTree)
&& !comp()->generateArraylets())
if (!comp()->compileRelocatableCode()
&& comp()->getOSRMode() != TR::involuntaryOSR)
{
if (trace())
traceMsg(comp(), "Object Clone: Resolved Class of node %p array clone\n", node);
_arrayCloneCalls.add(_curTree);
_arrayCloneTypes.add(new (trStackMemory()) OMR::ValuePropagation::ArrayCloneInfo(constraint->getClass(), false));
traceMsg(comp(), "Object Clone: Resolved Class of node %p \n", node);
if (enableDynamicObjectClone
&& constraint->getClassType()->isArray() == TR_no
&& !_objectCloneCalls.find(_curTree))
{
if (trace())
traceMsg(comp(), "Object Clone: Resolved Class of node %p object clone\n", node);
_objectCloneCalls.add(_curTree);
_objectCloneTypes.add(new (trStackMemory()) OMR::ValuePropagation::ObjCloneInfo(constraint->getClass(), false));
}
// Currently enabled for X86 as the required codegen support is implemented on X86 only.
// Remove the condition as other platforms receive support.
else if (comp()->cg()->getSupportsDynamicANewArray()
&& constraint->getClassType()->isArray() == TR_yes
&& !_arrayCloneCalls.find(_curTree)
&& !comp()->generateArraylets())
{
if (trace())
traceMsg(comp(), "Object Clone: Resolved Class of node %p array clone\n", node);
_arrayCloneCalls.add(_curTree);
_arrayCloneTypes.add(new (trStackMemory()) OMR::ValuePropagation::ArrayCloneInfo(constraint->getClass(), false));
}
}
}
#endif
Expand Down