void
mono_generic_class_init (MonoVTable *vtable);
-void mono_interruption_checkpoint_from_trampoline (void);
-
MonoObject*
mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gboolean deref_arg, gpointer *args);
gpointer
mono_magic_trampoline (mgreg_t *regs, guint8 *code, gpointer arg, guint8* tramp)
{
- MonoError error;
gpointer res;
+ MONO_PREPARE_RESET_BLOCKING_UNBALANCED;
+
+ MonoError error;
+
trampoline_calls ++;
res = common_call_trampoline (regs, code, (MonoMethod *)arg, NULL, NULL, &error);
- if (!mono_error_ok (&error)) {
- mono_error_set_pending_exception (&error);
- return NULL;
- }
+ mono_error_set_pending_exception (&error);
+
+ mono_interruption_checkpoint_from_trampoline ();
+
+ MONO_FINISH_RESET_BLOCKING_UNBALANCED;
+
return res;
}
*/
void mono_exception_native_unwind (void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info);
+/*
+ * Coop support for trampolines
+ */
+void mono_interruption_checkpoint_from_trampoline (void);
#endif /* __MONO_MINI_H__ */
void
mono_threads_reset_blocking_end_unbalanced (gpointer cookie, gpointer *stackdata);
+#define MONO_PREPARE_RESET_BLOCKING_UNBALANCED \
+ do { \
+ gpointer __dummy; \
+ gpointer __reset_cookie = mono_threads_reset_blocking_start_unbalanced (&__dummy)
+
+#define MONO_FINISH_RESET_BLOCKING_UNBALANCED \
+ mono_threads_reset_blocking_end_unbalanced (__reset_cookie, &__dummy); \
+ } while (0)
+
G_END_DECLS
#endif