Index: src/x87/macro-assembler-x87.cc |
diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc |
index 96a05908a4cdde9eafcb2ed4a9f85cb6d964e7a8..2cf6afd239ad62c111d85f1aa04e7345f45ade15 100644 |
--- a/src/x87/macro-assembler-x87.cc |
+++ b/src/x87/macro-assembler-x87.cc |
@@ -2062,12 +2062,9 @@ void MacroAssembler::PrepareCallApiFunction(int argc) { |
void MacroAssembler::CallApiFunctionAndReturn( |
- Register function_address, |
- ExternalReference thunk_ref, |
- Operand thunk_last_arg, |
- int stack_space, |
- Operand return_value_operand, |
- Operand* context_restore_operand) { |
+ Register function_address, ExternalReference thunk_ref, |
+ Operand thunk_last_arg, int stack_space, Operand* stack_space_operand, |
+ Operand return_value_operand, Operand* context_restore_operand) { |
ExternalReference next_address = |
ExternalReference::handle_scope_next_address(isolate()); |
ExternalReference limit_address = |
@@ -2186,8 +2183,18 @@ void MacroAssembler::CallApiFunctionAndReturn( |
if (restore_context) { |
mov(esi, *context_restore_operand); |
} |
+ if (stack_space_operand != nullptr) { |
+ mov(ebx, *stack_space_operand); |
+ } |
LeaveApiExitFrame(!restore_context); |
- ret(stack_space * kPointerSize); |
+ if (stack_space_operand != nullptr) { |
+ DCHECK_EQ(0, stack_space); |
+ pop(ecx); |
+ add(esp, ebx); |
+ jmp(ecx); |
+ } else { |
+ ret(stack_space * kPointerSize); |
+ } |
bind(&promote_scheduled_exception); |
{ |