Index: src/x64/macro-assembler-x64.h |
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h |
index 64f35e10de3e50df682d9f6830410be0d30b8146..7a90dd0175e5285669c086fba76ad450d568106b 100644 |
--- a/src/x64/macro-assembler-x64.h |
+++ b/src/x64/macro-assembler-x64.h |
@@ -163,6 +163,11 @@ class MacroAssembler: public Assembler { |
// to the first argument in register rsi. |
void EnterExitFrame(ExitFrame::Mode mode, int result_size = 1); |
+ void EnterApiExitFrame(ExitFrame::Mode mode, |
+ int stack_space, |
+ int argc, |
+ int result_size = 1); |
+ |
// 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. |
@@ -719,18 +724,36 @@ class MacroAssembler: public Assembler { |
// Call a code stub. |
void CallStub(CodeStub* stub); |
+ // Call a code stub and return the code object called. Try to generate |
+ // the code if necessary. Do not perform a GC but instead return a retry |
+ // after GC failure. |
+ Object* TryCallStub(CodeStub* stub); |
+ |
// Tail call a code stub (jump). |
void TailCallStub(CodeStub* stub); |
+ // Tail call a code stub (jump) and return the code object called. Try to |
+ // generate the code if necessary. Do not perform a GC but instead return |
+ // a retry after GC failure. |
+ Object* TryTailCallStub(CodeStub* stub); |
+ |
// Return from a code stub after popping its arguments. |
void StubReturn(int argc); |
// Call a runtime routine. |
void CallRuntime(Runtime::Function* f, int num_arguments); |
+ // Call a runtime function, returning the CodeStub object called. |
+ // Try to generate the stub code if necessary. Do not perform a GC |
+ // but instead return a retry after GC failure. |
+ Object* TryCallRuntime(Runtime::Function* f, int num_arguments); |
+ |
// Convenience function: Same as above, but takes the fid instead. |
void CallRuntime(Runtime::FunctionId id, int num_arguments); |
+ // Convenience function: Same as above, but takes the fid instead. |
+ Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments); |
+ |
// Convenience function: call an external reference. |
void CallExternalReference(const ExternalReference& ext, |
int num_arguments); |
@@ -747,6 +770,16 @@ class MacroAssembler: public Assembler { |
int num_arguments, |
int result_size); |
+ void PushHandleScope(Register scratch); |
+ |
+ // Pops a handle scope using the specified scratch register and |
+ // ensuring that saved register is left unchanged. |
+ void PopHandleScope(Register saved, Register scratch); |
+ |
+ // 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, int result_size); |
@@ -835,6 +868,9 @@ class MacroAssembler: public Assembler { |
void EnterFrame(StackFrame::Type type); |
void LeaveFrame(StackFrame::Type type); |
+ void EnterExitFramePrologue(ExitFrame::Mode mode, bool save_rax); |
+ void EnterExitFrameEpilogue(ExitFrame::Mode mode, int result_size, int argc); |
+ |
// 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 |
@@ -848,6 +884,13 @@ class MacroAssembler: public Assembler { |
// Update allocation top with value in result_end register. |
// If scratch is valid, it contains the address of the allocation top. |
void UpdateAllocationTopHelper(Register result_end, Register scratch); |
+ |
+ // Helper for PopHandleScope. Allowed to perform a GC and returns |
+ // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
+ // possibly returns a failure object indicating an allocation failure. |
+ Object* PopHandleScopeHelper(Register saved, |
+ Register scratch, |
+ bool gc_allowed); |
}; |