Skip to content

Commit

Permalink
Merge pull request #19926 from zl-wang/master
Browse files Browse the repository at this point in the history
Change to use isOffheapAllocationEnabled query
  • Loading branch information
r30shah authored Jul 29, 2024
2 parents d98e1e5 + 8e7895f commit c5b3b09
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion runtime/compiler/aarch64/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3458,7 +3458,7 @@ J9::ARM64::TreeEvaluator::VMnewEvaluator(TR::Node *node, TR::CodeGenerator *cg)
genInitArrayHeader(node, cg, clazz, resultReg, classReg, lengthReg, zeroReg, tempReg1, isBatchClearTLHEnabled, tlhHasNotBeenCleared);

#ifdef J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION
if (TR::Compiler->om.isIndexableDataAddrPresent())
if (TR::Compiler->om.isOffHeapAllocationEnabled())
{
/* Here we'll update dataAddr slot for both fixed and variable length arrays. Fixed length arrays are
* simple as we just need to check first child of the node for array size. For variable length arrays,
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/env/VMJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4084,7 +4084,7 @@ TR_J9VMBase::initializeLocalArrayHeader(TR::Compilation * comp, TR::Node * alloc
prevTree = TR::TreeTop::create(comp, prevTree, node);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (TR::Compiler->om.isIndexableDataAddrPresent())
if (TR::Compiler->om.isOffHeapAllocationEnabled())
{
// -----------------------------------------------------------------------------------
// Initialize data address field
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6483,7 +6483,7 @@ TR::Register *J9::Power::TreeEvaluator::VMnewEvaluator(TR::Node *node, TR::CodeG
tmp5Reg, tmp4Reg, conditions, needZeroInit, cg);

#ifdef J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION
if (TR::Compiler->om.isIndexableDataAddrPresent())
if (TR::Compiler->om.isOffHeapAllocationEnabled())
{
/* Here we'll update dataAddr slot for both fixed and variable length arrays. Fixed length arrays are
* simple as we just need to check first child of the node for array size. For variable length arrays,
Expand Down
14 changes: 7 additions & 7 deletions runtime/compiler/x/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,8 +1500,8 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
TR::LabelSymbol *loopLabel = generateLabelSymbol(cg);
TR::LabelSymbol *nonZeroFirstDimLabel = generateLabelSymbol(cg);
#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
bool isIndexableDataAddrPresent = TR::Compiler->om.isIndexableDataAddrPresent();
TR::LabelSymbol *populateFirstDimDataAddrSlot = isIndexableDataAddrPresent ? generateLabelSymbol(cg) : NULL;
bool isOffHeapAllocationEnabled = TR::Compiler->om.isOffHeapAllocationEnabled();
TR::LabelSymbol *populateFirstDimDataAddrSlot = isOffHeapAllocationEnabled? generateLabelSymbol(cg) : NULL;
#endif /* defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION) */

startLabel->setStartInternalControlFlow();
Expand Down Expand Up @@ -1558,7 +1558,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateMemImmInstruction(TR::InstOpCode::S4MemImm4, node, generateX86MemoryReference(targetReg, fej9->getOffsetOfDiscontiguousArraySizeField(), cg), 0, cg);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
// Load dataAddr slot offset difference since 0 size arrays are treated as discontiguous.
TR_ASSERT_FATAL_WITH_NODE(node,
Expand Down Expand Up @@ -1651,7 +1651,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateMemImmInstruction(TR::InstOpCode::S4MemImm4, node, generateX86MemoryReference(temp2Reg, fej9->getOffsetOfDiscontiguousArraySizeField(), cg), 0, cg);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
// Populate dataAddr slot for 2nd dimension zero size array.
generateRegMemInstruction(TR::InstOpCode::LEARegMem(),
Expand Down Expand Up @@ -1691,7 +1691,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateLabelInstruction(TR::InstOpCode::JA4, node, loopLabel, cg);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
// No offset is needed since 1st dimension array is contiguous.
generateRegRegInstruction(TR::InstOpCode::XOR4RegReg, node, temp3Reg, temp3Reg, cg);
Expand Down Expand Up @@ -1749,7 +1749,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateLabelInstruction(TR::InstOpCode::JMP4, node, oolFailLabel, cg);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
/* Populate dataAddr slot of 1st dimension array. Arrays of non-zero size
* use contiguous header layout while zero size arrays use discontiguous header layout.
Expand Down Expand Up @@ -8119,7 +8119,7 @@ J9::X86::TreeEvaluator::VMnewEvaluator(
}

#ifdef J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION
if (isArrayNew && TR::Compiler->om.isIndexableDataAddrPresent())
if (isArrayNew && TR::Compiler->om.isOffHeapAllocationEnabled())
{
handleOffHeapDataForArrays(node, sizeReg, targetReg, tempReg, srm, cg);
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/compiler/z/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4770,8 +4770,8 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
TR::LabelSymbol *oolFailLabel = generateLabelSymbol(cg);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
bool isIndexableDataAddrPresent = TR::Compiler->om.isIndexableDataAddrPresent();
TR::LabelSymbol *populateFirstDimDataAddrSlot = isIndexableDataAddrPresent ? generateLabelSymbol(cg) : NULL;
bool isOffHeapAllocationEnabled = TR::Compiler->om.isOffHeapAllocationEnabled();
TR::LabelSymbol *populateFirstDimDataAddrSlot = isOffHeapAllocationEnabled ? generateLabelSymbol(cg) : NULL;
#endif /* defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION) */

// oolJumpLabel is a common point that all branches will jump to. From this label, we branch to OOL code.
Expand Down Expand Up @@ -4851,7 +4851,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
}

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
TR_ASSERT_FATAL_WITH_NODE(node,
(TR::Compiler->om.compressObjectReferences()
Expand Down Expand Up @@ -4961,7 +4961,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
TR::Register *temp3Reg = cg->allocateRegister();

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
// Populate dataAddr slot for 2nd dimension zero size array.
generateRXInstruction(cg,
Expand Down Expand Up @@ -5001,7 +5001,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateS390CompareAndBranchInstruction(cg, TR::InstOpCode::CL, node, firstDimLenReg, 0, TR::InstOpCode::COND_BNE, loopLabel, false);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
// No offset is needed since 1st dimension array is contiguous.
generateRRInstruction(cg, TR::InstOpCode::getXORRegOpCode(), node, temp1Reg, temp1Reg);
Expand Down Expand Up @@ -5029,7 +5029,7 @@ static TR::Register * generateMultianewArrayWithInlineAllocators(TR::Node *node,
generateS390BranchInstruction(cg, TR::InstOpCode::BRC, TR::InstOpCode::COND_BRC, node, oolFailLabel);

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
if (isIndexableDataAddrPresent)
if (isOffHeapAllocationEnabled)
{
/* Populate dataAddr slot of 1st dimension array. Arrays of non-zero size
* use contiguous header layout while zero size arrays use discontiguous header layout.
Expand Down Expand Up @@ -11015,7 +11015,7 @@ J9::Z::TreeEvaluator::VMnewEvaluator(TR::Node * node, TR::CodeGenerator * cg)
resReg, enumReg, dataSizeReg, litPoolBaseReg, conditions, cg);

#ifdef J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION
if (TR::Compiler->om.isIndexableDataAddrPresent())
if (TR::Compiler->om.isOffHeapAllocationEnabled())
{
/* Here we'll update dataAddr slot for both fixed and variable length arrays. Fixed length arrays are
* simple as we just need to check first child of the node for array size. For variable length arrays
Expand Down

0 comments on commit c5b3b09

Please sign in to comment.