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

Handling potential overwriting in Concurrent scavenger back out case #6686

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion gc/base/MarkingScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ MM_MarkingScheme::createWorkPackets(MM_EnvironmentBase *env)
return workPackets;
}

void
bool
MM_MarkingScheme::fixupForwardedSlot(omrobjectptr_t *slotPtr) {
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
bool const compressed = _extensions->compressObjectReferences();
Expand All @@ -423,10 +423,12 @@ MM_MarkingScheme::fixupForwardedSlot(omrobjectptr_t *slotPtr) {
forwardHeader.restoreSelfForwardedPointer();
} else {
*slotPtr = forwardPtr;
return true;
}
}
}
#endif /* OMR_GC_CONCURRENT_SCAVENGER */
return false;
}

uintptr_t
Expand Down
7 changes: 4 additions & 3 deletions gc/base/MarkingScheme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,13 @@ class MM_MarkingScheme : public MM_BaseVirtual
MMINLINE void fixupForwardedSlot(GC_SlotObject *slotObject) {
if (_extensions->isConcurrentScavengerEnabled() && _extensions->isScavengerBackOutFlagRaised()) {
omrobjectptr_t slot = slotObject->readReferenceFromSlot();
fixupForwardedSlot(&slot);
slotObject->writeReferenceToSlot(slot);
if (fixupForwardedSlot(&slot)) {
slotObject->writeReferenceToSlot(slot);
}
}
}

void fixupForwardedSlot(omrobjectptr_t *slotPtr);
bool fixupForwardedSlot(omrobjectptr_t *slotPtr);
virtual uintptr_t setupIndexableScanner(MM_EnvironmentBase *env, omrobjectptr_t objectPtr, MM_MarkingSchemeScanReason reason, uintptr_t *sizeToDo, uintptr_t *sizeInElementsToDo, fomrobject_t **basePtr, uintptr_t *flags);

/**
Expand Down