/* Pop arguments off the stack */
/*
* FIXME: LLVM doesn't push these, we can't use ji->from_llvm as it describes
- * the caller.
+ * the callee.
*/
#ifndef ENABLE_LLVM
if (ji->has_arch_eh_info)
MonoMethod *method = (*lmf)->method;
MonoJitArgumentInfo *arg_info = g_newa (MonoJitArgumentInfo, mono_method_signature (method)->param_count + 1);
- guint32 stack_to_pop = mono_arch_get_argument_info (mono_method_signature (method), mono_method_signature (method)->param_count, arg_info);
+ guint32 stack_to_pop = mono_arch_get_argument_info (NULL, mono_method_signature (method), mono_method_signature (method)->param_count, arg_info);
new_ctx->esp += stack_to_pop;
}
#endif
/* the signature is: restore (MonoContinuation *cont, int state, MonoLMF **lmf_addr) */
/* put cont in edx */
x86_mov_reg_membase (code, X86_EDX, X86_ESP, 4, 4);
+ /* state in eax, so it's setup as the return value */
+ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 8, 4);
+
/* setup the copy of the stack */
x86_mov_reg_membase (code, X86_ECX, X86_EDX, G_STRUCT_OFFSET (MonoContinuation, stack_used_size), 4);
x86_shift_reg_imm (code, X86_SHR, X86_ECX, 2);
/*x86_mov_reg_membase (code, X86_ECX, X86_ESP, 12, 4);
x86_mov_membase_reg (code, X86_ECX, 0, X86_EDX, 4);*/
- /* state in eax, so it's setup as the return value */
- x86_mov_reg_membase (code, X86_EAX, X86_ESP, 8, 4);
x86_jump_membase (code, X86_EDX, G_STRUCT_OFFSET (MonoContinuation, return_ip));
g_assert ((code - start) <= 48);
saved = start;