Skip to content

Commit

Permalink
(0.29.1) AArch64: Load heap size from vmstruct on AOT compilation
Browse files Browse the repository at this point in the history
The write barrier instruction sequence uses the heap size for checking
if the object is in the heap.
The heap size must be loaded from vmstruct on AOT compilation
even if the size is constant.

Original PR in the master branch: #13927

Signed-off-by: KONNO Kazuhiro <[email protected]>
  • Loading branch information
knn-k committed Nov 19, 2021
1 parent d9ff2ac commit a13784e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/compiler/aarch64/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ VMnonNullSrcWrtBarCardCheckEvaluator(
}
generateTrg1Src2Instruction(cg, TR::InstOpCode::subx, node, temp1Reg, dstReg, temp1Reg);

if (comp->getOptions()->isVariableHeapSizeForBarrierRange0())
if (comp->getOptions()->isVariableHeapSizeForBarrierRange0() || comp->compileRelocatableCode())
{
generateTrg1MemInstruction(cg, TR::InstOpCode::ldrimmx, node, temp2Reg, new (cg->trHeapMemory()) TR::MemoryReference(metaReg, offsetof(J9VMThread, heapSizeForBarrierRange0), cg));
}
Expand Down Expand Up @@ -463,7 +463,7 @@ VMnonNullSrcWrtBarCardCheckEvaluator(
// If doCrdMrk is false, then temp2Reg still contains heapSize
if (doCrdMrk)
{
if (comp->getOptions()->isVariableHeapSizeForBarrierRange0())
if (comp->getOptions()->isVariableHeapSizeForBarrierRange0() || comp->compileRelocatableCode())
{
generateTrg1MemInstruction(cg, TR::InstOpCode::ldrimmx, node, temp2Reg, new (cg->trHeapMemory()) TR::MemoryReference(metaReg, offsetof(J9VMThread, heapSizeForBarrierRange0), cg));
}
Expand Down Expand Up @@ -577,7 +577,7 @@ VMCardCheckEvaluator(
// If we know the object is definitely in heap, then we skip the check.
if (!node->isHeapObjectWrtBar())
{
if (comp->getOptions()->isVariableHeapSizeForBarrierRange0())
if (comp->getOptions()->isVariableHeapSizeForBarrierRange0() || comp->compileRelocatableCode())
{
generateTrg1MemInstruction(cg, TR::InstOpCode::ldrimmx, node, temp2Reg, new (cg->trHeapMemory()) TR::MemoryReference(metaReg, offsetof(J9VMThread, heapSizeForBarrierRange0), cg));
}
Expand Down

0 comments on commit a13784e

Please sign in to comment.