Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index 37831d71e56803cc524f4c11b3c46e5a1d4343bd..1433c9c7038e77f5bce461f41df6b209d03b0fe4 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -1930,13 +1930,9 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
// -- sp[0] : thisArg |
// ----------------------------------- |
- // 2. Make sure the receiver is actually callable. |
- Label receiver_not_callable; |
- __ JumpIfSmi(r1, &receiver_not_callable); |
- __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); |
- __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
- __ tst(r4, Operand(1 << Map::kIsCallable)); |
- __ b(eq, &receiver_not_callable); |
+ // 2. We don't need to check explicitly for callable receiver here, |
+ // since that's the first thing the Call/CallWithArrayLike builtins |
+ // will do. |
// 3. Tail call with no arguments if argArray is null or undefined. |
Label no_arguments; |
@@ -1954,13 +1950,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
__ mov(r0, Operand(0)); |
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
} |
- |
- // 4c. The receiver is not callable, throw an appropriate TypeError. |
- __ bind(&receiver_not_callable); |
- { |
- __ str(r1, MemOperand(sp, 0)); |
- __ TailCallRuntime(Runtime::kThrowApplyNonFunction); |
- } |
} |
// static |
@@ -2038,24 +2027,13 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) { |
// -- sp[0] : thisArgument |
// ----------------------------------- |
- // 2. Make sure the target is actually callable. |
- Label target_not_callable; |
- __ JumpIfSmi(r1, &target_not_callable); |
- __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); |
- __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
- __ tst(r4, Operand(1 << Map::kIsCallable)); |
- __ b(eq, &target_not_callable); |
+ // 2. We don't need to check explicitly for callable target here, |
+ // since that's the first thing the Call/CallWithArrayLike builtins |
+ // will do. |
- // 3a. Apply the target to the given argumentsList. |
+ // 3. Apply the target to the given argumentsList. |
__ Jump(masm->isolate()->builtins()->CallWithArrayLike(), |
RelocInfo::CODE_TARGET); |
- |
- // 3b. The target is not callable, throw an appropriate TypeError. |
- __ bind(&target_not_callable); |
- { |
- __ str(r1, MemOperand(sp, 0)); |
- __ TailCallRuntime(Runtime::kThrowApplyNonFunction); |
- } |
} |
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { |