Bug 806298: Disable recompile check for constructing JM calls, r=dvander
authorHannes Verschore <hv1989@gmail.com>
Tue, 13 Nov 2012 09:45:35 +0100
changeset 117711 470acc9eaa36c312a0ac712243801d74ef7411e8
parent 117710 92cb4a2c1ed4d51eb37d9ccf467fa7abacdd5772
child 117712 51533e35127de613651c32689220f0b354a2c347
push idunknown
push userunknown
push dateunknown
reviewersdvander
bugs806298
milestone19.0a1
Bug 806298: Disable recompile check for constructing JM calls, r=dvander
js/src/methodjit/Compiler.cpp
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -3975,16 +3975,22 @@ mjit::Compiler::ionCompileHelper()
     if (!MaybeIonCompileable(cx, outerScript, &recompileCheckForIon))
         return;
 
     uint32_t minUses = ion::UsesBeforeIonRecompile(outerScript, PC);
 
     uint32_t *useCountAddress = script_->addressOfUseCount();
     masm.add32(Imm32(1), AbsoluteAddress(useCountAddress));
 
+    // We cannot inline a JM -> Ion constructing call.
+    // Compiling this function is pointless and would disable the JM -> JM fastpath.
+    // This function will start running in Ion, when caller runs in Ion/Interpreter.
+    if (isConstructing)
+        return;
+
     // If we don't want to do a recompileCheck for Ion, then this just needs to
     // increment the useCount so that we know when to recompile this function
     // from an Ion call.  No need to call out to recompiler stub.
     if (!recompileCheckForIon)
         return;
 
     void *ionScriptAddress = &script_->ion;