Skip to content

Commit

Permalink
Update Offheap guard macro
Browse files Browse the repository at this point in the history
Replace all remaining instances of
J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION with
J9VM_GC_SPARSE_HEAP_ALLOCATION

Signed-off-by: midronij <[email protected]>
  • Loading branch information
midronij committed Nov 27, 2024
1 parent 395aab5 commit a17c4a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions runtime/compiler/optimizer/J9RecognizedCallTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ void J9::RecognizedCallTransformer::processUnsafeAtomicCall(TR::TreeTop* treetop
traceMsg(comp(), "Created isObjectNull test node n%dn, non-null object will fall through to Block_%d\n", isObjectNullNode->getGlobalIndex(), treetop->getEnclosingBlock()->getNumber());

// Test if object is array - offheap only
#if defined (J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
#if defined (J9VM_GC_SPARSE_HEAP_ALLOCATION)
if (TR::Compiler->om.isOffHeapAllocationEnabled() && comp()->target().is64Bit())
{
//generate array check treetop
Expand All @@ -714,7 +714,7 @@ void J9::RecognizedCallTransformer::processUnsafeAtomicCall(TR::TreeTop* treetop
if (enableTrace)
traceMsg(comp(), "Created isObjectArray test node n%dn, array will branch to array access block\n", isObjectArrayNode->getGlobalIndex());
}
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
#endif /* J9VM_GC_SPARSE_HEAP_ALLOCATION */

// Test if low tag is set
isNotLowTaggedNode = TR::Node::createif(TR::iflcmpne,
Expand Down Expand Up @@ -854,7 +854,7 @@ void J9::RecognizedCallTransformer::processUnsafeAtomicCall(TR::TreeTop* treetop
treetop->getEnclosingBlock()->split(treetop, cfg, fixupCommoning);

// Create another helper call for array access (offheap only)
#if defined (J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
#if defined (J9VM_GC_SPARSE_HEAP_ALLOCATION)
if (isObjectArrayTreeTop != NULL)
{
TR::TreeTop *arrayAccessTreeTop = treetop->duplicateTree();
Expand Down Expand Up @@ -895,7 +895,7 @@ void J9::RecognizedCallTransformer::processUnsafeAtomicCall(TR::TreeTop* treetop
if (enableTrace)
traceMsg(comp(), "Created array access helper block_%d that loads dataAddr pointer from array object address\n", arrayAccessBlock->getNumber());
}
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
#endif /* J9VM_GC_SPARSE_HEAP_ALLOCATION */

// Setup CFG edges
cfg->addEdge(unsafeCallRamStaticsTT->getEnclosingBlock(), returnBlock);
Expand Down
8 changes: 4 additions & 4 deletions runtime/compiler/optimizer/UnsafeFastPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ bool TR_UnsafeFastPath::tryTransformUnsafeAtomicCallInVarHandleAccessMethod(TR::
if (isVarHandleOperationMethodOnNonStaticField(callerMethod) &&
performTransformation(comp(), "%s transforming Unsafe.CAS [" POINTER_PRINTF_FORMAT "] into codegen inlineable\n", optDetailString(), node))
{
#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
#if defined(J9VM_GC_SPARSE_HEAP_ALLOCATION)
if (isUnsafeCallerAccessingArrayElement(callerMethod) && TR::Compiler->om.isOffHeapAllocationEnabled() && comp()->target().is64Bit())
{
TR::Node *object = node->getChild(1);
Expand All @@ -292,7 +292,7 @@ bool TR_UnsafeFastPath::tryTransformUnsafeAtomicCallInVarHandleAccessMethod(TR::
object->decReferenceCount();
baseAddr->incReferenceCount();
}
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
#endif /* J9VM_GC_SPARSE_HEAP_ALLOCATION */

node->setIsSafeForCGToFastPathUnsafeCall(true);
if (!isVarHandleOperationMethodOnArray(callerMethod))
Expand Down Expand Up @@ -346,10 +346,10 @@ bool TR_UnsafeFastPath::tryTransformUnsafeAtomicCallInVarHandleAccessMethod(TR::
TR::Node *baseAddr = object;

//load dataAddr only if offheap is enabled and object is array
#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
#if defined(J9VM_GC_SPARSE_HEAP_ALLOCATION)
if (isUnsafeCallerAccessingArrayElement(callerMethod) && TR::Compiler->om.isOffHeapAllocationEnabled() && comp()->target().is64Bit())
baseAddr = TR::TransformUtil::generateDataAddrLoadTrees(comp(), object);
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
#endif /* J9VM_GC_SPARSE_HEAP_ALLOCATION */

unsafeAddress = comp()->target().is32Bit() ? TR::Node::create(node, TR::aiadd, 2, baseAddr, TR::Node::create(node, TR::l2i, 1, offset)) :
TR::Node::create(node, TR::aladd, 2, baseAddr, offset);
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12770,7 +12770,7 @@ TR::Register *J9::Power::TreeEvaluator::setmemoryEvaluator(TR::Node *node, TR::C
TR::addDependency(conditions, temp2Reg, TR::RealRegister::NoReg, TR_GPR, cg);


#if defined (J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
#if defined (J9VM_GC_SPARSE_HEAP_ALLOCATION)

if (arrayCheckNeeded) // CASE (3)
{
Expand Down Expand Up @@ -12833,7 +12833,7 @@ TR::Register *J9::Power::TreeEvaluator::setmemoryEvaluator(TR::Node *node, TR::C
generateTrg1Src2Instruction(cg, TR::InstOpCode::add, node, dstAddrReg, dstBaseAddrReg, dstOffsetReg);
}

#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
#endif /* J9VM_GC_SPARSE_HEAP_ALLOCATION */

// assemble the double word value from byte value
if (cg->comp()->target().cpu.isAtLeast(OMR_PROCESSOR_PPC_P8))
Expand Down

0 comments on commit a17c4a3

Please sign in to comment.