Index: src/ia32/macro-assembler-ia32.h |
=================================================================== |
--- src/ia32/macro-assembler-ia32.h (revision 5846) |
+++ src/ia32/macro-assembler-ia32.h (working copy) |
@@ -123,13 +123,17 @@ |
// to the first argument in register esi. |
void EnterExitFrame(); |
- void EnterApiExitFrame(int stack_space, int argc); |
+ void EnterApiExitFrame(int argc); |
// Leave the current exit frame. Expects the return value in |
// register eax:edx (untouched) and the pointer to the first |
// argument in register esi. |
void LeaveExitFrame(); |
+ // Leave the current exit frame. Expects the return value in |
+ // register eax (untouched). |
+ void LeaveApiExitFrame(); |
+ |
// Find the function context up the context chain. |
void LoadContext(Register dst, int context_chain_length); |
@@ -460,11 +464,23 @@ |
int num_arguments, |
int result_size); |
+ // Tail call of a runtime routine (jump). Try to generate the code if |
+ // necessary. Do not perform a GC but instead return a retry after GC failure. |
+ MUST_USE_RESULT MaybeObject* TryTailCallExternalReference( |
+ const ExternalReference& ext, int num_arguments, int result_size); |
+ |
// Convenience function: tail call a runtime routine (jump). |
void TailCallRuntime(Runtime::FunctionId fid, |
int num_arguments, |
int result_size); |
+ // Convenience function: tail call a runtime routine (jump). Try to generate |
+ // the code if necessary. Do not perform a GC but instead return a retry after |
+ // GC failure. |
+ MUST_USE_RESULT MaybeObject* TryTailCallRuntime(Runtime::FunctionId fid, |
+ int num_arguments, |
+ int result_size); |
+ |
// 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], |
// etc., not pushed. The argument count assumes all arguments are word sized. |
@@ -485,18 +501,23 @@ |
// Prepares stack to put arguments (aligns and so on). Reserves |
// space for return value if needed (assumes the return value is a handle). |
// Uses callee-saved esi to restore stack state after call. Arguments must be |
- // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. |
- void PrepareCallApiFunction(int stack_space, int argc); |
+ // stored in ApiParameterOperand(0), ApiParameterOperand(1) etc. Saves |
+ // context (esi). |
+ void PrepareCallApiFunction(int argc, Register scratch); |
// Calls an API function. Allocates HandleScope, extracts |
// returned value from handle and propagates exceptions. |
- // Clobbers ebx, esi, edi and caller-save registers. |
- void CallApiFunctionAndReturn(ApiFunction* function, int argc); |
+ // Clobbers ebx, edi and caller-save registers. Restores context. |
+ // On return removes stack_space * kPointerSize (GCed). |
+ MaybeObject* TryCallApiFunctionAndReturn(ApiFunction* function, |
+ int stack_space); |
// Jump to a runtime routine. |
void JumpToExternalReference(const ExternalReference& ext); |
+ MaybeObject* TryJumpToExternalReference(const ExternalReference& ext); |
+ |
// --------------------------------------------------------------------------- |
// Utilities |
@@ -589,6 +610,8 @@ |
void EnterExitFramePrologue(); |
void EnterExitFrameEpilogue(int argc); |
+ void LeaveExitFrameEpilogue(); |
+ |
// Allocation support helpers. |
void LoadAllocationTopHelper(Register result, |
Register result_end, |
@@ -642,6 +665,17 @@ |
return Operand(object, index, scale, offset - kHeapObjectTag); |
} |
+ |
+static inline Operand ContextOperand(Register context, int index) { |
+ return Operand(context, Context::SlotOffset(index)); |
+} |
+ |
+ |
+static inline Operand GlobalObjectOperand() { |
+ return ContextOperand(esi, Context::GLOBAL_INDEX); |
+} |
+ |
+ |
// Generates an Operand for saving parameters after PrepareCallApiFunction. |
Operand ApiParameterOperand(int index); |