Bug 912152 - Improve mechanism for bailing out from Ion compilation of scripts with try-finally, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 10 Sep 2013 08:42:52 -0700
changeset 146432 f937dc17e5ac87d6df73ff66b64293acccf839d8
parent 146431 0979fdfd27176db326a7dd1afd9e41bc7ef1bc88
child 146433 c65a5025b50a820e9d438244d4e014e080d2119d
push id25260
push userryanvm@gmail.com
push dateWed, 11 Sep 2013 00:29:30 +0000
treeherdermozilla-central@f73bed2856a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs912152
milestone26.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 912152 - Improve mechanism for bailing out from Ion compilation of scripts with try-finally, r=jandem.
js/src/jit-test/tests/ion/bug912152.js
js/src/jit/Ion.cpp
js/src/jit/IonBuilder.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug912152.js
@@ -0,0 +1,7 @@
+
+function foo() {
+    try {
+        this.f = 0;
+    } finally {}
+}
+new foo();
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1594,22 +1594,16 @@ IonCompile(JSContext *cx, JSScript *scri
                         TraceLogging::ION_COMPILE_START,
                         TraceLogging::ION_COMPILE_STOP,
                         script);
 #endif
 
     if (!script->ensureRanAnalysis(cx))
         return AbortReason_Alloc;
 
-    // Try-finally is not yet supported.
-    if (script->analysis()->hasTryFinally()) {
-        IonSpew(IonSpew_Abort, "Has try-finally.");
-        return AbortReason_Disable;
-    }
-
     LifoAlloc *alloc = cx->new_<LifoAlloc>(BUILDER_LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
     if (!alloc)
         return AbortReason_Alloc;
 
     ScopedJSDeletePtr<LifoAlloc> autoDelete(alloc);
 
     TempAllocator *temp = alloc->new_<TempAllocator>(alloc);
     if (!temp)
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -3359,17 +3359,18 @@ bool
 IonBuilder::jsop_try()
 {
     JS_ASSERT(JSOp(*pc) == JSOP_TRY);
 
     if (!js_IonOptions.compileTryCatch)
         return abort("Try-catch support disabled");
 
     // Try-finally is not yet supported.
-    JS_ASSERT(!script()->analysis()->hasTryFinally());
+    if (script()->analysis()->hasTryFinally())
+        return abort("Has try-finally");
 
     graph().setHasTryBlock();
 
     jssrcnote *sn = info().getNote(cx, pc);
     JS_ASSERT(SN_TYPE(sn) == SRC_TRY);
 
     // Get the pc of the last instruction in the try block. It's a JSOP_GOTO to
     // jump over the catch block.