From d6eea80650a89ce7cb0a70f40daa7b3974bc4883 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Fri, 16 Jan 2015 09:44:20 -0800 Subject: [PATCH] Bug 1111361 - Allow for lower latency GC on elm micro-benchmark; r=jonco --HG-- extra : rebase_source : 205068401b975345f79610581cd08afb754bf870 --- js/src/gc/Marking.cpp | 6 ++++++ js/src/jsgc.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 94500b5ee718..cd85aece5966 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -1741,6 +1741,12 @@ GCMarker::processMarkStackTop(SliceBudget &budget) scan_value_array: MOZ_ASSERT(vp <= end); while (vp != end) { + budget.step(); + if (budget.isOverBudget()) { + pushValueArray(obj, vp, end); + return; + } + const Value &v = *vp++; if (v.isString()) { markAndScanString(obj, v.toString()); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index b8b326e7768e..a93c9102476f 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -3190,7 +3190,7 @@ GCRuntime::maybeAllocTriggerZoneGC(Zone *zone, const AutoLockGC &lock) // The threshold has been surpassed, immediately trigger a GC, // which will be done non-incrementally. triggerZoneGC(zone, JS::gcreason::ALLOC_TRIGGER); - } else if (usedBytes >= igcThresholdBytes) { + } else if (usedBytes >= igcThresholdBytes && interFrameGC) { // Reduce the delay to the start of the next incremental slice. if (zone->gcDelayBytes < ArenaSize) zone->gcDelayBytes = 0;