[INFER] Fix bustage with inference disabled.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 06 Jun 2011 10:04:31 -0700
changeset 75145 334428e1d5aac565a771d1bbb1a785797fd89f81
parent 75144 4f8b85723213489d3cf8699dddad477347ffc316
child 75146 1b5429edb553cab294f7648036cfb8981a6989d8
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
[INFER] Fix bustage with inference disabled.
js/src/methodjit/Compiler.cpp
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -178,21 +178,24 @@ mjit::Compiler::compile()
     }
 
     return status;
 }
 
 CompileStatus
 mjit::Compiler::checkAnalysis(JSScript *script)
 {
+    ScriptAnalysis *analysis = script->analysis(cx);
+    if (analysis && !analysis->ranBytecode())
+        analysis->analyzeBytecode(cx);
+
     if (cx->typeInferenceEnabled() && !script->ensureRanInference(cx))
         return Compile_Error;
-
-    ScriptAnalysis *analysis = script->analysis(cx);
-
+    if (!analysis || analysis->OOM())
+        return Compile_Error;
     if (analysis->failed()) {
         JaegerSpew(JSpew_Abort, "couldn't analyze bytecode; probably switchX or OOM\n");
         return Compile_Abort;
     }
 
     return Compile_Okay;
 }