diff --git a/runtime/gc_vlhgc/CopyForwardScheme.cpp b/runtime/gc_vlhgc/CopyForwardScheme.cpp index 4fe9d1a8a24..fa5da4fd18b 100644 --- a/runtime/gc_vlhgc/CopyForwardScheme.cpp +++ b/runtime/gc_vlhgc/CopyForwardScheme.cpp @@ -2285,14 +2285,15 @@ MM_CopyForwardScheme::updateMarkMapAndCardTableOnCopy(MM_EnvironmentVLHGC *env, MMINLINE void MM_CopyForwardScheme::scanOwnableSynchronizerObjectSlots(MM_EnvironmentVLHGC *env, MM_AllocationContextTarok *reservingContext, J9Object *objectPtr, ScanReason reason) { - if (SCAN_REASON_COPYSCANCACHE == reason) { - addOwnableSynchronizerObjectInList(env, objectPtr); - } else if (SCAN_REASON_PACKET == reason) { - if (isObjectInEvacuateMemoryNoCheck(objectPtr)) { + if (scanMixedObjectSlots(env, reservingContext, objectPtr, reason)) { + if (SCAN_REASON_COPYSCANCACHE == reason) { addOwnableSynchronizerObjectInList(env, objectPtr); + } else if (SCAN_REASON_PACKET == reason) { + if (isObjectInEvacuateMemoryNoCheck(objectPtr)) { + addOwnableSynchronizerObjectInList(env, objectPtr); + } } } - scanMixedObjectSlots(env, reservingContext, objectPtr, reason); } void @@ -2416,7 +2417,7 @@ MM_CopyForwardScheme::iterateAndCopyforwardSlotReference(MM_EnvironmentVLHGC *en return success; } -void +bool MM_CopyForwardScheme::scanMixedObjectSlots(MM_EnvironmentVLHGC *env, MM_AllocationContextTarok *reservingContext, J9Object *objectPtr, ScanReason reason) { if (_tracingEnabled) { @@ -2432,6 +2433,7 @@ MM_CopyForwardScheme::scanMixedObjectSlots(MM_EnvironmentVLHGC *env, MM_Allocati } updateScanStats(env, objectPtr, reason); + return success; } void diff --git a/runtime/gc_vlhgc/CopyForwardScheme.hpp b/runtime/gc_vlhgc/CopyForwardScheme.hpp index 870aaca0a94..afd2a0d3200 100644 --- a/runtime/gc_vlhgc/CopyForwardScheme.hpp +++ b/runtime/gc_vlhgc/CopyForwardScheme.hpp @@ -318,8 +318,9 @@ class MM_CopyForwardScheme : public MM_BaseNonVirtual * @param reservingContext[in] The context to which we would prefer to copy any objects discovered in this method * @param objectPtr current object being scanned. * @param reason to scan (dirty card, packet, scan cache, overflow) + * @return true if all slots have been copied successfully */ - void scanMixedObjectSlots(MM_EnvironmentVLHGC *env, MM_AllocationContextTarok *reservingContext, J9Object *objectPtr, ScanReason reason); + bool scanMixedObjectSlots(MM_EnvironmentVLHGC *env, MM_AllocationContextTarok *reservingContext, J9Object *objectPtr, ScanReason reason); /** * Scan the slots of a reference mixed object. * Copy and forward all relevant slots values found in the object.