Bug 1005030: IonMonkey: Don't abort the analysis passes during funapply, r=bhackett
authorHannes Verschore <hv1989@gmail.com>
Fri, 02 May 2014 22:23:17 +0200
changeset 181779 f8497c9757f136708aea52f06e2d0efce18fdab9
parent 181778 b3a88dc52da78d6de5a31eca1d0a4512f2481979
child 181809 43c5be10eae0b874634fc6456a11ab4bec2d0f50
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbhackett
bugs1005030
milestone32.0a1
Bug 1005030: IonMonkey: Don't abort the analysis passes during funapply, r=bhackett
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -4968,17 +4968,17 @@ IonBuilder::jsop_funcall(uint32_t argc)
 
 bool
 IonBuilder::jsop_funapply(uint32_t argc)
 {
     int calleeDepth = -((int)argc + 2);
 
     types::TemporaryTypeSet *calleeTypes = current->peek(calleeDepth)->resultTypeSet();
     JSFunction *native = getSingleCallTarget(calleeTypes);
-    if (argc != 2) {
+    if (argc != 2 || info().executionMode() == ArgumentsUsageAnalysis) {
         CallInfo callInfo(alloc(), false);
         if (!callInfo.init(current, argc))
             return false;
         return makeCall(native, callInfo, false);
     }
 
     // Disable compilation if the second argument to |apply| cannot be guaranteed
     // to be either definitely |arguments| or definitely not |arguments|.
@@ -4993,19 +4993,19 @@ IonBuilder::jsop_funapply(uint32_t argc)
     // Fallback to regular call if arg 2 is not definitely |arguments|.
     if (argument->type() != MIRType_MagicOptimizedArguments) {
         CallInfo callInfo(alloc(), false);
         if (!callInfo.init(current, argc))
             return false;
         return makeCall(native, callInfo, false);
     }
 
-    if (!native ||
-        !native->isNative() ||
-        native->native() != js_fun_apply)
+    if ((!native || !native->isNative() ||
+        native->native() != js_fun_apply) &&
+        info().executionMode() != DefinitePropertiesAnalysis)
     {
         return abort("fun.apply speculation failed");
     }
 
     current->peek(calleeDepth)->setImplicitlyUsedUnchecked();
 
     // Use funapply that definitely uses |arguments|
     return jsop_funapplyarguments(argc);