| Index: src/builtins/ia32/builtins-ia32.cc
|
| diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc
|
| index 244bbcac17a466acc2f76d4d002159655d1f1bce..8770d320bf07e4d8a6ce0aeee8e1c1542c3b52c5 100644
|
| --- a/src/builtins/ia32/builtins-ia32.cc
|
| +++ b/src/builtins/ia32/builtins-ia32.cc
|
| @@ -1697,13 +1697,9 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
|
| // -- esp[4] : thisArg
|
| // -----------------------------------
|
|
|
| - // 2. Make sure the receiver is actually callable.
|
| - Label receiver_not_callable;
|
| - __ JumpIfSmi(edi, &receiver_not_callable, Label::kNear);
|
| - __ mov(ecx, FieldOperand(edi, HeapObject::kMapOffset));
|
| - __ test_b(FieldOperand(ecx, Map::kBitFieldOffset),
|
| - Immediate(1 << Map::kIsCallable));
|
| - __ j(zero, &receiver_not_callable, Label::kNear);
|
| + // 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;
|
| @@ -1722,13 +1718,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
|
| __ Set(eax, 0);
|
| __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
|
| }
|
| -
|
| - // 4c. The receiver is not callable, throw an appropriate TypeError.
|
| - __ bind(&receiver_not_callable);
|
| - {
|
| - __ mov(Operand(esp, kPointerSize), edi);
|
| - __ TailCallRuntime(Runtime::kThrowApplyNonFunction);
|
| - }
|
| }
|
|
|
| // static
|
| @@ -1817,24 +1806,13 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
|
| // -- esp[4] : thisArgument
|
| // -----------------------------------
|
|
|
| - // 2. Make sure the target is actually callable.
|
| - Label target_not_callable;
|
| - __ JumpIfSmi(edi, &target_not_callable, Label::kNear);
|
| - __ mov(ecx, FieldOperand(edi, HeapObject::kMapOffset));
|
| - __ test_b(FieldOperand(ecx, Map::kBitFieldOffset),
|
| - Immediate(1 << Map::kIsCallable));
|
| - __ j(zero, &target_not_callable, Label::kNear);
|
| + // 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);
|
| - {
|
| - __ mov(Operand(esp, kPointerSize), edi);
|
| - __ TailCallRuntime(Runtime::kThrowApplyNonFunction);
|
| - }
|
| }
|
|
|
| void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
|
|
|