Bug 895111 - Allow Ion inline checking of functions with lazy scripts. (r=djvj)
authorEric Faust <efaustbmo@gmail.com>
Thu, 18 Jul 2013 14:03:05 -0700
changeset 139155 d4e59204744e71b8cd444f419f33679bc137d66c
parent 139154 480852219d5034ae4f53e75522022fde8ec55c4e
child 139156 aa9cfaaaeff7556945bce4bd6a82247901ac3f8f
push idunknown
push userunknown
push dateunknown
reviewersdjvj
bugs895111
milestone25.0a1
Bug 895111 - Allow Ion inline checking of functions with lazy scripts. (r=djvj)
js/src/ion/IonBuilder.cpp
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -254,16 +254,21 @@ IonBuilder::canInlineTarget(JSFunction *
         return false;
     }
 
     if (target->getParent() != &script()->global()) {
         IonSpew(IonSpew_Inlining, "Cannot inline due to scope mismatch");
         return false;
     }
 
+    if (!target->hasScript()) {
+        IonSpew(IonSpew_Inlining, "Cannot inline due to lack of Non-Lazy script");
+        return false;
+    }
+
     RootedScript inlineScript(cx, target->nonLazyScript());
     ExecutionMode executionMode = info().executionMode();
     if (!CanIonCompile(inlineScript, executionMode)) {
         IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to disable Ion compilation",
                                   inlineScript->filename(), inlineScript->lineno);
         return false;
     }