Bug 1084651 - Part 6: Rename SliceBudget::reset to the less misleading makeUnlimited. r=billm
☠☠ backed out by 3ad6929d9571 ☠ ☠
authorEmanuel Hoogeveen <emanuel.hoogeveen@gmail.com>
Tue, 04 Nov 2014 07:35:00 +0100
changeset 238412 dd2b3e78b4259b0c2e9f1abd62a52b551be1758b
parent 238411 2711fbd9181959f3a8a923111595b24c2b08979d
child 238413 1f590c2c40f0b850c4062ee651e1fb21a76dff8e
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1084651
milestone36.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 1084651 - Part 6: Rename SliceBudget::reset to the less misleading makeUnlimited. r=billm
js/public/SliceBudget.h
js/src/jsgc.cpp
--- a/js/public/SliceBudget.h
+++ b/js/public/SliceBudget.h
@@ -44,17 +44,17 @@ struct JS_PUBLIC_API(SliceBudget)
     SliceBudget();
 
     /* Instantiate as SliceBudget(TimeBudget(n)). */
     explicit SliceBudget(TimeBudget time);
 
     /* Instantiate as SliceBudget(WorkBudget(n)). */
     explicit SliceBudget(WorkBudget work);
 
-    void reset() {
+    void makeUnlimited() {
         deadline = unlimitedDeadline;
         counter = unlimitedStartCounter;
     }
 
     void step(intptr_t amt = 1) {
         counter -= amt;
     }
 
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2927,34 +2927,34 @@ GCRuntime::refillFreeListInGC(Zone *zone
     MOZ_ASSERT(rt->isHeapMajorCollecting());
     MOZ_ASSERT(!rt->gc.isBackgroundSweeping());
 
     return allocator.arenas.allocateFromArena(zone, thingKind);
 }
 
 SliceBudget::SliceBudget()
 {
-    reset();
+    makeUnlimited();
 }
 
 SliceBudget::SliceBudget(TimeBudget time)
 {
     if (time.budget < 0) {
-        reset();
+        makeUnlimited();
     } else {
         // Note: TimeBudget(0) is equivalent to WorkBudget(CounterReset).
         deadline = PRMJ_Now() + time.budget * PRMJ_USEC_PER_MSEC;
         counter = CounterReset;
     }
 }
 
 SliceBudget::SliceBudget(WorkBudget work)
 {
     if (work.budget < 0) {
-        reset();
+        makeUnlimited();
     } else {
         deadline = 0;
         counter = work.budget;
     }
 }
 
 bool
 SliceBudget::checkOverBudget()
@@ -5658,17 +5658,17 @@ GCRuntime::incrementalCollectSlice(Slice
     MOZ_ASSERT_IF(incrementalState != NO_INCREMENTAL, isIncremental);
     isIncremental = !budget.isUnlimited();
 
     if (zeal == ZealIncrementalRootsThenFinish || zeal == ZealIncrementalMarkAllThenFinish) {
         /*
          * Yields between slices occurs at predetermined points in these modes;
          * the budget is not used.
          */
-        budget.reset();
+        budget.makeUnlimited();
     }
 
     if (incrementalState == NO_INCREMENTAL) {
         incrementalState = MARK_ROOTS;
         lastMarkSlice = false;
     }
 
     if (incrementalState == MARK)
@@ -5690,17 +5690,17 @@ GCRuntime::incrementalCollectSlice(Slice
         if (isIncremental && zeal == ZealIncrementalRootsThenFinish)
             break;
 
         /* fall through */
 
       case MARK: {
         /* If we needed delayed marking for gray roots, then collect until done. */
         if (!marker.hasBufferedGrayRoots()) {
-            budget.reset();
+            budget.makeUnlimited();
             isIncremental = false;
         }
 
         bool finished = drainMarkStack(budget, gcstats::PHASE_MARK);
         if (!finished)
             break;
 
         MOZ_ASSERT(marker.isDrained());
@@ -5780,48 +5780,48 @@ gc::IsIncrementalGCSafe(JSRuntime *rt)
 }
 
 void
 GCRuntime::budgetIncrementalGC(SliceBudget &budget)
 {
     IncrementalSafety safe = IsIncrementalGCSafe(rt);
     if (!safe) {
         resetIncrementalGC(safe.reason());
-        budget.reset();
+        budget.makeUnlimited();
         stats.nonincremental(safe.reason());
         return;
     }
 
     if (mode != JSGC_MODE_INCREMENTAL) {
         resetIncrementalGC("GC mode change");
-        budget.reset();
+        budget.makeUnlimited();
         stats.nonincremental("GC mode");
         return;
     }
 
     if (isTooMuchMalloc()) {
-        budget.reset();
+        budget.makeUnlimited();
         stats.nonincremental("malloc bytes trigger");
     }
 
     bool reset = false;
     for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
         if (zone->usage.gcBytes() >= zone->threshold.gcTriggerBytes()) {
-            budget.reset();
+            budget.makeUnlimited();
             stats.nonincremental("allocation trigger");
         }
 
         if (incrementalState != NO_INCREMENTAL &&
             zone->isGCScheduled() != zone->wasGCStarted())
         {
             reset = true;
         }
 
         if (zone->isTooMuchMalloc()) {
-            budget.reset();
+            budget.makeUnlimited();
             stats.nonincremental("malloc bytes trigger");
         }
     }
 
     if (reset)
         resetIncrementalGC("zone change");
 }
 
@@ -5911,17 +5911,17 @@ GCRuntime::gcCycle(bool incremental, Sli
         // Reset any in progress incremental GC if this was triggered via the
         // API. This isn't required for correctness, but sometimes during tests
         // the caller expects this GC to collect certain objects, and we need
         // to make sure to collect everything possible.
         if (reason != JS::gcreason::ALLOC_TRIGGER)
             resetIncrementalGC("requested");
 
         stats.nonincremental("requested");
-        budget.reset();
+        budget.makeUnlimited();
     } else {
         budgetIncrementalGC(budget);
     }
 
     /* The GC was reset, so we need a do-over. */
     if (prevState != NO_INCREMENTAL && incrementalState == NO_INCREMENTAL)
         return true;