Bug 912152 - Improve mechanism for bailing out from Ion compilation of scripts with try-finally, r=jandem.

This commit is contained in:
Brian Hackett 2013-09-10 08:42:52 -07:00
parent 625036f1ac
commit 93a2b1a590
3 changed files with 9 additions and 7 deletions

View File

@ -0,0 +1,7 @@
function foo() {
try {
this.f = 0;
} finally {}
}
new foo();

View File

@ -1599,12 +1599,6 @@ IonCompile(JSContext *cx, JSScript *script,
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;

View File

@ -3364,7 +3364,8 @@ IonBuilder::jsop_try()
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();