Skip to content

Commit

Permalink
Merge pull request #7275 from r30shah/fixArrayCopyGS
Browse files Browse the repository at this point in the history
Evaluate constant byteLenNode of arrayCopyChild
  • Loading branch information
hzongaro authored Mar 1, 2024
2 parents bf5fa84 + 2499368 commit 53e909c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions compiler/z/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13497,6 +13497,7 @@ OMR::Z::TreeEvaluator::primitiveArraycopyEvaluator(TR::Node* node, TR::CodeGener
// We need to decide direction of array copy at runtime.
if (isConstantByteLen)
{
byteLenReg = cg->gprClobberEvaluate(byteLenNode);
generateS390LabelInstruction(cg, TR::InstOpCode::label, node, cFlowRegionStart);
cFlowRegionStart->setStartInternalControlFlow();
}
Expand All @@ -13506,12 +13507,6 @@ OMR::Z::TreeEvaluator::primitiveArraycopyEvaluator(TR::Node* node, TR::CodeGener


TR::Register *checkBoundReg = srm->findOrCreateScratchRegister();
if (byteLenReg == NULL)
{
TR_ASSERT_FATAL(isConstantByteLen, "byteLenNode can be not evaluated only when we have constant length");
byteLenReg = cg->allocateRegister();
genLoadLongConstant(cg, node, byteLenNode->getConst<int64_t>(), byteLenReg);
}
cursor = generateRXInstruction(cg, TR::InstOpCode::LA, node, checkBoundReg, generateS390MemoryReference(byteSrcReg, byteLenReg, 0, cg));
iComment("nextPointerToLastElement=byteSrcPointer+lengthInBytes");

Expand Down

0 comments on commit 53e909c

Please sign in to comment.