Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 3a0d3dc95d317cf6226c86a67da0d41c1deb5ca8..795e55c82361055c4d2b5bf64ce9cecb51d28012 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -802,9 +802,14 @@ void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
// Leave the frame (also dropping the register file). |
__ leave(); |
- // Return droping receiver + arguments. |
- // TODO(rmcilroy): Get number of arguments from BytecodeArray. |
- __ Ret(1 * kPointerSize, rcx); |
+ |
+ // Drop receiver + arguments and return. |
+ __ movl(rbx, FieldOperand(kInterpreterBytecodeArrayRegister, |
+ BytecodeArray::kParameterSizeOffset)); |
+ __ PopReturnAddressTo(rcx); |
+ __ addp(rsp, rbx); |
+ __ PushReturnAddressFrom(rcx); |
+ __ ret(0); |
} |