Backout 148cab7775e5 (Bug 1202051) for cgc bustage on a CLOSED TREE.
authorTerrence Cole <terrence@mozilla.com>
Fri, 11 Sep 2015 11:37:37 -0700
changeset 296386 136d521cb8726bb71fdf4270043e393a1ffa3231
parent 296385 f14ff4e13b88eb2b66f6c344ed5cc4867ee25359
child 296387 9ef95c4879fa186477c915278de1267c3e8b8406
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1202051
milestone43.0a1
backs out148cab7775e5d4229e30bd4c1c55e5b193756aef
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
Backout 148cab7775e5 (Bug 1202051) for cgc bustage on a CLOSED TREE.
js/src/jscntxt.cpp
js/src/jscntxt.h
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -942,17 +942,17 @@ ExclusiveContext::recoverFromOutOfMemory
             maybecx->clearPendingException();
         }
     }
 }
 
 JSContext::JSContext(JSRuntime* rt)
   : ExclusiveContext(rt, &rt->mainThread, Context_JS),
     throwing(false),
-    unwrappedException_(this),
+    unwrappedException_(UndefinedValue()),
     options_(),
     overRecursed_(false),
     propagatingForcedReturn_(false),
     liveVolatileJitFrameIterators_(nullptr),
     reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
     resolvingList(nullptr),
     generatingError(false),
     savedFrameChains_(),
@@ -1131,16 +1131,20 @@ JSContext::sizeOfIncludingThis(mozilla::
     return mallocSizeOf(this) + cycleDetectorSet.sizeOfExcludingThis(mallocSizeOf);
 }
 
 void
 JSContext::mark(JSTracer* trc)
 {
     /* Stack frames and slots are traced by StackSpace::mark. */
 
+    /* Mark other roots-by-definition in the JSContext. */
+    if (isExceptionPending())
+        TraceRoot(trc, &unwrappedException_, "unwrapped exception");
+
     TraceCycleDetectionSet(trc, cycleDetectorSet);
 
     if (compartment_)
         compartment_->mark();
 }
 
 void*
 ExclusiveContext::stackLimitAddressForJitCode(StackKind kind)
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -300,17 +300,17 @@ struct JSContext : public js::ExclusiveC
     friend class js::ExclusiveContext;
     friend class JS::AutoSaveExceptionState;
     friend class js::jit::DebugModeOSRVolatileJitFrameIterator;
     friend void js::ReportOverRecursed(JSContext*);
 
   private:
     /* Exception state -- the exception member is a GC root by definition. */
     bool                throwing;            /* is there a pending exception? */
-    JS::PersistentRooted<JS::Value> unwrappedException_; /* most-recently-thrown exception */
+    js::Value           unwrappedException_; /* most-recently-thrown exception */
 
     /* Per-context options. */
     JS::ContextOptions  options_;
 
     // True if the exception currently being thrown is by result of
     // ReportOverRecursed. See Debugger::slowPathOnExceptionUnwind.
     bool                overRecursed_;