[INFER] Ensure inlined frames are expanded when searching for exception handlers, bug 680759.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 21 Aug 2011 19:52:04 -0700
changeset 77451 194a7ad3ecd2e8c6381ad2de511a018210730df4
parent 77450 7148e337703819f993ef308a43b5bbf4d560b829
child 77452 d7217d210771b2095930bb42291d2e4bff7dea89
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs680759
milestone9.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
[INFER] Ensure inlined frames are expanded when searching for exception handlers, bug 680759.
js/src/jit-test/tests/jaeger/inline/bug680759.js
js/src/methodjit/InvokeHelpers.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/inline/bug680759.js
@@ -0,0 +1,14 @@
+
+TryToCatch();
+TryToCatch();
+function Thrower( v ) {
+  throw "Caught";
+}
+function Eval( v ) { 
+	SECTION : Thrower(TryToCatch, v, ': 3')
+}
+function TryToCatch( value, expect ) {
+  try {
+    Eval( value )
+  } catch (e) {  }
+}
--- a/js/src/methodjit/InvokeHelpers.cpp
+++ b/js/src/methodjit/InvokeHelpers.cpp
@@ -520,16 +520,18 @@ RemoveOrphanedNative(JSContext *cx, Stac
     }
 }
 
 extern "C" void *
 js_InternalThrow(VMFrame &f)
 {
     JSContext *cx = f.cx;
 
+    ExpandInlineFrames(cx->compartment);
+
     // The current frame may have an associated orphaned native, if the native
     // or SplatApplyArgs threw an exception.
     RemoveOrphanedNative(cx, f.fp());
 
     // It's possible that from within RunTracer(), Interpret() returned with
     // an error and finished the frame (i.e., called ScriptEpilogue), but has
     // not yet performed an inline return.
     //
@@ -617,24 +619,16 @@ js_InternalThrow(VMFrame &f)
          * Fall back to EnterMethodJIT and finish the frame in the interpreter.
          * With type inference enabled, we may wipe out all JIT code on the
          * stack without patching ncode values to jump to the interpreter, and
          * thus can only enter JIT code via EnterMethodJIT (which overwrites
          * its entry frame's ncode). See ClearAllFrames.
          */
         cx->compartment->jaegerCompartment()->setLastUnfinished(Jaeger_Unfinished);
 
-        /*
-         * Expanding inline frames will ensure that prevpc values are filled in
-         * for all frames on this VMFrame, without needing to walk the entire
-         * stack: downFramesExpanded() on a StackFrame also means the prevpc()
-         * values are also filled in.
-         */
-        ExpandInlineFrames(cx->compartment);
-
         if (!script->ensureRanBytecode(cx)) {
             js_ReportOutOfMemory(cx);
             return NULL;
         }
 
         analyze::AutoEnterAnalysis enter(cx);
 
         cx->regs().pc = pc;