return sp;
}
+// varargs in wasm consumes extra linear stack per call-site.
+// These g_warning/g_error wrappers fix that. It is not the
+// small wasm stack, but conserving it is still desirable.
+static void
+g_warning_d (const char *format, int d)
+{
+ g_warning (format, d);
+}
+
+static void
+g_warning_ds (const char *format, int d, const char *s)
+{
+ g_warning (format, d, s);
+}
+
+static void
+g_error_xsx (const char *format, int x1, const char *s, int x2)
+{
+ g_error (format, x1, s, x2);
+}
+
/*
* If EXIT_AT_FINALLY is not -1, exit after exiting the finally clause with that index.
* If BASE_FRAME is not NULL, copy arguments/locals from BASE_FRAME.
--sp;
*frame->retval = *sp;
if (sp > frame->stack)
- g_warning ("ret: more values on stack: %d", sp-frame->stack);
+ g_warning_d ("ret: more values on stack: %d", sp -frame->stack);
goto exit_frame;
MINT_IN_CASE(MINT_RET_VOID)
if (sp > frame->stack)
- g_warning ("ret.void: more values on stack: %d %s", sp-frame->stack, mono_method_full_name (frame->imethod->method, TRUE));
+ g_warning_ds ("ret.void: more values on stack: %d %s", sp - frame->stack, mono_method_full_name (frame->imethod->method, TRUE));
goto exit_frame;
MINT_IN_CASE(MINT_RET_VT) {
int const i32 = READ32 (ip + 1);
--sp;
memcpy(frame->retval->data.p, sp->data.p, i32);
if (sp > frame->stack)
- g_warning ("ret.vt: more values on stack: %d", sp-frame->stack);
+ g_warning_d ("ret.vt: more values on stack: %d", sp - frame->stack);
goto exit_frame;
}
MINT_IN_CASE(MINT_BR_S)
stackval_from_data (mono_method_signature_internal (frame->imethod->method)->ret, frame->retval, sp->data.p,
mono_method_signature_internal (frame->imethod->method)->pinvoke);
if (sp > frame->stack)
- g_warning ("retobj: more values on stack: %d", sp-frame->stack);
+ g_warning_d ("retobj: more values on stack: %d", sp - frame->stack);
goto exit_frame;
MINT_IN_CASE(MINT_MONO_SGEN_THREAD_INFO)
sp->data.p = mono_tls_get_sgen_thread_info ();
#if !USE_COMPUTED_GOTO
default:
- g_error ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname (*ip), ip - frame->imethod->code);
+ g_error_xsx ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname (*ip), ip - frame->imethod->code);
#endif
}
}