Skip to content

Commit

Permalink
Merge pull request #18379 from LinHu2016/Loom_GC_update_21
Browse files Browse the repository at this point in the history
Fix JNI Local Reference reporting issue
  • Loading branch information
amicic committed Nov 1, 2023
2 parents 0ee3f98 + 479e4f7 commit ca9cc47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions runtime/gc_base/ReferenceChainWalker.cpp
Expand Up @@ -644,9 +644,12 @@ MM_ReferenceChainWalker::doStackSlot(J9Object **slotPtr, void *walkState, const
J9Object *slotValue = *slotPtr;

/* Only report heap objects */

if (isHeapObject(slotValue) && !_heap->objectIsInGap(slotValue)) {
doSlot(slotPtr, J9GC_ROOT_TYPE_STACK_SLOT, -1, (J9Object *)walkState);
if (J9_STACKWALK_SLOT_TYPE_JNI_LOCAL == ((J9StackWalkState *)walkState)->slotType) {
doSlot(slotPtr, J9GC_ROOT_TYPE_JNI_LOCAL, -1, (J9Object *)walkState);
} else {
doSlot(slotPtr, J9GC_ROOT_TYPE_STACK_SLOT, -1, (J9Object *)walkState);
}
}
}

Expand Down

0 comments on commit ca9cc47

Please sign in to comment.