Stack fixes.

This commit is contained in:
Ben Vanik
2014-02-02 12:28:40 -08:00
parent e5e490ca9b
commit 544d453691
7 changed files with 61 additions and 34 deletions

View File

@@ -231,7 +231,7 @@ void IssueCall(X64Emitter& e, FunctionInfo* symbol_info, uint32_t flags) {
// Actually jump/call to rax.
if (flags & CALL_TAIL) {
e.add(e.rsp, StackLayout::GUEST_STACK_SIZE);
e.add(e.rsp, (uint32_t)e.stack_size());
e.jmp(e.rax);
} else {
e.call(e.rax);
@@ -250,7 +250,7 @@ void IssueCallIndirect(X64Emitter& e, Value* target, uint32_t flags) {
// Actually jump/call to rax.
if (flags & CALL_TAIL) {
e.add(e.rsp, StackLayout::GUEST_STACK_SIZE);
e.add(e.rsp, (uint32_t)e.stack_size());
e.jmp(e.rax);
} else {
e.call(e.rax);
@@ -397,6 +397,7 @@ table->AddSequence(OPCODE_CALL_EXTERN, [](X64Emitter& e, Instr*& i) {
e.mov(e.r8, (uint64_t)symbol_info->extern_arg0());
e.mov(e.r9, (uint64_t)symbol_info->extern_arg1());
TransitionToHost(e);
ReloadRDX(e);
}
i = e.Advance(i);
return true;