Bug 1161353 - Follow-up to remove more post-barrier verifier cruft; r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 07 May 2015 03:47:00 -0700
changeset 274215 033d22094200b822ba79e7334a3184b81d28bfd4
parent 274214 b4ad8eababf5b8db4426c4c6340a8da337debd30
child 274216 0170a6c2a5bebc37e2ca4c92110dbad6784fbc57
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1161353
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161353 - Follow-up to remove more post-barrier verifier cruft; r=terrence
js/src/builtin/TestingFunctions.cpp
js/src/gc/GCRuntime.h
js/src/gc/Nursery.cpp
js/src/gc/Nursery.h
js/src/gc/Verifier.cpp
js/src/jit/Ion.cpp
js/src/jsgc.h
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -589,23 +589,23 @@ VerifyPreBarriers(JSContext* cx, unsigne
     gc::VerifyBarriers(cx->runtime(), gc::PreBarrierVerifier);
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 VerifyPostBarriers(JSContext* cx, unsigned argc, jsval* vp)
 {
+    // This is a no-op since the post barrier verifier was removed.
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length()) {
         RootedObject callee(cx, &args.callee());
         ReportUsageError(cx, callee, "Too many arguments");
         return false;
     }
-    gc::VerifyBarriers(cx->runtime(), gc::PostBarrierVerifier);
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 GCState(JSContext* cx, unsigned argc, jsval* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -2699,17 +2699,17 @@ gc::ZealModeHelpText),
 "  Schedule the given objects to be marked in the next GC slice."),
 
     JS_FN_HELP("verifyprebarriers", VerifyPreBarriers, 0, 0,
 "verifyprebarriers()",
 "  Start or end a run of the pre-write barrier verifier."),
 
     JS_FN_HELP("verifypostbarriers", VerifyPostBarriers, 0, 0,
 "verifypostbarriers()",
-"  Start or end a run of the post-write barrier verifier."),
+"  Does nothing (the post-write barrier verifier has been remove)."),
 
     JS_FN_HELP("gcstate", GCState, 0, 0,
 "gcstate()",
 "  Report the global GC state."),
 
     JS_FN_HELP("deterministicgc", DeterministicGC, 1, 0,
 "deterministicgc(true|false)",
 "  If true, only allow determinstic GCs to run."),
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -1009,17 +1009,16 @@ class GCRuntime
 
     size_t maxMallocBytes;
 
     /*
      * Number of the committed arenas in all GC chunks including empty chunks.
      */
     mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> numArenasFreeCommitted;
     void* verifyPreData;
-    void* verifyPostData;
     bool chunkAllocationSinceLastGC;
     int64_t nextFullGCTime;
     int64_t lastGCTime;
 
     JSGCMode mode;
 
     mozilla::Atomic<size_t, mozilla::ReleaseAcquire> numActiveZoneIters;
 
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -374,19 +374,16 @@ js::Nursery::forwardBufferPointer(HeapSl
 
 js::TenuringTracer::TenuringTracer(JSRuntime* rt, Nursery* nursery)
   : JSTracer(rt, JSTracer::TracerKindTag::Tenuring, TraceWeakMapKeysValues)
   , nursery_(*nursery)
   , tenuredSize(0)
   , head(nullptr)
   , tail(&head)
   , savedRuntimeNeedBarrier(rt->needsIncrementalBarrier())
-#ifdef JS_GC_ZEAL
-  , verifyingPostBarriers(nullptr)
-#endif
 {
     rt->gc.incGcNumber();
 
     // We disable the runtime needsIncrementalBarrier() check so that
     // pre-barriers do not fire on objects that have been relocated. The
     // pre-barrier's call to obj->zone() will try to look through shape_,
     // which is now the relocation magic and will crash. However,
     // zone->needsIncrementalBarrier() must still be set correctly so that
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -65,20 +65,16 @@ class TenuringTracer : public JSTracer
     TenuringTracer(JSRuntime* rt, Nursery* nursery);
     ~TenuringTracer();
 
   public:
     const Nursery& nursery() const { return nursery_; }
     JSObject* moveToTenured(JSObject* thing);
 
     void insertIntoFixupList(gc::RelocationOverlay* entry);
-
-#ifdef JS_GC_ZEAL
-    bool verifyingPostBarriers;
-#endif
 };
 
 class Nursery
 {
   public:
     static const size_t Alignment = gc::ChunkSize;
     static const size_t ChunkShift = gc::ChunkShift;
 
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -40,23 +40,16 @@ using namespace js::gc;
  *
  * Pre-Barrier Verifier:
  *   When StartVerifyBarriers is called, a snapshot is taken of all objects in
  *   the GC heap and saved in an explicit graph data structure. Later,
  *   EndVerifyBarriers traverses the heap again. Any pointer values that were in
  *   the snapshot and are no longer found must be marked; otherwise an assertion
  *   triggers. Note that we must not GC in between starting and finishing a
  *   verification phase.
- *
- * Post-Barrier Verifier:
- *   When StartVerifyBarriers is called, we create a virtual "Nursery Set" which
- *   future allocations are recorded in and turn on the StoreBuffer. Later,
- *   EndVerifyBarriers traverses the heap and ensures that the set of cross-
- *   generational pointers we find is a subset of the pointers recorded in our
- *   StoreBuffer.
  */
 
 struct EdgeValue
 {
     void* thing;
     JSGCTraceKind kind;
     const char* label;
 };
@@ -169,25 +162,16 @@ NextNode(VerifyNode* node)
 }
 
 void
 gc::GCRuntime::startVerifyPreBarriers()
 {
     if (verifyPreData || isIncrementalGCInProgress())
         return;
 
-    /*
-     * The post barrier verifier requires the storebuffer to be enabled, but the
-     * pre barrier verifier disables it as part of disabling GGC.  Don't allow
-     * starting the pre barrier verifier if the post barrier verifier is already
-     * running.
-     */
-    if (verifyPostData)
-        return;
-
     evictNursery();
 
     AutoPrepareForTracing prep(rt, WithAtoms);
 
     if (!IsIncrementalGCSafe(rt))
         return;
 
     for (auto chunk = allNonEmptyChunks(); !chunk.done(); chunk.next())
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1726,18 +1726,17 @@ class MarkOffThreadNurseryObjects : publ
 };
 
 void
 MarkOffThreadNurseryObjects::mark(JSTracer* trc)
 {
     JSRuntime* rt = trc->runtime();
 
     if (trc->runtime()->isHeapMinorCollecting()) {
-        // Only reset hasIonNurseryObjects if we're doing an actual minor GC,
-        // not if we're, for instance, verifying post barriers.
+        // Only reset hasIonNurseryObjects if we're doing an actual minor GC.
         MOZ_ASSERT(rt->jitRuntime()->hasIonNurseryObjects());
         rt->jitRuntime()->setHasIonNurseryObjects(false);
     }
 
     AutoLockHelperThreadState lock;
     if (!HelperThreadState().threads)
         return;
 
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -1337,18 +1337,17 @@ const int ZealGenerationalGCValue = 7;
 const int ZealIncrementalRootsThenFinish = 8;
 const int ZealIncrementalMarkAllThenFinish = 9;
 const int ZealIncrementalMultipleSlices = 10;
 const int ZealCheckHashTablesOnMinorGC = 13;
 const int ZealCompactValue = 14;
 const int ZealLimit = 14;
 
 enum VerifierType {
-    PreBarrierVerifier,
-    PostBarrierVerifier
+    PreBarrierVerifier
 };
 
 #ifdef JS_GC_ZEAL
 
 extern const char* ZealModeHelpText;
 
 /* Check that write barriers have been used correctly. See jsgc.cpp. */
 void