Index: src/x87/builtins-x87.cc |
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc |
index 130b61660c82ff91b9cb2b379d5e99aa54b9466c..4418d87a611c5ecff8072f2085be5e5f11ff9f48 100644 |
--- a/src/x87/builtins-x87.cc |
+++ b/src/x87/builtins-x87.cc |
@@ -1542,8 +1542,16 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { |
__ CmpInstanceType(ecx, 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(ecx); |
+ __ Push(edi); |
+ __ PushReturnAddressFrom(ecx); |
+ // Increase the arguments size to include the pushed function and the |
+ // existing receiver on the stack. |
+ __ addp(eax, Immediate(2)); |
+ // Tail-call to the runtime. |
+ __ JumpToExternalReference( |
+ ExternalReference(Runtime::kJSProxyCall, masm->isolate())); |
// 2. Call to something else, which might have a [[Call]] internal method (if |
// not we raise an exception). |