From ee0e24b0088092fd22ab4cef115360df5a3b9305 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 3 Jun 2014 10:06:20 +0100 Subject: [PATCH] Bug 1014092 - Disable incemental marking validation on B2G r=terrence --HG-- extra : rebase_source : 424dd5fe000800e0386242a44c0a57181a9f2131 --- js/src/gc/GCRuntime.h | 7 ++++++- js/src/jsgc.cpp | 16 ++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index a8cca6249d0..36f73ff8cc0 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -19,6 +19,11 @@ #endif #include "gc/Tracer.h" +/* Perform validation of incremental marking in debug builds but not on B2G. */ +#if defined(DEBUG) && !defined(MOZ_B2G) +#define JS_GC_MARKING_VALIDATION +#endif + namespace js { struct ScriptAndCounts @@ -410,7 +415,7 @@ class GCRuntime */ js::gc::ArenaHeader *arenasAllocatedDuringSweep; -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION js::gc::MarkingValidator *markingValidator; #endif diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index e83c8fb7bf7..dc0667b3aac 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1086,7 +1086,7 @@ GCRuntime::GCRuntime(JSRuntime *rt) : sweepKindIndex(0), abortSweepAfterCurrentGroup(false), arenasAllocatedDuringSweep(nullptr), -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION markingValidator(nullptr), #endif interFrameGC(0), @@ -3159,6 +3159,10 @@ class js::gc::MarkingValidator BitmapMap map; }; +#endif // DEBUG + +#ifdef JS_GC_MARKING_VALIDATION + js::gc::MarkingValidator::MarkingValidator(GCRuntime *gc) : gc(gc), initialized(false) @@ -3347,12 +3351,12 @@ js::gc::MarkingValidator::validate() } } -#endif +#endif // JS_GC_MARKING_VALIDATION void GCRuntime::computeNonIncrementalMarkingForValidation() { -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION JS_ASSERT(!markingValidator); if (isIncremental && validate) markingValidator = js_new(this); @@ -3364,7 +3368,7 @@ GCRuntime::computeNonIncrementalMarkingForValidation() void GCRuntime::validateIncrementalMarking() { -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION if (markingValidator) markingValidator->validate(); #endif @@ -3373,7 +3377,7 @@ GCRuntime::validateIncrementalMarking() void GCRuntime::finishMarkingValidation() { -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION js_delete(markingValidator); markingValidator = nullptr; #endif @@ -3382,7 +3386,7 @@ GCRuntime::finishMarkingValidation() static void AssertNeedsBarrierFlagsConsistent(JSRuntime *rt) { -#ifdef DEBUG +#ifdef JS_GC_MARKING_VALIDATION bool anyNeedsBarrier = false; for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) anyNeedsBarrier |= zone->needsBarrier();