diff --git a/runtime/gc_base/ReferenceChainWalker.cpp b/runtime/gc_base/ReferenceChainWalker.cpp index 227b2d77d42..9367ed2d8eb 100644 --- a/runtime/gc_base/ReferenceChainWalker.cpp +++ b/runtime/gc_base/ReferenceChainWalker.cpp @@ -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; @@ -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 */ diff --git a/runtime/gc_base/ReferenceChainWalker.hpp b/runtime/gc_base/ReferenceChainWalker.hpp index e2bbe64a1f8..6a9e2fece0f 100644 --- a/runtime/gc_base/ReferenceChainWalker.hpp +++ b/runtime/gc_base/ReferenceChainWalker.hpp @@ -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);