Bug 1274193 part 6 - Use GO_THROUGH_SAVED for the expression decompiler. r=jorendorff
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 24 May 2016 14:31:45 +0200
changeset 337761 701378e19df1fcdecae01159d657d314858b8198
parent 337760 3908a77903cf3d3b571880a5c785142b3a1f9c02
child 337762 faa07a14d470bf380a3cc5e57af34e7f7b64722b
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1274193
milestone49.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 1274193 part 6 - Use GO_THROUGH_SAVED for the expression decompiler. r=jorendorff
js/src/jsopcode.cpp
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1410,23 +1410,22 @@ DecompileExpressionFromStack(JSContext* 
     /*
      * Give up if we need deterministic behavior for differential testing.
      * IonMonkey doesn't use InterpreterFrames and this ensures we get the same
      * error messages.
      */
     return true;
 #endif
 
-    FrameIter frameIter(cx, FrameIter::STOP_AT_SAVED);
+    FrameIter frameIter(cx, FrameIter::GO_THROUGH_SAVED);
 
-    if (frameIter.done() || !frameIter.hasScript())
+    if (frameIter.done() || !frameIter.hasScript() || frameIter.compartment() != cx->compartment())
         return true;
 
     RootedScript script(cx, frameIter.script());
-    AutoCompartment ac(cx, &script->global());
     jsbytecode* valuepc = frameIter.pc();
 
     MOZ_ASSERT(script->containsPC(valuepc));
 
     // Give up if in prologue.
     if (valuepc < script->main())
         return true;
 
@@ -1481,29 +1480,29 @@ DecompileArgumentFromStack(JSContext* cx
     /* See note in DecompileExpressionFromStack. */
     return true;
 #endif
 
     /*
      * Settle on the nearest script frame, which should be the builtin that
      * called the intrinsic.
      */
-    FrameIter frameIter(cx, FrameIter::STOP_AT_SAVED);
+    FrameIter frameIter(cx, FrameIter::GO_THROUGH_SAVED);
     MOZ_ASSERT(!frameIter.done());
+    MOZ_ASSERT(frameIter.script()->selfHosted());
 
     /*
      * Get the second-to-top frame, the caller of the builtin that called the
      * intrinsic.
      */
     ++frameIter;
-    if (frameIter.done() || !frameIter.hasScript())
+    if (frameIter.done() || !frameIter.hasScript() || frameIter.compartment() != cx->compartment())
         return true;
 
     RootedScript script(cx, frameIter.script());
-    AutoCompartment ac(cx, &script->global());
     jsbytecode* current = frameIter.pc();
 
     MOZ_ASSERT(script->containsPC(current));
 
     if (current < script->main())
         return true;
 
     /* Don't handle getters, setters or calls from fun.call/fun.apply. */