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

Update uses of checkArrayCompClassPrimitiveValueType #7477

Merged
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
25 changes: 16 additions & 9 deletions compiler/optimizer/ValuePropagationCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3865,11 +3865,14 @@ slowBlock-> n39n BBStart <block_10> (freq 0) (cold)
TR::TreeTop *ifDstTree = NULL;
if (needTestDstArray)
{
// Create the test node to check if the destination array component type is primitive VT (null restricted value type).
TR::Node *ifNode = comp()->fej9()->checkArrayCompClassPrimitiveValueType(dstArrayRefNode, TR::ificmpne);
// If the destination array component type is primitive VT (null restricted value type),
// jump to the slow path (slowBlock)
ifNode->setBranchDestination(slowBlock->getEntry());
// If the destination array type is null restricted, jump to the slow path (slowBlock)
//
TR::SymbolReference* const vftSymRef = comp()->getSymRefTab()->findOrCreateVftSymbolRef();
TR::Node *vftNode = TR::Node::createWithSymRef(TR::aloadi, 1, 1, dstArrayRefNode, vftSymRef);

TR::Node *testIsNullRestrictedArray = comp()->fej9()->testIsArrayClassNullRestrictedType(vftNode);

TR::Node *ifNode = TR::Node::createif(TR::ificmpne, testIsNullRestrictedArray, TR::Node::iconst(0), slowBlock->getEntry());

ifDstTree = TR::TreeTop::create(comp(), ifNode);
prevTT->insertAfter(ifDstTree);
Expand All @@ -3883,10 +3886,14 @@ slowBlock-> n39n BBStart <block_10> (freq 0) (cold)
// can't handle copying between flattened and non-flattened arrays.
if (needTestSrcArray)
{
// If the source array component type is primitive VT (null restricted value type),
// jump to the slow path (slowBlock)
TR::Node *ifNode = comp()->fej9()->checkArrayCompClassPrimitiveValueType(srcArrayRefNode, TR::ificmpne);
ifNode->setBranchDestination(slowBlock->getEntry());
// If the destination array type is null restricted, jump to the slow path (slowBlock)
//
TR::SymbolReference* const vftSymRef = comp()->getSymRefTab()->findOrCreateVftSymbolRef();
TR::Node *vftNode = TR::Node::createWithSymRef(TR::aloadi, 1, 1, srcArrayRefNode, vftSymRef);

TR::Node *testIsNullRestrictedArray = comp()->fej9()->testIsArrayClassNullRestrictedType(vftNode);

TR::Node *ifNode = TR::Node::createif(TR::ificmpne, testIsNullRestrictedArray, TR::Node::iconst(0), slowBlock->getEntry());

TR::TreeTop *ifSrcTree = TR::TreeTop::create(comp(), ifNode);

Expand Down