Bug 1202051 - Use a PersistentRooted to automate tracing of unwrappedException_; r=sfink
☠☠ backed out by 136d521cb872 ☠ ☠
authorTerrence Cole <terrence@mozilla.com>
Fri, 04 Sep 2015 13:40:59 -0700
changeset 294671 148cab7775e5d4229e30bd4c1c55e5b193756aef
parent 294670 13654c18b57f9ba82875fc5741e619e469b757b0
child 294672 2883757f79419f43aaee1923a130352ac3bb9243
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1202051
milestone43.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 1202051 - Use a PersistentRooted to automate tracing of unwrappedException_; r=sfink
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_(UndefinedValue()),
+    unwrappedException_(this),
     options_(),
     overRecursed_(false),
     propagatingForcedReturn_(false),
     liveVolatileJitFrameIterators_(nullptr),
     reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
     resolvingList(nullptr),
     generatingError(false),
     savedFrameChains_(),
@@ -1131,20 +1131,16 @@ 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::Value           unwrappedException_; /* most-recently-thrown exception */
+    JS::PersistentRooted<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_;