Index: src/ia32/macro-assembler-ia32.h |
=================================================================== |
--- src/ia32/macro-assembler-ia32.h (revision 5685) |
+++ src/ia32/macro-assembler-ia32.h (working copy) |
@@ -480,16 +480,17 @@ |
void CallCFunction(ExternalReference function, int num_arguments); |
void CallCFunction(Register function, int num_arguments); |
- void PushHandleScope(Register scratch); |
+ // 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); |
- // Pops a handle scope using the specified scratch register and |
- // ensuring that saved register is left unchanged. |
- void PopHandleScope(Register saved, Register scratch); |
+ // Tail call an API function (jump). Allocates HandleScope, extracts |
+ // returned value from handle and propagates exceptions. |
+ // Clobbers ebx, esi, edi and caller-save registers. |
+ void CallApiFunctionAndReturn(ApiFunction* function, int argc); |
- // As PopHandleScope, but does not perform a GC. Instead, returns a |
- // retry after GC failure object if GC is necessary. |
- Object* TryPopHandleScope(Register saved, Register scratch); |
- |
// Jump to a runtime routine. |
void JumpToExternalReference(const ExternalReference& ext); |
@@ -639,7 +640,10 @@ |
return Operand(object, index, scale, offset - kHeapObjectTag); |
} |
+// Generates an Operand for saving parameters after PrepareCallApiFunction. |
+Operand ApiParameterOperand(int index); |
+ |
#ifdef GENERATED_CODE_COVERAGE |
extern void LogGeneratedCodeCoverage(const char* file_line); |
#define CODE_COVERAGE_STRINGIFY(x) #x |