Bug 1568543 - Don't report that an incremental GC is in progress when we're verifiying pre barriers r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D39221
This commit is contained in:
Jon Coppeard 2019-07-24 16:13:03 +01:00
Родитель 1eed8d362f
Коммит 294c8a5aa9
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -8908,8 +8908,7 @@ JS_PUBLIC_API bool JS::IsIncrementalGCEnabled(JSContext* cx) {
} }
JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSContext* cx) { JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSContext* cx) {
return cx->runtime()->gc.isIncrementalGCInProgress() && return cx->runtime()->gc.isIncrementalGCInProgress();
!cx->runtime()->gc.isVerifyPreBarriersEnabled();
} }
JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSRuntime* rt) { JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSRuntime* rt) {

Просмотреть файл

@ -354,7 +354,9 @@ class GCRuntime {
mode == JSGC_MODE_ZONE_INCREMENTAL) && mode == JSGC_MODE_ZONE_INCREMENTAL) &&
incrementalAllowed; incrementalAllowed;
} }
bool isIncrementalGCInProgress() const { return state() != State::NotActive; } bool isIncrementalGCInProgress() const {
return state() != State::NotActive && !isVerifyPreBarriersEnabled();
}
bool hasForegroundWork() const; bool hasForegroundWork() const;
bool isCompactingGCEnabled() const; bool isCompactingGCEnabled() const;
@ -489,7 +491,7 @@ class GCRuntime {
void startVerifyPreBarriers(); void startVerifyPreBarriers();
void endVerifyPreBarriers(); void endVerifyPreBarriers();
void finishVerifier(); void finishVerifier();
bool isVerifyPreBarriersEnabled() const { return !!verifyPreData; } bool isVerifyPreBarriersEnabled() const { return verifyPreData; }
bool shouldYieldForZeal(ZealMode mode); bool shouldYieldForZeal(ZealMode mode);
#else #else
bool isVerifyPreBarriersEnabled() const { return false; } bool isVerifyPreBarriersEnabled() const { return false; }

Просмотреть файл

@ -218,6 +218,7 @@ void gc::GCRuntime::startVerifyPreBarriers() {
/* Create the root node. */ /* Create the root node. */
trc->curnode = MakeNode(trc, nullptr, JS::TraceKind(0)); trc->curnode = MakeNode(trc, nullptr, JS::TraceKind(0));
MOZ_ASSERT(incrementalState == State::NotActive);
incrementalState = State::MarkRoots; incrementalState = State::MarkRoots;
/* Make all the roots be edges emanating from the root node. */ /* Make all the roots be edges emanating from the root node. */
@ -359,6 +360,7 @@ void gc::GCRuntime::endVerifyPreBarriers() {
number++; number++;
verifyPreData = nullptr; verifyPreData = nullptr;
MOZ_ASSERT(incrementalState == State::Mark);
incrementalState = State::NotActive; incrementalState = State::NotActive;
if (!compartmentCreated && IsIncrementalGCUnsafe(rt) == AbortReason::None && if (!compartmentCreated && IsIncrementalGCUnsafe(rt) == AbortReason::None &&