Bug 975876 - Allow GC in ~AutoMaybeTouchDeadZones to touch dead zones (r=luke)
authorBill McCloskey <wmccloskey@mozilla.com>
Thu, 27 Feb 2014 11:56:49 -0800
changeset 171349 e9f7deb46a0813bc42918374edddecc016affbaf
parent 171348 00f1d0e19c9b5bd812a50957a41888f711f583a3
child 171350 281e47e4184f0861e7b79ee157819ce50baa7569
child 171466 c8e793bdc6eb16050e20f2f711b478c738288ea6
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersluke
bugs975876
milestone30.0a1
Bug 975876 - Allow GC in ~AutoMaybeTouchDeadZones to touch dead zones (r=luke)
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -5518,22 +5518,22 @@ AutoMaybeTouchDeadZones::AutoMaybeTouchD
     inIncremental(JS::IsIncrementalGCInProgress(runtime)),
     manipulatingDeadZones(runtime->gcManipulatingDeadZones)
 {
     runtime->gcManipulatingDeadZones = true;
 }
 
 AutoMaybeTouchDeadZones::~AutoMaybeTouchDeadZones()
 {
+    runtime->gcManipulatingDeadZones = manipulatingDeadZones;
+
     if (inIncremental && runtime->gcObjectsMarkedInDeadZones != markCount) {
         JS::PrepareForFullGC(runtime);
         js::GC(runtime, GC_NORMAL, JS::gcreason::TRANSPLANT);
     }
-
-    runtime->gcManipulatingDeadZones = manipulatingDeadZones;
 }
 
 AutoSuppressGC::AutoSuppressGC(ExclusiveContext *cx)
   : suppressGC_(cx->perThreadData->suppressGC)
 {
     suppressGC_++;
 }