Bug 904282 - Don't mark atoms during last GC (r=jonco)
authorBill McCloskey <wmccloskey@mozilla.com>
Wed, 14 Aug 2013 14:48:40 -0700
changeset 155594 2f7112835ad1bbde55fdcc78b27f854730953fd8
parent 155593 bc5dadbcb78e7bcac9e6b6a1d6f9c7782e0335bd
child 155595 016fa89e49b04f658b8bfb1a85d5b7c66372ed60
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs904282
milestone26.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 904282 - Don't mark atoms during last GC (r=jonco)
js/src/gc/RootMarking.cpp
js/src/jsatom.cpp
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -682,29 +682,27 @@ js::gc::MarkRuntime(JSTracer *trc, bool 
     }
 
     if (rt->scriptAndCountsVector) {
         ScriptAndCountsVector &vec = *rt->scriptAndCountsVector;
         for (size_t i = 0; i < vec.length(); i++)
             MarkScriptRoot(trc, &vec[i].script, "scriptAndCountsVector");
     }
 
-    if (!trc->runtime->isHeapMinorCollecting() &&
+    if (rt->hasContexts() &&
+        !trc->runtime->isHeapMinorCollecting() &&
         (!IS_GC_MARKING_TRACER(trc) || rt->atomsCompartment()->zone()->isCollecting()))
     {
         MarkAtoms(trc);
+        rt->staticStrings.trace(trc);
 #ifdef JS_ION
-        /* Any Ion wrappers survive until the runtime is being torn down. */
-        if (rt->hasContexts())
-            ion::IonRuntime::Mark(trc);
+        ion::IonRuntime::Mark(trc);
 #endif
     }
 
-    rt->staticStrings.trace(trc);
-
     for (ContextIter acx(rt); !acx.done(); acx.next())
         acx->mark(trc);
 
     for (ZonesIter zone(rt); !zone.done(); zone.next()) {
         if (IS_GC_MARKING_TRACER(trc) && !zone->isCollecting())
             continue;
 
         if (IS_GC_MARKING_TRACER(trc) && zone->isPreservingCode()) {
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -197,17 +197,17 @@ void
 js::SweepAtoms(JSRuntime *rt)
 {
     for (AtomSet::Enum e(rt->atoms()); !e.empty(); e.popFront()) {
         AtomStateEntry entry = e.front();
         JSAtom *atom = entry.asPtr();
         bool isDying = IsStringAboutToBeFinalized(&atom);
 
         /* Pinned or interned key cannot be finalized. */
-        JS_ASSERT_IF(entry.isTagged(), !isDying);
+        JS_ASSERT_IF(rt->hasContexts() && entry.isTagged(), !isDying);
 
         if (isDying)
             e.removeFront();
     }
 }
 
 bool
 AtomIsInterned(JSContext *cx, JSAtom *atom)