Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add Own.Sync. object to the list if scan wasn't successfull #20589

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions runtime/gc_vlhgc/CopyForwardScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2285,14 +2285,21 @@ 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 object has been scanned without triggering abort add it to the list here.
* If object scan triggered abort, it has been added to work packet
* and is going to be rescanned again. It should not be added to the list here
* to prevent duplication during second scan.
*/
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 +2423,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 +2439,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