Skip to content

Commit d3a05c0

Browse files
committed
Fix calculareOffsetFromIndex for OffHeap
1 parent 91b5703 commit d3a05c0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

runtime/compiler/optimizer/J9TransformUtil.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,17 @@ TR::Node * J9::TransformUtil::calculateOffsetFromIndexInContiguousArrayWithEleme
21882188
shift = checkNonNegativePowerOfTwo(elementStride);
21892189
}
21902190

2191-
int32_t headerSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes();
2191+
int32_t headerSize;
2192+
#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
2193+
if (TR::Compiler->om.isOffHeapAllocationEnabled())
2194+
{
2195+
headerSize = 0;
2196+
}
2197+
else
2198+
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
2199+
{
2200+
headerSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes();
2201+
}
21922202

21932203
TR::Node * offset = index;
21942204

0 commit comments

Comments
 (0)