Skip to content

Commit

Permalink
Add not dataAddrPtr assert in arraycopyEval for dstObj
Browse files Browse the repository at this point in the history
Signed-off-by: Abdulrahman Alattas <[email protected]>
  • Loading branch information
rmnattas committed Oct 24, 2024
1 parent 03bf478 commit 117ed0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/aarch64/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7456,6 +7456,11 @@ OMR::ARM64::TreeEvaluator::arraycopyEvaluator(TR::Node *node, TR::CodeGenerator
srcAddrNode = node->getChild(2);
dstAddrNode = node->getChild(3);
lengthNode = node->getChild(4);
#if defined(OMR_GC_SPARSE_HEAP_ALLOCATION)
if (TR::Compiler->om.isOffHeapAllocationEnabled())
// For correct card-marking calculation, the dstObjNode should be the baseObj not the dataAddrPointer
TR_ASSERT_FATAL(!dstObjNode->isDataAddrPointer(), "The dstObjNode child of arraycopy cannot be a dataAddrPointer");
#endif /* defined(OMR_GC_SPARSE_HEAP_ALLOCATION) */
}

stopUsingCopyReg1 = stopUsingCopyReg(srcObjNode, srcObjReg, cg);
Expand Down
5 changes: 5 additions & 0 deletions compiler/p/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6323,6 +6323,11 @@ TR::Register *OMR::Power::TreeEvaluator::arraycopyEvaluator(TR::Node *node, TR::
srcAddrNode = node->getChild(2);
dstAddrNode = node->getChild(3);
lengthNode = node->getChild(4);
#if defined(OMR_GC_SPARSE_HEAP_ALLOCATION)
if (TR::Compiler->om.isOffHeapAllocationEnabled())
// For correct card-marking calculation, the dstObjNode should be the baseObj not the dataAddrPointer
TR_ASSERT_FATAL(!dstObjNode->isDataAddrPointer(), "The dstObjNode child of arraycopy cannot be a dataAddrPointer");
#endif /* defined(OMR_GC_SPARSE_HEAP_ALLOCATION) */
}

stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyReg(srcObjNode, srcObjReg, cg);
Expand Down

0 comments on commit 117ed0e

Please sign in to comment.