Bug 931496 - Check for compileability when eagerly baseline compiling inlined scripts. r=jandem, a=bajaj
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 28 Oct 2013 12:43:39 -0600
changeset 166321 d042a03e7087a0e41ee39679da780c74203a363d
parent 166320 53af1176a62e2d93bccdf0634ea2a8fc1c30fd72
child 166322 8f2fa1bfc17921d9c35b56bcc09a66e1b283c081
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, bajaj
bugs931496
milestone27.0a2
Bug 931496 - Check for compileability when eagerly baseline compiling inlined scripts. r=jandem, a=bajaj
js/src/jit-test/tests/ion/bug931496.js
js/src/jit/IonBuilder.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug931496.js
@@ -0,0 +1,11 @@
+
+function g() {
+    yield
+}
+g()
+function f() {
+    g()
+}
+try {
+    new f
+} catch (e) {}
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -280,17 +280,17 @@ IonBuilder::canInlineTarget(JSFunction *
 
     // Allow constructing lazy scripts when performing the definite properties
     // analysis, as baseline has not been used to warm the caller up yet.
     if (target->isInterpreted() && info().executionMode() == DefinitePropertiesAnalysis) {
         if (!target->getOrCreateScript(context()))
             return false;
 
         RootedScript script(context(), target->nonLazyScript());
-        if (!script->hasBaselineScript()) {
+        if (!script->hasBaselineScript() && script->canBaselineCompile()) {
             MethodStatus status = BaselineCompile(context(), script);
             if (status != Method_Compiled)
                 return false;
         }
     }
 
     if (!target->hasScript()) {
         IonSpew(IonSpew_Inlining, "Cannot inline due to lack of Non-Lazy script");