| Index: src/x64/builtins-x64.cc
|
| diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
|
| index c0a0421a5eb08f2fc773c0da84be2782ffb5c47a..68bb15b0fabfa53960607ec320846b2c1aac1245 100644
|
| --- a/src/x64/builtins-x64.cc
|
| +++ b/src/x64/builtins-x64.cc
|
| @@ -2406,6 +2406,12 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
|
| __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx);
|
| __ j(equal, masm->isolate()->builtins()->CallFunction(mode, tail_call_mode),
|
| RelocInfo::CODE_TARGET);
|
| +
|
| + // Check if target has a [[Call]] internal method.
|
| + __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
|
| + Immediate(1 << Map::kIsCallable));
|
| + __ j(zero, &non_callable);
|
| +
|
| __ CmpInstanceType(rcx, JS_BOUND_FUNCTION_TYPE);
|
| __ j(equal, masm->isolate()->builtins()->CallBoundFunction(tail_call_mode),
|
| RelocInfo::CODE_TARGET);
|
| @@ -2431,10 +2437,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.
|
| - __ testb(FieldOperand(rcx, Map::kBitFieldOffset),
|
| - Immediate(1 << Map::kIsCallable));
|
| - __ j(zero, &non_callable, Label::kNear);
|
| // Overwrite the original receiver with the (original) target.
|
| __ movp(args.GetReceiverOperand(), rdi);
|
| // Let the "call_as_function_delegate" take care of the rest.
|
|
|