Skip to content

Commit

Permalink
Merge pull request #18214 from LinHu2016/Loom_GC_update_21
Browse files Browse the repository at this point in the history
Support tracing reference on continuation java frames for jvmti
  • Loading branch information
dmitripivkine authored Oct 4, 2023
2 parents c9b2519 + 56a0a9c commit acbce13
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
42 changes: 41 additions & 1 deletion runtime/gc_base/ReferenceChainWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,13 @@ MM_ReferenceChainWalker::scanObject(J9Object *objectPtr)
case GC_ObjectModel::SCAN_ATOMIC_MARKABLE_REFERENCE_OBJECT:
case GC_ObjectModel::SCAN_MIXED_OBJECT:
case GC_ObjectModel::SCAN_OWNABLESYNCHRONIZER_OBJECT:
case GC_ObjectModel::SCAN_CONTINUATION_OBJECT:
case GC_ObjectModel::SCAN_CLASS_OBJECT:
case GC_ObjectModel::SCAN_CLASSLOADER_OBJECT:
scanMixedObject(objectPtr);
break;
case GC_ObjectModel::SCAN_CONTINUATION_OBJECT:
scanContinuationObject(objectPtr);
break;
case GC_ObjectModel::SCAN_POINTER_ARRAY_OBJECT:
scanPointerArrayObject((J9IndexableObject *)objectPtr);
break;
Expand All @@ -375,6 +377,44 @@ MM_ReferenceChainWalker::scanObject(J9Object *objectPtr)
}
}

/**
* @todo Provide function documentation
*/
void
stackSlotIteratorForReferenceChainWalker(J9JavaVM *javaVM, J9Object **slot, void *localData, J9StackWalkState *walkState, const void *stackLocation)
{
StackIteratorData *data = (StackIteratorData *)localData;
data->rootScanner->doStackSlot(slot, walkState, stackLocation);
}

/**
* @todo Provide function documentation
*/
MMINLINE void
MM_ReferenceChainWalker::scanContinuationNativeSlots(J9Object *objectPtr)
{
J9VMThread *currentThread = (J9VMThread *)_env->getLanguageVMThread();
const bool isConcurrentGC = false;
const bool isGlobalGC = false;
const bool beingMounted = false;
if (MM_GCExtensions::needScanStacksForContinuationObject(currentThread, objectPtr, isConcurrentGC, isGlobalGC, beingMounted)) {
StackIteratorData localData;
localData.rootScanner = this;

GC_VMThreadStackSlotIterator::scanContinuationSlots(currentThread, objectPtr, (void *)&localData, stackSlotIteratorForReferenceChainWalker, false, false);
}
}

/**
* @todo Provide function documentation
*/
void
MM_ReferenceChainWalker::scanContinuationObject(J9Object *objectPtr)
{
scanContinuationNativeSlots(objectPtr);
scanMixedObject(objectPtr);
}

/**
* @todo Provide function documentation
*/
Expand Down
3 changes: 3 additions & 0 deletions runtime/gc_base/ReferenceChainWalker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class MM_ReferenceChainWalker : public MM_RootScanner
virtual void scanMixedObject(J9Object *objectPtr);
virtual void scanPointerArrayObject(J9IndexableObject *objectPtr);
virtual void scanReferenceMixedObject(J9Object *objectPtr);

MMINLINE void scanContinuationNativeSlots(J9Object *objectPtr);
MMINLINE void scanContinuationObject(J9Object *objectPtr);

virtual void doClassLoader(J9ClassLoader *classLoader);

Expand Down

0 comments on commit acbce13

Please sign in to comment.