Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 836093007: split api call stubs into accessor and function call stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index b6378bf7d56311ba8716d5d8b8f19fd558a366fc..d9875129cb0d1c70861be21fda12e9e9372e5583 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -706,12 +706,9 @@ void MacroAssembler::PrepareCallApiFunction(int arg_stack_space) {
void MacroAssembler::CallApiFunctionAndReturn(
- Register function_address,
- ExternalReference thunk_ref,
- Register thunk_last_arg,
- int stack_space,
- Operand return_value_operand,
- Operand* context_restore_operand) {
+ Register function_address, ExternalReference thunk_ref,
+ Register thunk_last_arg, int stack_space, Operand* stack_space_operand,
+ Operand return_value_operand, Operand* context_restore_operand) {
Label prologue;
Label promote_scheduled_exception;
Label exception_handled;
@@ -838,8 +835,18 @@ void MacroAssembler::CallApiFunctionAndReturn(
if (restore_context) {
movp(rsi, *context_restore_operand);
}
+ if (stack_space_operand != nullptr) {
+ movp(rbx, *stack_space_operand);
+ }
LeaveApiExitFrame(!restore_context);
- ret(stack_space * kPointerSize);
+ if (stack_space_operand != nullptr) {
+ DCHECK_EQ(stack_space, 0);
+ PopReturnAddressTo(rcx);
+ addq(rsp, rbx);
+ jmp(rcx);
+ } else {
+ ret(stack_space * kPointerSize);
+ }
bind(&promote_scheduled_exception);
{
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698