Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 1a6ee7cda1e836d9b9a5fe465f9edb43080bd339..31237d8131f0728aff3c454dd05798004ec8969f 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -1745,8 +1745,16 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
__ CmpInstanceType(rcx, JS_PROXY_TYPE); |
__ j(not_equal, &non_function); |
- // 1. Call to function proxy. |
- // TODO(neis): Implement [[Call]] on proxies. |
+ // 1. Runtime fallback for Proxy [[Call]]. |
+ __ PopReturnAddressTo(kScratchRegister); |
+ __ Push(rdi); |
+ __ PushReturnAddressFrom(kScratchRegister); |
+ // Increase the arguments size to include the pushed function and the |
+ // existing receiver on the stack. |
+ __ addp(rax, Immediate(2)); |
+ // Tail-call to the runtime. |
+ __ JumpToExternalReference( |
+ ExternalReference(Runtime::kJSProxyCall, masm->isolate()), 1); |
// 2. Call to something else, which might have a [[Call]] internal method (if |
// not we raise an exception). |