m->inline_info = 1;
m->wrapper_type = type;
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
mb->code_size = 40;
mb->code = (unsigned char *)g_malloc (mb->code_size);
mb->init_locals = TRUE;
void
mono_mb_free (MonoMethodBuilder *mb)
{
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
GList *l;
for (l = mb->locals_list; l; l = l->next) {
MonoMethod *
mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack)
{
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
MonoMethodHeader *header;
#endif
MonoMethodWrapper *mw;
image = mb->method->klass->image;
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
if (mb->dynamic) {
method = mb->method;
mw = (MonoMethodWrapper*)method;
else
method->name = mono_image_strdup (image, mb->name);
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
mw->header = header = (MonoMethodHeader *)
mono_image_alloc0 (image, MONO_SIZEOF_METHOD_HEADER + mb->locals * sizeof (MonoType *));
#endif
}
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
/* Free the locals list so mono_mb_free () doesn't free the types twice */
g_list_free (mb->locals_list);
mb->locals_list = NULL;
if (!signature->hasthis)
method->flags |= METHOD_ATTRIBUTE_STATIC;
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
if (max_stack < 8)
max_stack = 8;
mw->method_data = data;
}
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
/*{
static int total_code = 0;
static int total_alloc = 0;
return g_list_length ((GList *)mw->method_data);
}
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
/**
* mono_mb_add_local:
mono_mb_emit_exception_full (mb, "System", exc_name, msg);
}
+/**
+ * mono_mb_emit_exception_for_error:
+ */
+void
+mono_mb_emit_exception_for_error (MonoMethodBuilder *mb, MonoError *error)
+{
+ /*
+ * If at some point there is need to support other types of errors,
+ * the behaviour should conform with mono_error_prepare_exception().
+ */
+ g_assert (mono_error_get_error_code (error) == MONO_ERROR_GENERIC && "Unsupported error code.");
+ mono_mb_emit_exception_full (mb, "System", mono_error_get_exception_name (error), mono_error_get_message (error));
+}
+
/**
* mono_mb_emit_add_to_local:
*/