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 294274 a52937e707220800eaef9bf5dd8fd4d7c6b8de8f
parent 294273 735ec1225c8af825321e3cc788be610ddcb202dc
child 294275 eeb033507f6a98b44ff57581b05acc469d838b39
push id18864
push userkwierso@gmail.com
push dateThu, 21 Apr 2016 22:03:23 +0000
treeherderfx-team@467bd00c72db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1266105
milestone48.0a1
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