Bug 1115776 - Fix LApplyArgsGeneric to always emit the has-script check. r=shu, a=sledru
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 26 Jan 2015 12:59:47 +0100
changeset 200528 95e4252b6d7477c80757fe5ef5a97e4bf3ea6af2
parent 200527 86128ad9d00e87c1494fd557e8bc8b83d87612fa
child 200529 fbe02a90af22c3ccf7f0d6838163779976dde6c6
push id176
push userjandemooij@gmail.com
push dateMon, 26 Jan 2015 17:56:22 +0000
treeherdermozilla-esr31@95e4252b6d74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu, sledru
bugs1115776
milestone31.4.0
Bug 1115776 - Fix LApplyArgsGeneric to always emit the has-script check. r=shu, a=sledru
js/src/jit/CodeGenerator.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -2443,37 +2443,29 @@ CodeGenerator::visitApplyArgsGeneric(LAp
             return false;
     }
 
     // Copy the arguments of the current function.
     emitPushArguments(apply, copyreg);
 
     masm.checkStackAlignment();
 
-    // If the function is known to be uncompilable, only emit the call to InvokeFunction.
+    // If the function is native, only emit the call to InvokeFunction.
     ExecutionMode executionMode = gen->info().executionMode();
-    if (apply->hasSingleTarget()) {
-        JSFunction *target = apply->getSingleTarget();
-        if (target->isNative()) {
-            if (!emitCallInvokeFunction(apply, copyreg))
-                return false;
-            emitPopArguments(apply, copyreg);
-            return true;
-        }
+    if (apply->hasSingleTarget() && apply->getSingleTarget()->isNative()) {
+        if (!emitCallInvokeFunction(apply, copyreg))
+            return false;
+        emitPopArguments(apply, copyreg);
+        return true;
     }
 
     Label end, invoke;
 
-    // Guard that calleereg is an interpreted function with a JSScript:
-    if (!apply->hasSingleTarget()) {
-        masm.branchIfFunctionHasNoScript(calleereg, &invoke);
-    } else {
-        // Native single targets are handled by LCallNative.
-        JS_ASSERT(!apply->getSingleTarget()->isNative());
-    }
+    // Guard that calleereg is an interpreted function with a JSScript.
+    masm.branchIfFunctionHasNoScript(calleereg, &invoke);
 
     // Knowing that calleereg is a non-native function, load the JSScript.
     masm.loadPtr(Address(calleereg, JSFunction::offsetOfNativeOrScript()), objreg);
 
     // Load script jitcode.
     masm.loadBaselineOrIonRaw(objreg, objreg, executionMode, &invoke);
 
     // Call with an Ion frame or a rectifier frame.