Skip to content

Commit

Permalink
Merge pull request #14071 from jdmpapin/vp-clone-fsd
Browse files Browse the repository at this point in the history
Prevent VP Object.clone transformation under involuntary OSR
  • Loading branch information
0xdaryl committed Dec 7, 2021
2 parents 3022420 + 872dee1 commit 2b04806
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions runtime/compiler/optimizer/J9ValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,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 @@ -2410,28 +2411,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

0 comments on commit 2b04806

Please sign in to comment.