Chromium Code Reviews| Index: src/arm/builtins-arm.cc |
| diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
| index 398478eecfece51e52ee011a5462f7675cc5885b..64f06a04bd9167120bacab9e3d3a1c89d914a426 100644 |
| --- a/src/arm/builtins-arm.cc |
| +++ b/src/arm/builtins-arm.cc |
| @@ -2257,6 +2257,12 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
| __ CompareObjectType(r1, r4, r5, JS_FUNCTION_TYPE); |
| __ Jump(masm->isolate()->builtins()->CallFunction(mode, tail_call_mode), |
| RelocInfo::CODE_TARGET, eq); |
| + |
| + // Check if target has a [[Call]] internal method. |
| + __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
| + __ tst(r4, Operand(1 << Map::kIsCallable)); |
| + __ b(eq, &non_callable); |
| + |
| __ cmp(r5, Operand(JS_BOUND_FUNCTION_TYPE)); |
|
Benedikt Meurer
2016/03/03 13:19:34
Bound functions are always callable, so you can mo
|
| __ Jump(masm->isolate()->builtins()->CallBoundFunction(tail_call_mode), |
| RelocInfo::CODE_TARGET, eq); |
| @@ -2280,10 +2286,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
| // 2. Call to something else, which might have a [[Call]] internal method (if |
| // not we raise an exception). |
| __ bind(&non_function); |
| - // Check if target has a [[Call]] internal method. |
| - __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
| - __ tst(r4, Operand(1 << Map::kIsCallable)); |
| - __ b(eq, &non_callable); |
| // Overwrite the original receiver the (original) target. |
| __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
| // Let the "call_as_function_delegate" take care of the rest. |