Bug 1260501 - Make high frequency GC mode slice budget doubling work with non-0 budgets. r=terrence a=kwierso
authorEmanuel Hoogeveen <emanuel.hoogeveen@gmail.com>
Thu, 31 Mar 2016 14:27:34 -0700
changeset 291109 6e65cda2a0ebba641fc0a6a03a75265f6ee37ea7
parent 291108 aeb9cc61c8ad3f99b23f56c890b887e703472af8
child 291110 7614fc1c6285d44b94388f45e7dafb79d8314d89
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, kwierso
bugs1260501
milestone48.0a1
Bug 1260501 - Make high frequency GC mode slice budget doubling work with non-0 budgets. r=terrence a=kwierso MozReview-Commit-ID: ACGI01R8y6C
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -6501,25 +6501,20 @@ js::AutoEnqueuePendingParseTasksAfterGC:
 {
     if (!gc_.isIncrementalGCInProgress())
         EnqueuePendingParseTasksAfterGC(gc_.rt);
 }
 
 SliceBudget
 GCRuntime::defaultBudget(JS::gcreason::Reason reason, int64_t millis)
 {
-    if (millis == 0) {
-        if (reason == JS::gcreason::ALLOC_TRIGGER)
-            millis = defaultSliceBudget();
-        else if (schedulingState.inHighFrequencyGCMode() && tunables.isDynamicMarkSliceEnabled())
-            millis = defaultSliceBudget() * IGC_MARK_SLICE_MULTIPLIER;
-        else
-            millis = defaultSliceBudget();
-    }
-
+    if (millis == 0)
+        millis = defaultSliceBudget();
+    if (schedulingState.inHighFrequencyGCMode() && tunables.isDynamicMarkSliceEnabled())
+        millis *= IGC_MARK_SLICE_MULTIPLIER;
     return SliceBudget(TimeBudget(millis));
 }
 
 void
 GCRuntime::gc(JSGCInvocationKind gckind, JS::gcreason::Reason reason)
 {
     invocationKind = gckind;
     collect(true, SliceBudget::unlimited(), reason);