Skip to content

Commit

Permalink
Merge pull request eclipse-omr#3976 from amicic/remove_expensive_CS_a…
Browse files Browse the repository at this point in the history
…ssert

Remove expensive CS assert
  • Loading branch information
charliegracie authored Jun 11, 2019
2 parents d997904 + 60d614a commit 3f0485e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
18 changes: 0 additions & 18 deletions gc/base/MarkingScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "omrcfg.h"
#include "omr.h"
#include "ModronAssertions.h"
#include "GlobalCollector.hpp"

#include <string.h>
Expand Down Expand Up @@ -411,23 +410,6 @@ MM_MarkingScheme::createWorkPackets(MM_EnvironmentBase *env)
return workPackets;
}

void
MM_MarkingScheme::assertNotForwardedPointer(MM_EnvironmentBase *env, omrobjectptr_t objectPtr)
{
/* This is an expensive assert - fetching class slot during marking operation, thus invalidating benefits of leaf optimization.
* TODO: after some soaking remove it!
*/
if (_extensions->isConcurrentScavengerEnabled()) {
MM_ForwardedHeader forwardHeader(objectPtr);
omrobjectptr_t forwardPtr = forwardHeader.getNonStrictForwardedObject();
/* It is ok to encounter a forwarded object during overlapped concurrent scavenger/marking (or even root scanning),
* but we must do nothing about it (if in backout, STW global phase will recover them).
*/
Assert_GC_true_with_message3(env, ((NULL == forwardPtr) || (!_extensions->getGlobalCollector()->isStwCollectionInProgress() && _extensions->isConcurrentScavengerInProgress())),
"Encountered object %p forwarded to %p (header %p) while Concurrent Scavenger/Marking not in progress\n", objectPtr, forwardPtr, &forwardHeader);
}
}

void
MM_MarkingScheme::fixupForwardedSlotOutline(GC_SlotObject *slotObject) {
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
Expand Down
4 changes: 0 additions & 4 deletions gc/base/MarkingScheme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ class MM_MarkingScheme : public MM_BaseVirtual
Assert_GC_true_with_message(env, objectPtr != J9_INVALID_OBJECT, "Invalid object pointer %p\n", objectPtr);
Assert_MM_objectAligned(env, objectPtr);
Assert_GC_true_with_message3(env, isHeapObject(objectPtr), "Object %p not in heap range [%p,%p)\n", objectPtr, _heapBase, _heapTop);

assertNotForwardedPointer(env, objectPtr);
}

void assertNotForwardedPointer(MM_EnvironmentBase *env, omrobjectptr_t objectPtr);

/**
* Private internal. Called exclusively from completeScan();
*/
Expand Down

0 comments on commit 3f0485e

Please sign in to comment.