Bug 1266105 - Only purge runtime tables once per slice when compacting r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 21 Apr 2016 11:06:29 +0100
changeset 332139 a52937e707220800eaef9bf5dd8fd4d7c6b8de8f
parent 332138 735ec1225c8af825321e3cc788be610ddcb202dc
child 332140 eeb033507f6a98b44ff57581b05acc469d838b39
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1266105
milestone48.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 1266105 - Only purge runtime tables once per slice when compacting r=terrence
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2810,21 +2810,16 @@ GCRuntime::updatePointersToRelocatedCell
     WatchpointMap::sweepAll(rt);
     Debugger::sweepAll(rt->defaultFreeOp());
     jit::JitRuntime::SweepJitcodeGlobalTable(rt);
     rt->gc.sweepZoneAfterCompacting(zone);
 
     // Type inference may put more blocks here to free.
     freeLifoAlloc.freeAll();
 
-    // Clear runtime caches that can contain cell pointers.
-    // TODO: Should possibly just call purgeRuntime() here.
-    rt->newObjectCache.purge();
-    rt->nativeIterCache.purge();
-
     // Call callbacks to get the rest of the system to fixup other untraced pointers.
     callWeakPointerZoneGroupCallbacks();
     for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next())
         callWeakPointerCompartmentCallbacks(comp);
     if (rt->sweepZoneCallback)
         rt->sweepZoneCallback(zone);
 }
 
@@ -5749,16 +5744,20 @@ GCRuntime::compactPhase(JS::gcreason::Re
             protectAndHoldArenas(relocatedArenas);
         else
             releaseRelocatedArenas(relocatedArenas);
         zonesToMaybeCompact.removeFront();
         if (sliceBudget.isOverBudget())
             break;
     }
 
+    // Clear runtime caches that can contain cell pointers.
+    rt->newObjectCache.purge();
+    rt->nativeIterCache.purge();
+
 #ifdef DEBUG
     CheckHashTablesAfterMovingGC(rt);
 #endif
 
     return zonesToMaybeCompact.isEmpty() ? Finished : NotFinished;
 }
 
 void