Skip to content

Commit

Permalink
Do not add Own.Sync. object to the list if scan wasn't successfull
Browse files Browse the repository at this point in the history
If Ownable Synchronizer object scan has not been successful (caused Copy
Forward abort) it should not be aadded to the list right away. This
object is remembered in the work packet and is going to be rescanned for
the second time.

Relates eclipse-openj9#20395

Signed-off-by: Dmitri Pivkine <[email protected]>
  • Loading branch information
dmitripivkine committed Nov 13, 2024
1 parent 9e312f1 commit 966663b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions runtime/gc_vlhgc/CopyForwardScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -2432,6 +2433,7 @@ MM_CopyForwardScheme::scanMixedObjectSlots(MM_EnvironmentVLHGC *env, MM_Allocati
}

updateScanStats(env, objectPtr, reason);
return success;
}

void
Expand Down
3 changes: 2 additions & 1 deletion runtime/gc_vlhgc/CopyForwardScheme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 966663b

Please sign in to comment.