Skip to content

Commit

Permalink
Merge pull request #9968 from Akira1Saitoh/aarch64LinkRegister021
Browse files Browse the repository at this point in the history
(0.21.0) AArch64: Set link register killed when ARM64HelperCallSnippet is used
  • Loading branch information
knn-k authored Jun 22, 2020
2 parents c7ac534 + a80e189 commit a922907
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/compiler/aarch64/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ J9::ARM64::TreeEvaluator::conditionalHelperEvaluator(TR::Node *node, TR::CodeGen
TR::Instruction *gcPoint = generateConditionalBranchInstruction(cg, TR::InstOpCode::b_cond, node, snippetLabel, cc, conditions);
gcPoint->ARM64NeedsGCMap(cg, 0xFFFFFFFF);
snippet->gcMap().setGCRegisterMask(0xffffffff);
// ARM64HelperCallSnippet generates "bl" instruction
cg->machine()->setLinkRegisterKilled(true);

for (i = numArgs - 1; i >= 0; i--)
cg->decReferenceCount(callNode->getChild(i));
Expand Down Expand Up @@ -567,6 +569,8 @@ J9::ARM64::TreeEvaluator::DIVCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg)

cg->evaluate(node->getFirstChild());
cg->decReferenceCount(node->getFirstChild());
// ARM64HelperCallSnippet generates "bl" instruction
cg->machine()->setLinkRegisterKilled(true);
return NULL;
}

Expand Down Expand Up @@ -1625,7 +1629,8 @@ J9::ARM64::TreeEvaluator::ZEROCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg
gcPoint->ARM64NeedsGCMap(cg, 0xFFFFFFFF);
snippet->gcMap().setGCRegisterMask(0xffffffff);
cg->decReferenceCount(node->getFirstChild());

// ARM64HelperCallSnippet generates "bl" instruction
cg->machine()->setLinkRegisterKilled(true);
return NULL;
}

Expand Down Expand Up @@ -1689,6 +1694,8 @@ J9::ARM64::TreeEvaluator::BNDCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg)
cg->decReferenceCount(firstChild);
cg->decReferenceCount(secondChild);
secondChild->setIsNonNegative(true);
// ARM64HelperCallSnippet generates "bl" instruction
cg->machine()->setLinkRegisterKilled(true);
return (NULL);
}

Expand Down Expand Up @@ -2176,6 +2183,8 @@ J9::ARM64::TreeEvaluator::evaluateNULLCHKWithPossibleResolve(TR::Node *node, boo
TR::Instruction *cbzInstruction = generateCompareBranchInstruction(cg, TR::InstOpCode::cbzx, node, referenceReg, snippetLabel);
cbzInstruction->setNeedsGCMap(0xffffffff);
snippet->gcMap().setGCRegisterMask(0xffffffff);
// ARM64HelperCallSnippet generates "bl" instruction
cg->machine()->setLinkRegisterKilled(true);

if (comp->useCompressedPointers()
&& reference->getOpCodeValue() == TR::l2a)
Expand Down

0 comments on commit a922907

Please sign in to comment.