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

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

Issue 5108003: API call code refactoring (x64). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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/code-stubs-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.h
===================================================================
--- src/x64/macro-assembler-x64.h (revision 5834)
+++ src/x64/macro-assembler-x64.h (working copy)
@@ -160,14 +160,18 @@
// accessible via StackSpaceOperand.
void EnterExitFrame(int arg_stack_space = 0);
- void EnterApiExitFrame(int stack_space,
- int arg_stack_space);
+ // Enter specific kind of exit frame. Allocates arg_stack_space * kPointerSize
+ // memory (not GCed) on the stack accessible via StackSpaceOperand.
+ void EnterApiExitFrame(int arg_stack_space);
// Leave the current exit frame. Expects/provides the return value in
// register rax:rdx (untouched) and the pointer to the first
// argument in register rsi.
- void LeaveExitFrame(int result_size = 1);
+ void LeaveExitFrame();
+ // Leave the current exit frame. Expects/provides the return value in
+ // register rax (untouched).
+ void LeaveApiExitFrame();
// ---------------------------------------------------------------------------
// JavaScript invokes
@@ -835,23 +839,18 @@
int result_size);
// Prepares stack to put arguments (aligns and so on).
- // Uses callee-saved rsi to restore stack state after call. WIN64 calling
- // convention requires to put the pointer to the return value slot into rcx
- // (rcx must be preserverd until TryCallApiFunctionAndReturn). argc is number
- // of arguments to be passed in C-function. stack_space * kPointerSize bytes
- // will be removed from stack after the call. Saves context (rsi).
- // Clobbers rax. Allocates arg_stack_space * kPointerSize inside the exit
- // frame (not GCed).
- //
- // Assumes stack_space GCed references on top of the stack and return address.
- // After call they will be removed.
- void PrepareCallApiFunction(int stack_space, int arg_stack_space);
+ // WIN64 calling convention requires to put the pointer to the return value
+ // slot into rcx (rcx must be preserverd until TryCallApiFunctionAndReturn).
+ // Saves context (rsi). Clobbers rax. Allocates arg_stack_space * kPointerSize
+ // inside the exit frame (not GCed) accessible via StackSpaceOperand.
+ void PrepareCallApiFunction(int arg_stack_space);
// Calls an API function. Allocates HandleScope, extracts
// returned value from handle and propagates exceptions.
// Clobbers r12, r14, rbx and caller-save registers. Restores context.
+ // On return removes stack_space * kPointerSize (GCed).
MUST_USE_RESULT MaybeObject* TryCallApiFunctionAndReturn(
- ApiFunction* function);
+ ApiFunction* function, int stack_space);
// Before calling a C-function from generated code, align arguments on stack.
// After aligning the frame, arguments must be stored in esp[0], esp[4],
@@ -947,6 +946,8 @@
// accessible via StackSpaceOperand.
void EnterExitFrameEpilogue(int arg_stack_space);
+ void LeaveExitFrameEpilogue();
+
// Allocation support helpers.
// Loads the top of new-space into the result register.
// If flags contains RESULT_CONTAINS_TOP then result_end is valid and
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698