Bug 1294563 - Fix the pre-compacting interrupt's position; r=jonco
authorTerrence Cole <terrence@mozilla.com>
Wed, 21 Sep 2016 09:33:12 -0700
changeset 314920 755e16dfd05ab828fbfe0d79168c1f2cf256d75b
parent 314919 d29f9abbeaca6fe28bd493046b004fb91cd4332f
child 314921 e3ba1c92e08108b318d7b2638e075fae8b815dee
push id82011
push usertcole@mozilla.com
push dateThu, 22 Sep 2016 16:26:42 +0000
treeherdermozilla-inbound@755e16dfd05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1294563
milestone52.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 1294563 - Fix the pre-compacting interrupt's position; r=jonco
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -5901,20 +5901,16 @@ GCRuntime::incrementalCollectSlice(Slice
       case State::Sweep:
         if (sweepPhase(budget, lock) == NotFinished)
             break;
 
         endSweepPhase(destroyingRuntime, lock);
 
         incrementalState = State::Finalize;
 
-        /* Yield before compacting since it is not incremental. */
-        if (isCompacting && isIncremental)
-            break;
-
         MOZ_FALLTHROUGH;
 
       case State::Finalize:
         {
             gcstats::AutoPhase ap(stats, gcstats::PHASE_WAIT_BACKGROUND_THREAD);
 
             // Yield until background finalization is done.
             if (isIncremental) {
@@ -5935,16 +5931,20 @@ GCRuntime::incrementalCollectSlice(Slice
             AutoSetThreadIsSweeping threadIsSweeping;
             FreeOp fop(rt);
             sweepZones(&fop, destroyingRuntime);
         }
 
         MOZ_ASSERT(!startedCompacting);
         incrementalState = State::Compact;
 
+        // Always yield before compacting since it is not incremental.
+        if (isCompacting && isIncremental)
+            break;
+
         MOZ_FALLTHROUGH;
 
       case State::Compact:
         if (isCompacting) {
             if (!startedCompacting)
                 beginCompactPhase();
 
             if (compactPhase(reason, budget, lock) == NotFinished)