Skip to content

Commit 625b3f0

Browse files
committed
Generate checks for all callers in OffHeap when inlining Unsafe.CAS
When inlining `Unsafe.compareAndSwap` (`compareAndSet`) while using OffHeap ignore the special callers cases which skips generating checks for inlining. The special callers require OffHeap array checks but no low-tag checks, the different treatment of that will be coded into `createUnsafeCASCallDiamond` later on. Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
1 parent 32046b3 commit 625b3f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

runtime/compiler/optimizer/InlinerTempForJ9.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2620,6 +2620,10 @@ TR_J9InlinerPolicy::inlineUnsafeCall(TR::ResolvedMethodSymbol *calleeSymbol, TR:
26202620
case TR::sun_misc_Unsafe_compareAndSwapObject_jlObjectJjlObjectjlObject_Z:
26212621
if (callNode->isSafeForCGToFastPathUnsafeCall())
26222622
return false;
2623+
#if defined (J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
2624+
if(TR::Compiler->om.isOffHeapAllocationEnabled())
2625+
return createUnsafeCASCallDiamond(callNodeTreeTop, callNode);
2626+
#endif /* J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION */
26232627
switch (callerSymbol->castToMethodSymbol()->getRecognizedMethod())
26242628
{
26252629
case TR::java_util_concurrent_ConcurrentHashMap_addCount:

0 commit comments

Comments
 (0)