diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index 325e0c5fd163..532e80796ec2 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -99,7 +99,7 @@ #include -#define THREAD_TO_INTERNAL(thread) VM_THREAD_GET_INTERNAL(thread) +#define THREAD_TO_INTERNAL(thread) thread->internal_thread #include "debugger-agent.h" @@ -3342,7 +3342,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls) if (tls->frames && tls->frames_up_to_date) return; - DEBUG_PRINTF (1, "Frames for %p(tid=%lx):\n", thread, VM_INTERNAL_THREAD_GET_ID(thread)); + DEBUG_PRINTF (1, "Frames for %p(tid=%lx):\n", thread, thread->tid); user_data.tls = tls; user_data.frames = NULL; @@ -3715,7 +3715,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, DebuggerEv } else if (mod->kind == MOD_KIND_TYPE_NAME_ONLY && ei && ei->klass) { char *s; - s = mono_type_full_name (VM_CLASS_GET_TYPE(ei->klass)); + s = mono_type_full_name (&ei->klass->byval_arg); if (!g_hash_table_lookup (mod->data.type_names, s)) filtered = TRUE; g_free (s); @@ -4063,7 +4063,7 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) if (is_debugger_thread ()) return; - g_assert (mono_native_thread_id_equals (MONO_UINT_TO_NATIVE_THREAD_ID (tid), MONO_UINT_TO_NATIVE_THREAD_ID (VM_INTERNAL_THREAD_GET_ID(thread)))); + g_assert (mono_native_thread_id_equals (MONO_UINT_TO_NATIVE_THREAD_ID (tid), MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid))); mono_loader_lock (); old_thread = (MonoInternalThread *)mono_g_hash_table_lookup (tid_to_thread, GUINT_TO_POINTER (tid)); @@ -4311,7 +4311,7 @@ send_assemblies_for_domain (MonoDomain *domain, void *user_data) void *iter = NULL; MonoAssembly *ass; - while (ass = VM_DOMAIN_GET_ASSEMBLIES(domain, &iter)) + while (ass = mono_domain_get_assemblies_iter(domain, &iter)) emit_assembly_load(ass, NULL); mono_domain_assemblies_unlock (domain); @@ -5759,7 +5759,7 @@ process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal, uint64_t gboolean found = FALSE; for (int k = 0; ss_req->user_assemblies[k]; k++) { - if (ss_req->user_assemblies[k] == VM_IMAGE_GET_ASSEMBLY(VM_CLASS_GET_IMAGE(VM_METHOD_GET_DECLARING_TYPE(sequence_pt->method)))) + if (ss_req->user_assemblies[k] == sequence_pt->method->klass->image->assembly) { found = TRUE; break; @@ -6721,7 +6721,7 @@ unity_debugger_agent_handle_exception(MonoException *exc, Il2CppSequencePointC * if (assemblies) { for (k = 0; assemblies[k]; ++k) - if (assemblies[k] == VM_IMAGE_GET_ASSEMBLY(VM_CLASS_GET_IMAGE(VM_METHOD_GET_DECLARING_TYPE(sequencePoint->method)))) + if (assemblies[k] == sequencePoint->method->klass->image->assembly) found = TRUE; } if (!found) @@ -7070,7 +7070,7 @@ static void buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDom } buffer_add_byte (buf, MONO_TYPE_VALUETYPE); - buffer_add_byte (buf, VM_CLASS_GET_ENUMTYPE(klass)); + buffer_add_byte (buf, klass->enumtype); buffer_add_typeid (buf, domain, klass); nfields = 0; @@ -7213,7 +7213,7 @@ static void buffer_add_value_full(Buffer *buf, MonoType *t, void *addr, MonoDoma } else { - Il2CppMonoClass *klass = il2cpp_object_get_class(obj); + MonoClass *klass = il2cpp_object_get_class(obj); if (il2cpp_class_is_valuetype(klass)) { t = il2cpp_class_get_type(il2cpp_object_get_class(obj)); @@ -7274,16 +7274,16 @@ static void buffer_add_value_full(Buffer *buf, MonoType *t, void *addr, MonoDoma } buffer_add_byte(buf, MONO_TYPE_VALUETYPE); - buffer_add_byte(buf, VM_CLASS_GET_ENUMTYPE(klass)); + buffer_add_byte(buf, klass->enumtype); buffer_add_typeid(buf, domain, klass); nfields = 0; iter = NULL; while ((f = mono_class_get_fields(klass, &iter))) { - if (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC) + if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) continue; - if (VM_FIELD_IS_DELETED(f)) + if (mono_field_is_deleted(f)) continue; nfields++; } @@ -7292,11 +7292,11 @@ static void buffer_add_value_full(Buffer *buf, MonoType *t, void *addr, MonoDoma iter = NULL; while ((f = mono_class_get_fields(klass, &iter))) { - if (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC) + if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) continue; - if (VM_FIELD_IS_DELETED(f)) + if (mono_field_is_deleted(f)) continue; - buffer_add_value_full(buf, VM_FIELD_GET_TYPE(f), (guint8*)addr + VM_FIELD_GET_OFFSET(f) - sizeof(MonoObject), domain, FALSE, parent_vtypes); + buffer_add_value_full(buf, f->type, (guint8*)addr + f->offset - sizeof(MonoObject), domain, FALSE, parent_vtypes); } if (boxed_vtype) @@ -7381,11 +7381,11 @@ decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 nfields = decode_int (buf, &buf, limit); while ((f = mono_class_get_fields (klass, &iter))) { - if (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC) + if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) continue; - if (VM_FIELD_IS_DELETED(f)) + if (mono_field_is_deleted(f)) continue; - err = decode_value (VM_FIELD_GET_TYPE(f), domain, (guint8*)addr + VM_FIELD_GET_OFFSET(f) - sizeof (MonoObject), buf, &buf, limit); + err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit); if (err != ERR_NONE) return err; nfields --; @@ -7402,19 +7402,19 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, { ErrorCode err; - if (type != VM_TYPE_GET_TYPE(t) && !MONO_TYPE_IS_REFERENCE (t) && - !(VM_TYPE_GET_TYPE(t) == MONO_TYPE_I && type == MONO_TYPE_VALUETYPE) && - !(VM_TYPE_GET_TYPE(t) == MONO_TYPE_U && type == MONO_TYPE_VALUETYPE) && - !(VM_TYPE_GET_TYPE(t) == MONO_TYPE_PTR && type == MONO_TYPE_I8) && - !(VM_TYPE_GET_TYPE(t) == MONO_TYPE_GENERICINST && type == MONO_TYPE_VALUETYPE) && - !(VM_TYPE_GET_TYPE(t) == MONO_TYPE_VALUETYPE && type == MONO_TYPE_OBJECT)) { + if (type != t->type && !MONO_TYPE_IS_REFERENCE (t) && + !(t->type == MONO_TYPE_I && type == MONO_TYPE_VALUETYPE) && + !(t->type == MONO_TYPE_U && type == MONO_TYPE_VALUETYPE) && + !(t->type == MONO_TYPE_PTR && type == MONO_TYPE_I8) && + !(t->type == MONO_TYPE_GENERICINST && type == MONO_TYPE_VALUETYPE) && + !(t->type == MONO_TYPE_VALUETYPE && type == MONO_TYPE_OBJECT)) { char *name = mono_type_full_name (t); DEBUG_PRINTF (1, "[%p] Expected value of type %s, got 0x%0x.\n", (gpointer) (gsize) mono_native_thread_id_get (), name, type); g_free (name); return ERR_INVALID_ARGUMENT; } - switch (VM_TYPE_GET_TYPE(t)) { + switch (t->type) { case MONO_TYPE_BOOLEAN: *(guint8*)addr = decode_int (buf, &buf, limit); break; @@ -7483,7 +7483,7 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, if (!obj) return ERR_INVALID_ARGUMENT; if (VM_OBJECT_GET_CLASS(obj) != mono_class_from_mono_type (t)) { - DEBUG_PRINTF (1, "Expected type '%s', got object '%s'\n", mono_type_full_name (t), VM_CLASS_GET_NAME(VM_OBJECT_GET_CLASS(obj))); + DEBUG_PRINTF (1, "Expected type '%s', got object '%s'\n", mono_type_full_name (t), VM_OBJECT_GET_CLASS(obj)->name); return ERR_INVALID_ARGUMENT; } memcpy (addr, mono_object_unbox (obj), mono_class_value_size (VM_OBJECT_GET_CLASS(obj), NULL)); @@ -7577,8 +7577,8 @@ decode_value (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 ErrorCode err; int type = decode_byte (buf, &buf, limit); - if (VM_TYPE_GET_TYPE(t) == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { - MonoType *targ = VM_GENERIC_INST_TYPE_ARG(VM_GENERIC_CLASS_GET_INST(VM_TYPE_GET_GENERIC_CLASS(t)), 0); + if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { + MonoType *targ = t->data.generic_class->context.class_inst->type_argv[0]; guint8 *nullable_buf; /* @@ -7997,7 +7997,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 * Invoke this method directly, currently only Environment.Exit () is supported. */ this_arg = NULL; - DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer) (gsize) mono_native_thread_id_get (), mono_method_full_name (invoke->method, TRUE), this_arg ? VM_CLASS_GET_NAME(VM_OBJECT_GET_CLASS(this_arg)) : ""); + DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer) (gsize) mono_native_thread_id_get (), mono_method_full_name (invoke->method, TRUE), this_arg ? VM_OBJECT_GET_CLASS(this_arg)->name : ""); mono_runtime_try_invoke (invoke->method, NULL, invoke->args, &exc, &error); mono_error_assert_ok (&error); @@ -8010,79 +8010,79 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 return err; sig = mono_method_signature (m); - if (VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m))) - this_buf = (guint8 *)g_alloca (mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); + if (m->klass->valuetype) + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); else this_buf = (guint8 *)g_alloca (sizeof (MonoObject*)); - if (VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m)) && (VM_METHOD_GET_FLAGS(m) & METHOD_ATTRIBUTE_STATIC)) { + if (m->klass->valuetype && (m->flags & METHOD_ATTRIBUTE_STATIC)) { /* Should be null */ int type = decode_byte (p, &p, end); if (type != VALUE_TYPE_ID_NULL) { DEBUG_PRINTF (1, "[%p] Error: Static vtype method invoked with this argument.\n", (gpointer) (gsize) mono_native_thread_id_get ()); return ERR_INVALID_ARGUMENT; } - memset (this_buf, 0, mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); - } else if (VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m)) && !strcmp (VM_METHOD_GET_NAME(m), ".ctor")) { + memset (this_buf, 0, mono_class_instance_size (m->klass)); + } else if (m->klass->valuetype && !strcmp (m->name, ".ctor")) { /* Could be null */ guint8 *tmp_p; int type = decode_byte (p, &tmp_p, end); if (type == VALUE_TYPE_ID_NULL) { - memset (this_buf, 0, mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); + memset (this_buf, 0, mono_class_instance_size (m->klass)); p = tmp_p; } else { - err = decode_value(VM_CLASS_GET_TYPE(VM_METHOD_GET_DECLARING_TYPE(m)), domain, this_buf, p, &p, end); + err = decode_value(&m->klass->byval_arg, domain, this_buf, p, &p, end); if (err != ERR_NONE) return err; } } else { - err = decode_value (VM_CLASS_GET_TYPE(VM_METHOD_GET_DECLARING_TYPE(m)), domain, this_buf, p, &p, end); + err = decode_value (&m->klass->byval_arg, domain, this_buf, p, &p, end); if (err != ERR_NONE) return err; } - if (!VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m))) + if (!m->klass->valuetype) this_arg = *(MonoObject**)this_buf; else this_arg = NULL; - if (VM_CLASS_IS_INTERFACE (VM_METHOD_GET_DECLARING_TYPE(m))) { + if (MONO_CLASS_IS_INTERFACE (m->klass)) { if (!this_arg) { DEBUG_PRINTF (1, "[%p] Error: Interface method invoked without this argument.\n", (gpointer) (gsize) mono_native_thread_id_get ()); return ERR_INVALID_ARGUMENT; } m = mono_object_get_virtual_method (this_arg, m); /* Transform this to the format the rest of the code expects it to be */ - if (VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m))) { - this_buf = (guint8 *)g_alloca (mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); - memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); + if (m->klass->valuetype) { + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); + memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass)); } - } else if ((VM_METHOD_GET_FLAGS(m) & METHOD_ATTRIBUTE_VIRTUAL) && !VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m)) && invoke->flags & INVOKE_FLAG_VIRTUAL) { + } else if ((m->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m->klass->valuetype && invoke->flags & INVOKE_FLAG_VIRTUAL) { if (!this_arg) { DEBUG_PRINTF (1, "[%p] Error: invoke with INVOKE_FLAG_VIRTUAL flag set without this argument.\n", (gpointer) (gsize) mono_native_thread_id_get ()); return ERR_INVALID_ARGUMENT; } m = mono_object_get_virtual_method (this_arg, m); - if (VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m))) { - this_buf = (guint8 *)g_alloca (mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); - memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (VM_METHOD_GET_DECLARING_TYPE(m))); + if (m->klass->valuetype) { + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); + memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass)); } } - DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer) (gsize) mono_native_thread_id_get (), mono_method_full_name (m, TRUE), this_arg ? VM_CLASS_GET_NAME(VM_OBJECT_GET_CLASS(this_arg)) : ""); + DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer) (gsize) mono_native_thread_id_get (), mono_method_full_name (m, TRUE), this_arg ? VM_OBJECT_GET_CLASS(this_arg)->name : ""); if (this_arg && VM_OBJECT_GET_DOMAIN(this_arg) != domain) NOT_IMPLEMENTED; - if (!VM_CLASS_IS_VALUETYPE(VM_METHOD_GET_DECLARING_TYPE(m)) && !(VM_METHOD_GET_FLAGS(m) & METHOD_ATTRIBUTE_STATIC) && !this_arg) { - if (!strcmp (VM_METHOD_GET_NAME(m), ".ctor")) { - if (mono_class_is_abstract (VM_METHOD_GET_DECLARING_TYPE(m))) + if (!m->klass->valuetype && !(m->flags & METHOD_ATTRIBUTE_STATIC) && !this_arg) { + if (!strcmp (m->name, ".ctor")) { + if (mono_class_is_abstract (m->klass)) return ERR_INVALID_ARGUMENT; else { MonoError error; - this_arg = mono_object_new_checked (domain, VM_METHOD_GET_DECLARING_TYPE(m), &error); + this_arg = mono_object_new_checked (domain, m->klass, &error); mono_error_assert_ok (&error); } } else { @@ -8090,7 +8090,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 } } - if (this_arg && !obj_is_of_type (this_arg, VM_CLASS_GET_TYPE(VM_METHOD_GET_DECLARING_TYPE(m)))) + if (this_arg && !obj_is_of_type (this_arg, &m->klass->byval_arg)) return ERR_INVALID_ARGUMENT; nargs = decode_int (p, &p, end); @@ -8108,7 +8108,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 if (args [i] && VM_OBJECT_GET_DOMAIN(((MonoObject*)args [i])) != domain) NOT_IMPLEMENTED; - if (VM_TYPE_IS_BYREF(sig->params [i])) { + if (sig->params [i]->byref) { arg_buf [i] = (guint8 *)g_alloca (sizeof (mgreg_t)); *(gpointer*)arg_buf [i] = args [i]; args [i] = arg_buf [i]; @@ -8157,17 +8157,17 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 #endif mono_stopwatch_start (&watch); - res = mono_runtime_try_invoke (m, VM_CLASS_IS_VALUETYPE (VM_METHOD_GET_DECLARING_TYPE (m)) ? (gpointer)this_buf : (gpointer)this_arg, args, &exc, &error); + res = mono_runtime_try_invoke (m, m->klass->valuetype ? (gpointer)this_buf : (gpointer)this_arg, args, &exc, &error); if (!mono_error_ok (&error) && exc == NULL) { exc = (MonoObject*) mono_error_convert_to_exception (&error); } else { mono_error_cleanup (&error); /* FIXME report error */ } mono_stopwatch_stop (&watch); - DEBUG_PRINTF (1, "[%p] Invoke result: %p, exc: %s, time: %ld ms.\n", (gpointer) (gsize) mono_native_thread_id_get (), res, exc ? VM_CLASS_GET_NAME (VM_OBJECT_GET_CLASS (exc)) : NULL, (long)mono_stopwatch_elapsed_ms (&watch)); + DEBUG_PRINTF (1, "[%p] Invoke result: %p, exc: %s, time: %ld ms.\n", (gpointer) (gsize) mono_native_thread_id_get (), res, exc ? VM_OBJECT_GET_CLASS (exc)->name : NULL, (long)mono_stopwatch_elapsed_ms (&watch)); if (exc) { buffer_add_byte (buf, 0); - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_DEFAULTS_OBJECT_CLASS), &exc, domain); + buffer_add_value (buf, &VM_DEFAULTS_OBJECT_CLASS->byval_arg, &exc, domain); } else { gboolean out_this = FALSE; gboolean out_args = FALSE; @@ -8179,18 +8179,18 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 buffer_add_byte (buf, 1 + (out_this ? 2 : 0) + (out_args ? 4 : 0)); if (VM_METHOD_IS_STRING_CTOR(m)) { buffer_add_value (buf, &mono_get_string_class ()->byval_arg, &res, domain); - } else if (VM_TYPE_GET_TYPE (sig->ret) == MONO_TYPE_VOID && !VM_METHOD_IS_STRING_CTOR(m)) { - if (!strcmp (VM_METHOD_GET_NAME (m), ".ctor")) { - if (!VM_CLASS_IS_VALUETYPE (VM_METHOD_GET_DECLARING_TYPE (m))) - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_DEFAULTS_OBJECT_CLASS), &this_arg, domain); + } else if ( sig->ret->type == MONO_TYPE_VOID && !VM_METHOD_IS_STRING_CTOR(m)) { + if (!strcmp (m->name, ".ctor")) { + if (!m->klass->valuetype) + buffer_add_value (buf, &VM_DEFAULTS_OBJECT_CLASS->byval_arg, &this_arg, domain); else - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_METHOD_GET_DECLARING_TYPE (m)), this_buf, domain); + buffer_add_value (buf, &m->klass->byval_arg, this_buf, domain); } else { - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_DEFAULTS_VOID_CLASS), NULL, domain); + buffer_add_value (buf, &VM_DEFAULTS_VOID_CLASS->byval_arg, NULL, domain); } } else if (MONO_TYPE_IS_REFERENCE (sig->ret)) { buffer_add_value (buf, sig->ret, &res, domain); - } else if (VM_CLASS_IS_VALUETYPE (mono_class_from_mono_type (sig->ret)) || VM_TYPE_GET_TYPE (sig->ret) == MONO_TYPE_PTR || VM_TYPE_GET_TYPE (sig->ret) == MONO_TYPE_FNPTR) { + } else if (mono_class_from_mono_type (sig->ret)->valuetype || sig->ret->type == MONO_TYPE_PTR || sig->ret->type == MONO_TYPE_FNPTR) { if (mono_class_is_nullable (mono_class_from_mono_type (sig->ret))) { MonoClass *k = mono_class_from_mono_type (sig->ret); guint8 *nullable_buf = (guint8 *)g_alloca (mono_class_value_size (k, NULL)); @@ -8207,13 +8207,13 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 } if (out_this) /* Return the new value of the receiver after the call */ - buffer_add_value (buf, VM_CLASS_GET_TYPE(VM_METHOD_GET_DECLARING_TYPE(m)), this_buf, domain); + buffer_add_value (buf, &m->klass->byval_arg, this_buf, domain); if (out_args) { buffer_add_int (buf, nargs); for (i = 0; i < nargs; ++i) { if (MONO_TYPE_IS_REFERENCE (sig->params [i])) buffer_add_value (buf, sig->params [i], &args [i], domain); - else if (VM_TYPE_IS_BYREF(sig->params [i])) + else if (sig->params [i]->byref) /* add_value () does an indirection */ buffer_add_value (buf, sig->params [i], &arg_buf [i], domain); else @@ -8781,7 +8781,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) mono_domain_assemblies_lock (domain); void *iter = NULL; - while (ass = VM_DOMAIN_GET_ASSEMBLIES (domain, &iter)) + while (ass = mono_domain_get_assemblies_iter (domain, &iter)) { if (VM_ASSEMBLY_GET_IMAGE (ass)) { @@ -9316,12 +9316,12 @@ module_commands (int command, guint8 *p, guint8 *end, Buffer *buf) MonoImage *image = decode_moduleid (p, &p, end, &domain, &err); char *basename; - basename = g_path_get_basename (VM_IMAGE_GET_NAME(image)); + basename = g_path_get_basename (image->name); buffer_add_string (buf, basename); // name buffer_add_string (buf, VM_IMAGE_GET_MODULE_NAME(image)); // scopename - buffer_add_string (buf, VM_IMAGE_GET_NAME(image)); // fqname + buffer_add_string (buf, image->name); // fqname buffer_add_string (buf, mono_image_get_guid (image)); // guid - buffer_add_assemblyid (buf, domain, VM_IMAGE_GET_ASSEMBLY(image)); // assembly + buffer_add_assemblyid (buf, domain, image->assembly); // assembly g_free (basename); break; } @@ -9458,7 +9458,7 @@ collect_interfaces (MonoClass *klass, GHashTable *ifaces, MonoError *error) return; gpointer iter = NULL; - while (ic = VM_CLASS_GET_INTERFACES(klass, &iter)) { + while (ic = mono_class_get_interfaces(klass, &iter)) { g_hash_table_insert (ifaces, ic, ic); collect_interfaces (ic, ifaces, error); @@ -9538,17 +9538,17 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint int count, i; if (mono_class_is_ginst (klass)) { - MonoGenericInst *inst = VM_GENERIC_CLASS_GET_INST(mono_class_get_generic_class(klass)); + MonoGenericInst *inst = mono_class_get_generic_class(klass)->context.class_inst; - count = VM_GENERIC_INST_TYPE_ARGC(inst); + count = inst->type_argc; buffer_add_int (buf, count); for (i = 0; i < count; i++) - buffer_add_typeid (buf, domain, mono_class_from_mono_type (VM_GENERIC_INST_TYPE_ARG(inst, i))); + buffer_add_typeid (buf, domain, mono_class_from_mono_type (inst->type_argv[i])); } else if (mono_class_is_gtd (klass)) { MonoGenericContainer *container = mono_class_get_generic_container (klass); MonoClass *pklass; - count = VM_GENERIC_CONTAINER_GET_TYPE_ARGC(container); + count = container->type_argc; buffer_add_int (buf, count); for (i = 0; i < count; i++) { pklass = mono_class_from_generic_parameter_internal (mono_generic_container_get_param (container, i)); @@ -9591,9 +9591,9 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint while ((f = mono_class_get_fields (klass, &iter))) { buffer_add_fieldid (buf, domain, f); - buffer_add_string (buf, VM_FIELD_GET_NAME(f)); + buffer_add_string (buf, f->name); buffer_add_typeid (buf, domain, mono_class_from_mono_type (mono_field_get_type(f))); - buffer_add_int (buf, VM_TYPE_GET_ATTRS(mono_field_get_type(f))); + buffer_add_int (buf, mono_field_get_type(f)->attrs); i ++; } g_assert (i == nfields); @@ -9611,10 +9611,10 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint while ((p = mono_class_get_properties (klass, &iter))) { buffer_add_propertyid (buf, domain, p); - buffer_add_string (buf, VM_PROPERTY_GET_NAME(p)); - buffer_add_methodid (buf, domain, VM_PROPERTY_GET_GET_METHOD(p)); - buffer_add_methodid (buf, domain, VM_PROPERTY_GET_SET_METHOD(p)); - buffer_add_int (buf, VM_PROPERTY_GET_ATTRS(p)); + buffer_add_string (buf, p->name); + buffer_add_methodid (buf, domain, p->get); + buffer_add_methodid (buf, domain, p->set); + buffer_add_int (buf, p->attrs); i ++; } g_assert (i == nprops); @@ -9715,11 +9715,11 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint if (err != ERR_NONE) return err; - if (!(VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC)) + if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) return ERR_INVALID_FIELDID; #ifdef IL2CPP_MONO_DEBUGGER - if (!thread && VM_FIELD_GET_OFFSET(f) == THREAD_STATIC_FIELD_OFFSET) + if (!thread && f->offset == THREAD_STATIC_FIELD_OFFSET) return ERR_INVALID_FIELDID; #else special_static_type = mono_class_field_get_special_static_type (f); @@ -9730,8 +9730,8 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint #endif /* Check that the field belongs to the object */ found = FALSE; - for (k = klass; k; k = VM_CLASS_GET_PARENT(k)) { - if (k == VM_FIELD_GET_PARENT(f)) { + for (k = klass; k; k = k->parent) { + if (k == f->parent) { found = TRUE; break; } @@ -9739,12 +9739,12 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint if (!found) return ERR_INVALID_FIELDID; - vtable = mono_class_vtable (domain, VM_FIELD_GET_PARENT(f)); - val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (VM_FIELD_GET_TYPE(f)))); + vtable = mono_class_vtable (domain, f->parent); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); mono_field_static_get_value_for_thread (thread ? thread : mono_thread_internal_current (), vtable, f, val, &error); if (!is_ok (&error)) return ERR_INVALID_FIELDID; - buffer_add_value (buf, VM_FIELD_GET_TYPE(f), val, domain); + buffer_add_value (buf, f->type, val, domain); g_free (val); } break; @@ -9763,7 +9763,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint if (err != ERR_NONE) return err; - if (!(VM_TYPE_GET_ATTRS(mono_field_get_type(f)) & FIELD_ATTRIBUTE_STATIC)) + if (!(mono_field_get_type(f)->attrs & FIELD_ATTRIBUTE_STATIC)) return ERR_INVALID_FIELDID; if (mono_class_field_is_special_static (f)) return ERR_INVALID_FIELDID; @@ -9869,7 +9869,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint tclass = klass; - for (parent = tclass; parent; parent = VM_CLASS_GET_PARENT(parent)) { + for (parent = tclass; parent; parent = parent->parent) { mono_class_setup_interfaces (parent, &error); if (!mono_error_ok (&error)) return ERR_LOADER_ERROR; @@ -10344,8 +10344,8 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g gboolean is_inflated = FALSE; if (CHECK_PROTOCOL_VERSION (2, 12)) { guint8 attrs = 0; - is_generic = VM_METHOD_IS_GENERIC(method); - is_inflated = VM_METHOD_IS_INFLATED(method); + is_generic = method->is_generic; + is_inflated = method->is_inflated; if (is_generic) attrs |= (1 << 0); if (mono_method_signature (method)->generic_param_count) @@ -10361,7 +10361,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g result = VM_INFLATED_METHOD_GET_DECLARING(imethod); if (VM_INFLATED_METHOD_GET_CLASS_INST(imethod)) { - MonoClass *klass = VM_METHOD_GET_DECLARING_TYPE((MonoMethod *) imethod); + MonoClass *klass = ((MonoMethod *) imethod)->klass; /*Generic methods gets the context of the GTD.*/ if (mono_class_get_context (klass)) { MonoError error; @@ -10382,11 +10382,11 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g if (is_inflated) { MonoGenericInst *inst = mono_method_get_context (method)->method_inst; if (inst) { - count = VM_GENERIC_INST_TYPE_ARGC(inst); + count = inst->type_argc; buffer_add_int (buf, count); for (i = 0; i < count; i++) - buffer_add_typeid (buf, domain, mono_class_from_mono_type (VM_GENERIC_INST_TYPE_ARG(inst, i))); + buffer_add_typeid (buf, domain, mono_class_from_mono_type (inst->type_argv[i])); } else { buffer_add_int (buf, 0); } @@ -10564,7 +10564,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g } ginst = mono_metadata_get_generic_inst (type_argc, type_argv); g_free (type_argv); - tmp_context.class_inst = mono_class_is_ginst (VM_METHOD_GET_DECLARING_TYPE(method)) ? VM_GENERIC_CLASS_GET_INST(mono_class_get_generic_class (VM_METHOD_GET_DECLARING_TYPE(method))) : NULL; + tmp_context.class_inst = mono_class_is_ginst (method->klass) ? mono_class_get_generic_class (method->klass)->context.class_inst : NULL; tmp_context.method_inst = ginst; inflated = mono_class_inflate_generic_method_checked (method, &tmp_context, &error); @@ -10684,16 +10684,16 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) break; } case CMD_THREAD_GET_STATE: - buffer_add_int (buf, VM_INTERNAL_THREAD_GET_STATE(thread)); + buffer_add_int (buf, thread->state); break; case CMD_THREAD_GET_INFO: - buffer_add_byte (buf, VM_INTERNAL_THREAD_GET_THREADPOOL_THREAD(thread)); + buffer_add_byte (buf, thread->threadpool_thread); break; case CMD_THREAD_GET_ID: buffer_add_long (buf, (guint64)(gsize)thread); break; case CMD_THREAD_GET_TID: - buffer_add_long (buf, (guint64)VM_INTERNAL_THREAD_GET_ID(thread)); + buffer_add_long (buf, (guint64)thread->tid); break; case CMD_THREAD_SET_IP: { #ifndef IL2CPP_MONO_DEBUGGER @@ -10773,7 +10773,7 @@ static uint32_t GetExecutionContextIndex(const Il2CppSequencePointC* sequencePoi } } -static void GetVariable(DebuggerTlsData* tls, StackFrame* frame, MethodVariableKindC variableKind, uint32_t variablePosition, Il2CppMonoType** type, void** var) +static void GetVariable(DebuggerTlsData* tls, StackFrame* frame, MethodVariableKindC variableKind, uint32_t variablePosition, MonoType** type, void** var) { for (int frame_index = 0; frame_index < tls->il2cpp_context.frameCount; ++frame_index) { @@ -10935,10 +10935,10 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) case CMD_STACK_FRAME_GET_THIS: { if (frame->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) return ERR_ABSENT_INFORMATION; - if (VM_CLASS_IS_VALUETYPE (VM_METHOD_GET_DECLARING_TYPE (frame->api_method))) { + if (frame->api_method->klass->valuetype) { if (!sig->hasthis) { MonoObject *p = NULL; - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_DEFAULTS_OBJECT_CLASS), &p, frame->domain); + buffer_add_value (buf, &VM_DEFAULTS_OBJECT_CLASS->byval_arg, &p, frame->domain); } else { #ifndef IL2CPP_MONO_DEBUGGER if (frame->ji->is_interp) { @@ -10955,7 +10955,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { if (tls->il2cpp_context.sequencePoints[frame_index]->method == frame->actual_method) { - buffer_add_value_full (buf, VM_CLASS_GET_THIS_ARG (VM_METHOD_GET_DECLARING_TYPE (frame->actual_method)), tls->il2cpp_context.executionContexts[frame_index]->values[0], frame->domain, TRUE, NULL); + buffer_add_value_full (buf, &frame->actual_method->klass->this_arg, tls->il2cpp_context.executionContexts[frame_index]->values[0], frame->domain, TRUE, NULL); break; } } @@ -10964,7 +10964,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } else { if (!sig->hasthis) { MonoObject *p = NULL; - buffer_add_value (buf, VM_CLASS_GET_TYPE (VM_METHOD_GET_DECLARING_TYPE (frame->actual_method)), &p, frame->domain); + buffer_add_value (buf, &frame->actual_method->klass->byval_arg, &p, frame->domain); } else { #ifndef IL2CPP_MONO_DEBUGGER if (frame->ji->is_interp) { @@ -11077,7 +11077,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) void *var; #endif - t = VM_CLASS_GET_TYPE(VM_METHOD_GET_DECLARING_TYPE(frame->actual_method)); + t = &frame->actual_method->klass->byval_arg; /* Checked by the sender */ g_assert (MONO_TYPE_ISSTRUCT (t)); @@ -11100,7 +11100,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } #else GetVariable (tls, frame, kMethodVariableKindC_This, 0, &t, &var); - il2cpp_set_var(val_buf, var, VM_CLASS_GET_THIS_ARG(VM_METHOD_GET_DECLARING_TYPE(frame->actual_method))); + il2cpp_set_var(val_buf, var, &frame->actual_method->klass->this_arg); #endif break; } @@ -11132,8 +11132,8 @@ array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) buffer_add_int (buf, 0); } else { for (i = 0; i < VM_ARRAY_GET_RANK(arr); ++i) { - buffer_add_int (buf, VM_ARRAY_BOUND_LENGTH(arr, i)); - buffer_add_int (buf, VM_ARRAY_BOUND_LOWER_BOUND(arr, i)); + buffer_add_int (buf, arr->bounds[i].length); + buffer_add_int (buf, arr->bounds[i].lower_bound); } } break; @@ -11148,7 +11148,7 @@ array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) esize = mono_array_element_size (VM_OBJECT_GET_CLASS(arr)); for (i = index; i < index + len; ++i) { elem = (gpointer*)((char*)arr->vector + (i * esize)); - buffer_add_value (buf, VM_CLASS_GET_TYPE(VM_CLASS_GET_ELEMENT_CLASS(VM_OBJECT_GET_CLASS(arr))), elem, VM_OBJECT_GET_DOMAIN(arr)); + buffer_add_value (buf, &VM_OBJECT_GET_CLASS(arr)->element_class->byval_arg, elem, VM_OBJECT_GET_DOMAIN(arr)); } break; case CMD_ARRAY_REF_SET_VALUES: @@ -11162,7 +11162,7 @@ array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) esize = mono_array_element_size (VM_OBJECT_GET_CLASS(arr)); for (i = index; i < index + len; ++i) { elem = (gpointer*)((char*)arr->vector + (i * esize)); - decode_value (VM_CLASS_GET_TYPE(VM_CLASS_GET_ELEMENT_CLASS(VM_OBJECT_GET_CLASS(arr))), VM_OBJECT_GET_DOMAIN(arr), (guint8 *)elem, p, &p, end); + decode_value (&VM_OBJECT_GET_CLASS(arr)->element_class->byval_arg, VM_OBJECT_GET_DOMAIN(arr), (guint8 *)elem, p, &p, end); } break; default: @@ -11279,8 +11279,8 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) /* Check that the field belongs to the object */ found = FALSE; - for (k = obj_type; k; k = VM_CLASS_GET_PARENT(k)) { - if (k == VM_FIELD_GET_PARENT(f)) { + for (k = obj_type; k; k = k->parent) { + if (k == f->parent) { found = TRUE; break; } @@ -11288,22 +11288,22 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) if (!found) return ERR_INVALID_FIELDID; - if (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC) { + if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) { guint8 *val; MonoVTable *vtable; if (mono_class_field_is_special_static (f)) return ERR_INVALID_FIELDID; - g_assert (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC); - vtable = mono_class_vtable (VM_OBJECT_GET_DOMAIN(obj), VM_FIELD_GET_PARENT(f)); - val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (VM_FIELD_GET_TYPE(f)))); + g_assert (f->type->attrs & FIELD_ATTRIBUTE_STATIC); + vtable = mono_class_vtable (VM_OBJECT_GET_DOMAIN(obj), f->parent); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); mono_field_static_get_value_checked (vtable, f, val, &error); if (!is_ok (&error)) { mono_error_cleanup (&error); /* FIXME report the error */ return ERR_INVALID_OBJECT; } - buffer_add_value (buf, VM_FIELD_GET_TYPE(f), val, VM_OBJECT_GET_DOMAIN(obj)); + buffer_add_value (buf, f->type, val, VM_OBJECT_GET_DOMAIN(obj)); g_free (val); } else { guint8 *field_value = NULL; @@ -11321,9 +11321,9 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) #endif } else - field_value = VM_FIELD_GET_ADDRESS(obj, f); + field_value = (guint8*)(obj) + f->offset; - buffer_add_value (buf, VM_FIELD_GET_TYPE(f), field_value, VM_OBJECT_GET_DOMAIN(obj)); + buffer_add_value (buf, f->type, field_value, VM_OBJECT_GET_DOMAIN(obj)); } } break; @@ -11337,8 +11337,8 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) /* Check that the field belongs to the object */ found = FALSE; - for (k = obj_type; k; k = VM_CLASS_GET_PARENT(k)) { - if (k == VM_FIELD_GET_PARENT(f)) { + for (k = obj_type; k; k = k->parent) { + if (k == f->parent) { found = TRUE; break; } @@ -11346,18 +11346,18 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) if (!found) return ERR_INVALID_FIELDID; - if (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC) { + if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) { guint8 *val; MonoVTable *vtable; if (mono_class_field_is_special_static (f)) return ERR_INVALID_FIELDID; - g_assert (VM_TYPE_GET_ATTRS(VM_FIELD_GET_TYPE(f)) & FIELD_ATTRIBUTE_STATIC); - vtable = mono_class_vtable (VM_OBJECT_GET_DOMAIN(obj), VM_FIELD_GET_PARENT(f)); + g_assert (f->type->attrs & FIELD_ATTRIBUTE_STATIC); + vtable = mono_class_vtable (VM_OBJECT_GET_DOMAIN(obj), f->parent); - val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (VM_FIELD_GET_TYPE(f)))); - err = decode_value (VM_FIELD_GET_TYPE(f), VM_OBJECT_GET_DOMAIN(obj), val, p, &p, end); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); + err = decode_value (f->type, VM_OBJECT_GET_DOMAIN(obj), val, p, &p, end); if (err != ERR_NONE) { g_free (val); return err; @@ -11365,7 +11365,7 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) mono_field_static_set_value (vtable, f, val); g_free (val); } else { - err = decode_value (VM_FIELD_GET_TYPE(f), VM_OBJECT_GET_DOMAIN(obj), (guint8*)obj + VM_FIELD_GET_OFFSET(f), p, &p, end); + err = decode_value (f->type, VM_OBJECT_GET_DOMAIN(obj), (guint8*)obj + f->offset, p, &p, end); if (err != ERR_NONE) return err; } @@ -11686,8 +11686,8 @@ debugger_thread (void *arg) mono_thread_set_name_internal (internal, str, TRUE, FALSE, &error); mono_error_assert_ok (&error); - VM_INTERNAL_THREAD_SET_STATE_BACKGROUND (internal); - VM_INTERNAL_THREAD_SET_FLAG_DONT_MANAGE (internal); + internal->state |= ThreadState_Background; + internal->flags |= MONO_THREAD_FLAG_DONT_MANAGE; if (agent_config.defer) { if (!wait_for_attach ()) { @@ -11703,7 +11703,7 @@ debugger_thread (void *arg) appdomain_load(NULL, domain); AgentDomainInfo *info = VM_DOMAIN_GET_AGENT_INFO(domain); void *iter = NULL; - Il2CppMonoClass *klass; + MonoClass *klass; while(klass = il2cpp_iterate_loaded_classes(&iter)) g_hash_table_insert(info->loaded_classes, klass, klass); } @@ -11888,7 +11888,7 @@ unity_process_breakpoint_inner(DebuggerTlsData *tls, gboolean from_signal, Il2Cp if (from_signal) g_assert_not_reached(); - if (VM_METHOD_GET_WRAPPER_TYPE(method) || tls->disable_breakpoints) + if (method->wrapper_type || tls->disable_breakpoints) return; bp_reqs = g_ptr_array_new(); diff --git a/mono/mini/il2cpp-c-types.h b/mono/mini/il2cpp-c-types.h index b00262d6c42d..7e57f2595c25 100644 --- a/mono/mini/il2cpp-c-types.h +++ b/mono/mini/il2cpp-c-types.h @@ -8,38 +8,40 @@ #define IL2CPP_MONO_PUBLIC_KEY_TOKEN_LENGTH 17 -typedef struct Il2CppType Il2CppMonoType; -typedef struct Il2CppClass Il2CppMonoClass; +//Converted to il2cpp types +#define MonoType Il2CppType +#define MonoClass Il2CppClass +#define MonoImage Il2CppImage +#define MonoMethod MethodInfo +#define MonoClassField FieldInfo +#define MonoArrayType Il2CppArrayType +#define MonoGenericParam Il2CppGenericParameter +#define MonoGenericInst Il2CppGenericInst +#define MonoGenericContext Il2CppGenericContext +#define MonoGenericClass Il2CppGenericClass +#define MonoGenericContainer Il2CppGenericContainer +#define MonoProperty PropertyInfo +#define MonoString Il2CppString +#define MonoArray Il2CppArraySize +#define MonoThread Il2CppThread +#define MonoInternalThread Il2CppInternalThread +#define MonoReflectionType Il2CppReflectionType +#define MonoProfiler Il2CppProfiler + +//still stubs everywhere typedef struct _Il2CppMonoAssemblyName Il2CppMonoAssemblyNameReplacement; typedef struct _Il2CppMonoAssembly Il2CppMonoAssembly; typedef struct _Il2CppMonoDomain Il2CppMonoDomain; -typedef struct Il2CppImage Il2CppMonoImage; typedef struct _Il2CppMonoMethodSignature Il2CppMonoMethodSignature; -typedef struct MethodInfo Il2CppMonoMethod; -typedef struct FieldInfo Il2CppMonoClassField; -typedef struct Il2CppArrayType Il2CppMonoArrayType; -typedef struct Il2CppGenericParam Il2CppMonoGenericParam; -typedef struct Il2CppGenericInst Il2CppMonoGenericInst; -typedef struct Il2CppGenericContext Il2CppMonoGenericContext; -typedef struct Il2CppGenericClass Il2CppMonoGenericClass; typedef struct _Il2CppMonoMethodHeader Il2CppMonoMethodHeader; typedef struct _Il2CppMonoVTable Il2CppMonoVTable; -typedef struct Il2CppPropertyInfo Il2CppMonoProperty; -typedef struct Il2CppString Il2CppMonoString; typedef struct _Il2CppMonoAppDomain Il2CppMonoAppDomain; typedef struct _Il2CppMonoMarshalByRefObject Il2CppMonoMarshalByRefObject; typedef struct _Il2CppMonoObject Il2CppMonoObject; -typedef struct Il2CppArraySize Il2CppMonoArray; typedef struct _Il2CppMonoCustomAttrInfo Il2CppMonoCustomAttrInfo; -typedef struct Il2CppThread Il2CppMonoThread; -typedef struct Il2CppGHashTable Il2CppMonoGHashTable; -typedef struct Il2CppGenericContainer Il2CppMonoGenericContainer; typedef struct Il2CppReflectionAssembly Il2CppMonoReflectionAssembly; -typedef struct Il2CppReflectionType Il2CppMonoReflectionType; -typedef struct Il2CppProfiler Il2CppMonoProfiler; typedef struct _Il2CppMonoJitTlsData Il2CppMonoJitTlsData; typedef struct _Il2CppMonoRuntimeExceptionHandlingCallbacks Il2CppMonoRuntimeExceptionHandlingCallbacks; -typedef struct Il2CppInternalThread Il2CppMonoInternalThread; typedef struct _Il2CppMonoCustomAttrEntry Il2CppMonoCustomAttrEntry; typedef struct _Il2CppMonoStackFrameInfo Il2CppMonoStackFrameInfo; typedef struct Il2CppDefaults Il2CppMonoDefaults; @@ -61,15 +63,15 @@ struct _Il2CppMonoExceptionClause uint32_t handler_len; union { uint32_t filter_offset; - Il2CppMonoClass *catch_class; + MonoClass *catch_class; } data; }; struct _Il2CppCattrNamedArg { - Il2CppMonoType *type; - Il2CppMonoClassField *field; - Il2CppMonoProperty *prop; + MonoType *type; + MonoClassField *field; + MonoProperty *prop; }; struct _Il2CppMonoObject @@ -85,16 +87,16 @@ struct _Il2CppMonoException struct _Il2CppMonoMethodInflated { - Il2CppMonoMethod *declaring; - Il2CppMonoGenericContext context; + MonoMethod *declaring; + MonoGenericContext context; }; struct _Il2CppMonoStackFrameInfo { MonoStackFrameType type; MonoJitInfo *ji; - Il2CppMonoMethod *method; - Il2CppMonoMethod *actual_method; + MonoMethod *method; + MonoMethod *actual_method; Il2CppMonoDomain *domain; gboolean managed; gboolean async_context; @@ -110,7 +112,7 @@ struct _Il2CppMonoStackFrameInfo struct _Il2CppMonoCustomAttrEntry { - Il2CppMonoMethod *ctor; + MonoMethod *ctor; uint32_t data_size; const mono_byte* data; }; @@ -140,12 +142,12 @@ struct _Il2CppMonoMethodHeader guint16 num_locals; Il2CppMonoExceptionClause *clauses; unsigned int num_clauses : 15; - Il2CppMonoType *locals [MONO_ZERO_LEN_ARRAY]; + MonoType *locals [MONO_ZERO_LEN_ARRAY]; }; struct _Il2CppMonoVTable { - Il2CppMonoClass *klass; + MonoClass *klass; Il2CppMonoDomain *domain; guint8 initialized; gpointer type; @@ -169,7 +171,7 @@ struct _Il2CppMonoAssemblyName struct _Il2CppMonoAssembly { Il2CppMonoAssemblyNameReplacement aname; - Il2CppMonoImage *image; + MonoImage *image; }; struct _Il2CppMonoDomain @@ -185,12 +187,12 @@ struct _Il2CppMonoDomain struct _Il2CppMonoMethodSignature { - Il2CppMonoType *ret; + MonoType *ret; guint16 param_count; unsigned int generic_param_count : 16; unsigned int call_convention : 6; unsigned int hasthis : 1; - Il2CppMonoType **params; + MonoType **params; }; struct _Il2CppMonoTypeNameParse @@ -214,7 +216,7 @@ typedef enum typedef struct { - const Il2CppMonoType* const* const type; + const MonoType* const* const type; const char* const name; const MethodVariableKindC variableKind; const int start; @@ -239,7 +241,7 @@ typedef struct const Il2CppMethodExecutionContextInfoC* const executionContextInfos; const uint32_t executionContextInfoCount; const Il2CppMethodHeaderInfoC *header; - const Il2CppMonoMethod* method; + const MonoMethod* method; const char* const sourceFile; const uint8_t sourceFileHash[16]; const int32_t lineStart, lineEnd; @@ -267,28 +269,26 @@ TYPED_HANDLE_DECL (Il2CppMonoReflectionAssembly); Il2CppMonoDefaults il2cpp_mono_defaults; MonoDebugOptions il2cpp_mono_debug_options; -typedef void (*Il2CppMonoProfileFunc) (Il2CppMonoProfiler *prof); -typedef void (*Il2CppMonoProfileAppDomainFunc) (Il2CppMonoProfiler *prof, Il2CppMonoDomain *domain); -typedef void (*Il2CppMonoProfileAppDomainResult) (Il2CppMonoProfiler *prof, Il2CppMonoDomain *domain, int result); -typedef void (*Il2CppMonoProfileAssemblyFunc) (Il2CppMonoProfiler *prof, Il2CppMonoAssembly *assembly); -typedef void (*Il2CppMonoProfileJitResult) (Il2CppMonoProfiler *prof, Il2CppMonoMethod *method, MonoJitInfo* jinfo, int result); -typedef void (*Il2CppMonoProfileAssemblyResult) (Il2CppMonoProfiler *prof, Il2CppMonoAssembly *assembly, int result); -typedef void (*Il2CppMonoProfileThreadFunc) (Il2CppMonoProfiler *prof, uintptr_t tid); +typedef void (*Il2CppMonoProfileFunc) (MonoProfiler *prof); +typedef void (*Il2CppMonoProfileAppDomainFunc) (MonoProfiler *prof, Il2CppMonoDomain *domain); +typedef void (*Il2CppMonoProfileAppDomainResult) (MonoProfiler *prof, Il2CppMonoDomain *domain, int result); +typedef void (*Il2CppMonoProfileAssemblyFunc) (MonoProfiler *prof, Il2CppMonoAssembly *assembly); +typedef void (*Il2CppMonoProfileJitResult) (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo, int result); +typedef void (*Il2CppMonoProfileAssemblyResult) (MonoProfiler *prof, Il2CppMonoAssembly *assembly, int result); +typedef void (*Il2CppMonoProfileThreadFunc) (MonoProfiler *prof, uintptr_t tid); typedef gboolean (*Il2CppMonoJitStackWalk) (Il2CppMonoStackFrameInfo *frame, MonoContext *ctx, gpointer data); typedef void (*Il2CppMonoDomainFunc) (Il2CppMonoDomain *domain, void* user_data); typedef void (*emit_assembly_load_callback)(void*, void*); typedef void(*emit_type_load_callback)(void*, void*, void*); -void il2cpp_set_thread_state_background(Il2CppMonoThread* thread); +void il2cpp_set_thread_state_background(MonoThread* thread); void* il2cpp_domain_get_agent_info(Il2CppMonoAppDomain* domain); void il2cpp_domain_set_agent_info(Il2CppMonoAppDomain* domain, void* agentInfo); void il2cpp_start_debugger_thread(); -uintptr_t il2cpp_internal_thread_get_thread_id(Il2CppMonoInternalThread* thread); void* il2cpp_gc_alloc_fixed(size_t size); void il2cpp_gc_free_fixed(void* address); char* il2cpp_assembly_get_name(Il2CppMonoAssembly* assembly); const char* il2cpp_domain_get_name(Il2CppMonoDomain* domain); -int il2cpp_mono_type_get_attrs(Il2CppMonoType* type); #endif \ No newline at end of file diff --git a/mono/mini/il2cpp-compat.h b/mono/mini/il2cpp-compat.h index beac331da3db..66b3d68e76f3 100644 --- a/mono/mini/il2cpp-compat.h +++ b/mono/mini/il2cpp-compat.h @@ -13,17 +13,10 @@ #define THREAD_STATIC_FIELD_OFFSET -1 -#define VM_THREAD_GET_INTERNAL(thread) il2cpp_mono_thread_get_internal(thread) -#define VM_INTERNAL_THREAD_SET_STATE_BACKGROUND(internal_thread) il2cpp_internal_thread_set_state_background(internal_thread) -#define VM_INTERNAL_THREAD_SET_FLAG_DONT_MANAGE(thread) -#define VM_INTERNAL_THREAD_GET_ID(internal_thread) il2cpp_internal_thread_get_thread_id(internal_thread) -#define VM_INTERNAL_THREAD_GET_STATE(internal_thread) il2cpp_internal_thread_get_state(internal_thread) -#define VM_INTERNAL_THREAD_GET_THREADPOOL_THREAD(internal_thread) il2cpp_internal_thread_get_threadpool_thread(internal_thread) #define VM_DOMAIN_GET_AGENT_INFO(domain) il2cpp_domain_get_agent_info(domain) #define VM_DOMAIN_SET_AGENT_INFO(domain, value) il2cpp_domain_set_agent_info(domain, value) #define VM_DOMAIN_GET_NAME(domain) il2cpp_domain_get_name(domain) #define VM_DOMAIN_GET_CORLIB(domain) il2cpp_image_get_assembly(il2cpp_get_corlib()) -#define VM_DOMAIN_GET_ASSEMBLIES(domain, iter) il2cpp_domain_get_assemblies_iter(domain, iter) #define VM_ASSEMBLY_GET_NAME(assembly) il2cpp_assembly_get_name(assembly) #define VM_ASSEMBLY_FREE_NAME(name) g_free(name) #define VM_ASSEMBLY_IS_DYNAMIC(assembly) FALSE @@ -37,69 +30,25 @@ #define VM_ASSEMBLY_NAME_GET_PUBLIC_KEY_TOKEN(assembly, i) il2cpp_assembly_name_public_key_token(assembly, i) #define VM_ASSEMBLY_NAME_GET_PUBLIC_KEY_TOKEN_STRING(assembly) il2cpp_assembly_name_public_key_token_string(assembly) #define VM_ASSEMBLY_NAME_GET_FLAGS(assembly) il2cpp_assembly_name_flags(assembly) -#define VM_CLASS_GET_TYPE(klass) il2cpp_class_get_type(klass) -#define VM_CLASS_GET_THIS_ARG(klass) il2cpp_class_this_arg(klass) -#define VM_CLASS_GET_ELEMENT_CLASS(klass) il2cpp_class_get_element_class(klass) -#define VM_CLASS_GET_PARENT(klass) il2cpp_class_get_parent(klass) -#define VM_CLASS_GET_IMAGE(klass) il2cpp_class_get_image(klass) -#define VM_CLASS_IS_VALUETYPE(klass) il2cpp_class_is_valuetype(klass) -#define VM_CLASS_IS_INTERFACE(klass) il2cpp_class_is_interface(klass) -#define VM_CLASS_GET_NAME(klass) il2cpp_class_get_name(klass) -#define VM_CLASS_GET_INTERFACES(klass, iter) il2cpp_class_get_interfaces(klass, iter) -#define VM_CLASS_GET_ENUMTYPE(klass) il2cpp_class_get_enumtype(klass) -#define VM_METHOD_GET_WRAPPER_TYPE(method) FALSE -#define VM_METHOD_GET_DECLARING_TYPE(method) il2cpp_method_get_declaring_type(method) -#define VM_METHOD_GET_FLAGS(method) il2cpp_method_get_flags_no_iflags(method) -#define VM_METHOD_GET_NAME(method) il2cpp_method_get_name(method) -#define VM_METHOD_IS_GENERIC(method) il2cpp_method_is_generic(method) -#define VM_METHOD_IS_INFLATED(method) il2cpp_method_is_inflated(method) #define VM_METHOD_IS_STRING_CTOR(method) il2cpp_method_is_string_ctor(method) #define VM_INFLATED_METHOD_GET_DECLARING(imethod) il2cpp_method_get_generic_definition(imethod) #define VM_INFLATED_METHOD_GET_CLASS_INST(imethod) il2cpp_method_get_generic_class_inst(imethod) -#define VM_FIELD_GET_NAME(field) il2cpp_mono_field_get_name(field) -#define VM_FIELD_GET_PARENT(field) il2cpp_field_get_parent(field) -#define VM_FIELD_GET_TYPE(field) il2cpp_field_get_type(field) -#define VM_FIELD_GET_ADDRESS(obj, field) il2cpp_field_get_address(obj, field) -#define VM_FIELD_IS_DELETED(field) il2cpp_field_is_deleted(field) -#define VM_FIELD_GET_OFFSET(field) il2cpp_field_get_offset(field) -#define VM_TYPE_GET_ATTRS(type) il2cpp_mono_type_get_attrs(type) -#define VM_TYPE_GET_TYPE(type) il2cpp_type_get_type(type) -#define VM_TYPE_IS_BYREF(type) il2cpp_type_is_byref(type) -#define VM_TYPE_GET_GENERIC_CLASS(type) il2cpp_type_get_generic_class(type) #define VM_OBJECT_GET_DOMAIN(object) il2cpp_mono_domain_get() #define VM_OBJECT_GET_CLASS(object) il2cpp_object_get_class(object) #define VM_OBJECT_GET_TYPE(object) il2cpp_mono_object_get_type(object) -#define VM_GENERIC_CLASS_GET_INST(gklass) il2cpp_generic_class_get_inst(gklass) #define VM_GENERIC_CLASS_GET_CONTAINER_CLASS(gklass) il2cpp_generic_class_get_container_class(gklass) -#define VM_GENERIC_CONTAINER_GET_TYPE_ARGC(container) il2cpp_generic_container_get_type_argc(container) -#define VM_GENERIC_INST_TYPE_ARGC(inst) il2cpp_generic_inst_type_argc(inst) -#define VM_GENERIC_INST_TYPE_ARG(inst, i) il2cpp_generic_inst_type_arg(inst, i) #define VM_DEFAULTS_OBJECT_CLASS il2cpp_defaults_object_class() #define VM_DEFAULTS_EXCEPTION_CLASS il2cpp_defaults_exception_class() #define VM_DEFAULTS_CORLIB_IMAGE il2cpp_defaults_corlib_image() #define VM_DEFAULTS_VOID_CLASS il2cpp_defaults_void_class() #define VM_ARRAY_GET_RANK(arr) il2cpp_array_rank(arr) -#define VM_ARRAY_BOUND_LENGTH(arr, i) il2cpp_array_bound_length(arr, i) -#define VM_ARRAY_BOUND_LOWER_BOUND(arr, i) il2cpp_array_bound_lower_bound(arr, i) -#define VM_IMAGE_GET_NAME(image) il2cpp_image_name(image) +//Fixme module name as image name seems bad #define VM_IMAGE_GET_MODULE_NAME(image) il2cpp_image_name(image) -#define VM_IMAGE_GET_ASSEMBLY(image) il2cpp_image_assembly(image) -#define VM_PROPERTY_GET_NAME(prop) il2cpp_property_get_name(prop) -#define VM_PROPERTY_GET_GET_METHOD(prop) il2cpp_property_get_get_method(prop) -#define VM_PROPERTY_GET_SET_METHOD(prop) il2cpp_property_get_set_method(prop) -#define VM_PROPERTY_GET_ATTRS(prop) il2cpp_property_get_flags(prop) #else -#define VM_THREAD_GET_INTERNAL(thread) thread->internal_thread -#define VM_INTERNAL_THREAD_SET_STATE_BACKGROUND(internal_thread) internal_thread->state |= ThreadState_Background -#define VM_INTERNAL_THREAD_SET_FLAG_DONT_MANAGE(internal_thread) internal_thread->flags |= MONO_THREAD_FLAG_DONT_MANAGE -#define VM_INTERNAL_THREAD_GET_ID(internal_thread) internal_thread->tid -#define VM_INTERNAL_THREAD_GET_STATE(internal_thread) internal_thread->state -#define VM_INTERNAL_THREAD_GET_THREADPOOL_THREAD(internal_thread) internal_thread->threadpool_thread #define VM_DOMAIN_GET_AGENT_INFO(domain) domain_jit_info (domain)->agent_info #define VM_DOMAIN_SET_AGENT_INFO(domain, value) domain_jit_info (domain)->agent_info = value #define VM_DOMAIN_GET_NAME(domain) domain->friendly_name #define VM_DOMAIN_GET_CORLIB(domain) domain->domain->mbr.obj.vtable->klass->image->assembly -#define VM_DOMAIN_GET_ASSEMBLIES(domain, iter) mono_domain_get_assemblies_iter(domain, iter) #define VM_ASSEMBLY_GET_NAME(assembly) assembly->aname.name #define VM_ASSEMBLY_FREE_NAME(name) #define VM_ASSEMBLY_IS_DYNAMIC(assembly) assembly->image->dynamic @@ -113,91 +62,34 @@ #define VM_ASSEMBLY_NAME_GET_PUBLIC_KEY_TOKEN(assembly, i) (assembly)->aname.public_key_token[i] #define VM_ASSEMBLY_NAME_GET_PUBLIC_KEY_TOKEN_STRING(assembly) (char*)(assembly)->aname.public_key_token #define VM_ASSEMBLY_NAME_GET_FLAGS(assembly) (assembly)->aname.flags -#define VM_CLASS_GET_TYPE(klass) &(klass)->byval_arg -#define VM_CLASS_GET_THIS_ARG(klass) &(klass)->this_arg -#define VM_CLASS_GET_PARENT(klass) (klass)->parent -#define VM_CLASS_GET_IMAGE(klass) (klass)->image -#define VM_CLASS_IS_VALUETYPE(klass) klass->valuetype -#define VM_CLASS_IS_INTERFACE(klass) MONO_CLASS_IS_INTERFACE(klass) -#define VM_CLASS_GET_NAME(klass) (klass)->name -#define VM_CLASS_GET_INTERFACES(klass, iter) mono_class_get_interfaces(klass, iter) -#define VM_CLASS_GET_ENUMTYPE(klass) (klass)->enumtype -#define VM_METHOD_GET_WRAPPER_TYPE(method) method->wrapper_type -#define VM_METHOD_GET_DECLARING_TYPE(method) (method)->klass -#define VM_METHOD_GET_FLAGS(method) (method)->flags -#define VM_METHOD_GET_NAME(method) (method)->name -#define VM_METHOD_IS_GENERIC(method) method->is_generic -#define VM_METHOD_IS_INFLATED(method) method->is_inflated #define VM_METHOD_IS_STRING_CTOR(method) method->string_ctor #define VM_INFLATED_METHOD_GET_DECLARING(imethod) (imethod)->declaring #define VM_INFLATED_METHOD_GET_CLASS_INST(imethod) (imethod)->context.class_inst -#define VM_FIELD_GET_NAME(field) field->name -#define VM_FIELD_GET_PARENT(field) (field)->parent -#define VM_FIELD_GET_TYPE(field) (field)->type -#define VM_FIELD_GET_ADDRESS(obj, field) (guint8*)(obj) + (f)->offset -#define VM_FIELD_IS_DELETED(field) mono_field_is_deleted(field) -#define VM_FIELD_GET_OFFSET(field) (field)->offset -#define VM_TYPE_GET_ATTRS(type) type->attrs -#define VM_TYPE_GET_TYPE(typeparam) (typeparam)->type -#define VM_TYPE_IS_BYREF(type) (type)->byref -#define VM_TYPE_GET_GENERIC_CLASS(type) (type)->data.generic_class #define VM_OBJECT_GET_DOMAIN(object) ((MonoObject*)object)->vtable->domain #define VM_OBJECT_GET_CLASS(object) ((MonoObject*)object)->vtable->klass #define VM_OBJECT_GET_TYPE(object) ((MonoReflectionType*)object->vtable->type)->type -#define VM_GENERIC_CONTAINER_GET_TYPE_ARGC(container) container->type_argc -#define VM_GENERIC_CLASS_GET_INST(gklass) (gklass)->context.class_inst #define VM_GENERIC_CLASS_GET_CONTAINER_CLASS(gklass) (gklass)->container_class -#define VM_GENERIC_INST_TYPE_ARGC(inst) (inst)->type_argc -#define VM_GENERIC_INST_TYPE_ARG(inst, i) (inst)->type_argv[i] #define VM_DEFAULTS_OBJECT_CLASS mono_defaults.object_class #define VM_DEFAULTS_EXCEPTION_CLASS mono_defaults.exception_class #define VM_DEFAULTS_CORLIB_IMAGE mono_defaults.corlib #define VM_DEFAULTS_VOID_CLASS mono_defaults.void_class #define VM_ARRAY_GET_RANK(arr) (arr)->obj.vtable->klass->rank -#define VM_CLASS_GET_ELEMENT_CLASS(klass) (klass)->element_class -#define VM_ARRAY_BOUND_LENGTH(arr, i) arr->bounds[i].length -#define VM_ARRAY_BOUND_LOWER_BOUND(arr, i) arr->bounds[i].lower_bound -#define VM_IMAGE_GET_NAME(image) (image)->name #define VM_IMAGE_GET_MODULE_NAME(image) (image)->module_name -#define VM_IMAGE_GET_ASSEMBLY(image) (image)->assembly -#define VM_PROPERTY_GET_NAME(prop) (prop)->name -#define VM_PROPERTY_GET_GET_METHOD(prop) (prop)->get -#define VM_PROPERTY_GET_SET_METHOD(prop) (prop)->set -#define VM_PROPERTY_GET_ATTRS(prop) (prop)->attrs #endif #if defined(RUNTIME_IL2CPP) -#define MonoType Il2CppMonoType -#define MonoClass Il2CppMonoClass #define MonoMethodHeader Il2CppMonoMethodHeader #define MonoVTable Il2CppMonoVTable #define MonoAssembly Il2CppMonoAssembly -#define MonoProperty Il2CppMonoProperty -#define MonoString Il2CppMonoString #define MonoAppDomain Il2CppMonoAppDomain #define MonoDomain Il2CppMonoDomain -#define MonoImage Il2CppMonoImage #define MonoMethodSignature Il2CppMonoMethodSignature -#define MonoMethod Il2CppMonoMethod -#define MonoClassField Il2CppMonoClassField -#define MonoArrayType Il2CppMonoArrayType -#define MonoGenericParam Il2CppMonoGenericParam -#define MonoGenericInst Il2CppMonoGenericInst -#define MonoGenericContext Il2CppMonoGenericContext -#define MonoGenericClass Il2CppMonoGenericClass #define MonoAssemblyName Il2CppMonoAssemblyNameReplacement #define MonoMarshalByRefObject Il2CppMonoMarshalByRefObject #define MonoObject Il2CppMonoObject -#define MonoArray Il2CppMonoArray #define MonoCustomAttrInfo Il2CppMonoCustomAttrInfo -#define MonoThread Il2CppMonoThread -#define MonoInternalThread Il2CppMonoInternalThread -#define MonoGHashTable Il2CppMonoGHashTable -#define MonoGenericContainer Il2CppMonoGenericContainer #define MonoReflectionAssemblyHandle Il2CppMonoReflectionAssemblyHandle -#define MonoReflectionType Il2CppMonoReflectionType -#define MonoProfiler Il2CppMonoProfiler #define MonoJitTlsData Il2CppMonoJitTlsData #define MonoRuntimeExceptionHandlingCallbacks Il2CppMonoRuntimeExceptionHandlingCallbacks #define MonoCustomAttrEntry Il2CppMonoCustomAttrEntry @@ -410,8 +302,9 @@ #define mono_method_get_name il2cpp_method_get_name #define mono_class_get_type il2cpp_class_get_type #define mono_method_get_class il2cpp_method_get_class -#define mono_class_get_type il2cpp_class_get_type #define mono_class_get_image il2cpp_class_get_image +#define mono_class_get_interfaces il2cpp_class_get_interfaces +#define MONO_CLASS_IS_INTERFACE il2cpp_class_is_interface #define mono_image_get_assembly il2cpp_image_get_assembly #define mono_image_get_name il2cpp_image_get_name #define mono_type_get_type il2cpp_type_get_type @@ -424,57 +317,59 @@ #define mono_method_get_token il2cpp_method_get_token #define mono_method_is_generic il2cpp_method_is_generic #define mono_method_is_inflated il2cpp_method_is_inflated +#define mono_field_is_deleted il2cpp_field_is_deleted +#define mono_domain_get_assemblies_iter il2cpp_domain_get_assemblies_iter #define mono_domain_assemblies_lock #define mono_domain_assemblies_unlock #define mono_get_string_class il2cpp_mono_get_string_class -Il2CppMonoMethod* il2cpp_mono_image_get_entry_point (Il2CppMonoImage *image); -const char* il2cpp_mono_image_get_filename (Il2CppMonoImage *image); -const char* il2cpp_mono_image_get_guid (Il2CppMonoImage *image); -Il2CppMonoClass* il2cpp_mono_type_get_class (Il2CppMonoType *type); -mono_bool il2cpp_mono_type_is_struct (Il2CppMonoType *type); -mono_bool il2cpp_mono_type_is_reference (Il2CppMonoType *type); +MonoMethod* il2cpp_mono_image_get_entry_point (MonoImage *image); +const char* il2cpp_mono_image_get_filename (MonoImage *image); +const char* il2cpp_mono_image_get_guid (MonoImage *image); +MonoClass* il2cpp_mono_type_get_class (MonoType *type); +mono_bool il2cpp_mono_type_is_struct (MonoType *type); +mono_bool il2cpp_mono_type_is_reference (MonoType *type); void il2cpp_mono_metadata_free_mh (Il2CppMonoMethodHeader *mh); -Il2CppMonoMethodSignature* il2cpp_mono_method_signature (Il2CppMonoMethod *m); -void il2cpp_mono_method_get_param_names (Il2CppMonoMethod *method, const char **names); -mono_bool il2cpp_mono_type_generic_inst_is_valuetype (Il2CppMonoType *type); -Il2CppMonoMethodHeader* il2cpp_mono_method_get_header_checked (Il2CppMonoMethod *method, MonoError *error); -gboolean il2cpp_mono_class_init (Il2CppMonoClass *klass); -Il2CppMonoVTable* il2cpp_mono_class_vtable (Il2CppMonoDomain *domain, Il2CppMonoClass *klass); -Il2CppMonoClassField* il2cpp_mono_class_get_field_from_name (Il2CppMonoClass *klass, const char *name); -int32_t il2cpp_mono_array_element_size (Il2CppMonoClass *ac); -int32_t il2cpp_mono_class_instance_size (Il2CppMonoClass *klass); -int32_t il2cpp_mono_class_value_size (Il2CppMonoClass *klass, uint32_t *align); -gboolean il2cpp_mono_class_is_assignable_from (Il2CppMonoClass *klass, Il2CppMonoClass *oklass); -Il2CppMonoClass* il2cpp_mono_class_from_mono_type (Il2CppMonoType *type); -int il2cpp_mono_class_num_fields (Il2CppMonoClass *klass); -int il2cpp_mono_class_num_methods (Il2CppMonoClass *klass); -int il2cpp_mono_class_num_properties (Il2CppMonoClass *klass); -Il2CppMonoClassField* il2cpp_mono_class_get_fields (Il2CppMonoClass* klass, gpointer *iter); -Il2CppMonoMethod* il2cpp_mono_class_get_methods (Il2CppMonoClass* klass, gpointer *iter); -Il2CppMonoProperty* il2cpp_mono_class_get_properties (Il2CppMonoClass* klass, gpointer *iter); -const char* il2cpp_mono_field_get_name (Il2CppMonoClassField *field); -mono_unichar2* il2cpp_mono_string_chars (Il2CppMonoString *s); -int il2cpp_mono_string_length (Il2CppMonoString *s); -char* il2cpp_mono_array_addr_with_size (Il2CppMonoArray *array, int size, uintptr_t idx); -uintptr_t il2cpp_mono_array_length (Il2CppMonoArray *array); -Il2CppMonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text); -Il2CppMonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text); -Il2CppMonoString* il2cpp_mono_string_new_checked (Il2CppMonoDomain *domain, const char *text, MonoError *merror); -char* il2cpp_mono_string_to_utf8_checked (Il2CppMonoString *string_obj, MonoError *error); +Il2CppMonoMethodSignature* il2cpp_mono_method_signature (MonoMethod *m); +void il2cpp_mono_method_get_param_names (MonoMethod *method, const char **names); +mono_bool il2cpp_mono_type_generic_inst_is_valuetype (MonoType *type); +Il2CppMonoMethodHeader* il2cpp_mono_method_get_header_checked (MonoMethod *method, MonoError *error); +gboolean il2cpp_mono_class_init (MonoClass *klass); +Il2CppMonoVTable* il2cpp_mono_class_vtable (Il2CppMonoDomain *domain, MonoClass *klass); +MonoClassField* il2cpp_mono_class_get_field_from_name (MonoClass *klass, const char *name); +int32_t il2cpp_mono_array_element_size (MonoClass *ac); +int32_t il2cpp_mono_class_instance_size (MonoClass *klass); +int32_t il2cpp_mono_class_value_size (MonoClass *klass, uint32_t *align); +gboolean il2cpp_mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass); +MonoClass* il2cpp_mono_class_from_mono_type (MonoType *type); +int il2cpp_mono_class_num_fields (MonoClass *klass); +int il2cpp_mono_class_num_methods (MonoClass *klass); +int il2cpp_mono_class_num_properties (MonoClass *klass); +MonoClassField* il2cpp_mono_class_get_fields (MonoClass* klass, gpointer *iter); +MonoMethod* il2cpp_mono_class_get_methods (MonoClass* klass, gpointer *iter); +MonoProperty* il2cpp_mono_class_get_properties (MonoClass* klass, gpointer *iter); +const char* il2cpp_mono_field_get_name (MonoClassField *field); +mono_unichar2* il2cpp_mono_string_chars (MonoString *s); +int il2cpp_mono_string_length (MonoString *s); +char* il2cpp_mono_array_addr_with_size (MonoArray *array, int size, uintptr_t idx); +uintptr_t il2cpp_mono_array_length (MonoArray *array); +MonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text); +MonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text); +MonoString* il2cpp_mono_string_new_checked (Il2CppMonoDomain *domain, const char *text, MonoError *merror); +char* il2cpp_mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error); int il2cpp_mono_object_hash (Il2CppMonoObject* obj); void* il2cpp_mono_object_unbox (Il2CppMonoObject *obj); -void il2cpp_mono_field_set_value (Il2CppMonoObject *obj, Il2CppMonoClassField *field, void *value); -void il2cpp_mono_field_static_set_value (Il2CppMonoVTable *vt, Il2CppMonoClassField *field, void *value); +void il2cpp_mono_field_set_value (Il2CppMonoObject *obj, MonoClassField *field, void *value); +void il2cpp_mono_field_static_set_value (Il2CppMonoVTable *vt, MonoClassField *field, void *value); uint32_t il2cpp_mono_gchandle_new_weakref (Il2CppMonoObject *obj, mono_bool track_resurrection); Il2CppMonoObject* il2cpp_mono_gchandle_get_target (uint32_t gchandle); void il2cpp_mono_gchandle_free (uint32_t gchandle); void il2cpp_mono_gc_wbarrier_generic_store (void* ptr, Il2CppMonoObject* value); int il2cpp_mono_reflection_parse_type_checked (char *name, Il2CppMonoTypeNameParse *info, MonoError *error); void il2cpp_mono_reflection_free_type_info (Il2CppMonoTypeNameParse *info); -mono_bool il2cpp_mono_custom_attrs_has_attr (Il2CppMonoCustomAttrInfo *ainfo, Il2CppMonoClass *attr_klass); +mono_bool il2cpp_mono_custom_attrs_has_attr (Il2CppMonoCustomAttrInfo *ainfo, MonoClass *attr_klass); void il2cpp_mono_custom_attrs_free (Il2CppMonoCustomAttrInfo *ainfo); Il2CppMonoDomain* il2cpp_mono_get_root_domain (void); void il2cpp_mono_runtime_quit (void); @@ -483,74 +378,74 @@ Il2CppMonoDomain* il2cpp_mono_domain_get (void); gboolean il2cpp_mono_domain_set (Il2CppMonoDomain *domain, gboolean force); void il2cpp_mono_domain_foreach(Il2CppMonoDomainFunc func, gpointer user_data); MonoJitInfo* il2cpp_mono_jit_info_table_find(Il2CppMonoDomain* domain, char* addr); -Il2CppMonoMethod* il2cpp_mono_jit_info_get_method(MonoJitInfo* ji); -MonoDebugMethodInfo* il2cpp_mono_debug_lookup_method(Il2CppMonoMethod* method); -MonoDebugMethodJitInfo* il2cpp_mono_debug_find_method(Il2CppMonoMethod* method, Il2CppMonoDomain* domain); +MonoMethod* il2cpp_mono_jit_info_get_method(MonoJitInfo* ji); +MonoDebugMethodInfo* il2cpp_mono_debug_lookup_method(MonoMethod* method); +MonoDebugMethodJitInfo* il2cpp_mono_debug_find_method(MonoMethod* method, Il2CppMonoDomain* domain); void il2cpp_mono_debug_free_method_jit_info(MonoDebugMethodJitInfo* jit); -MonoDebugLocalsInfo* il2cpp_mono_debug_lookup_locals(Il2CppMonoMethod* method); -MonoDebugMethodAsyncInfo* il2cpp_mono_debug_lookup_method_async_debug_info(Il2CppMonoMethod* method); +MonoDebugLocalsInfo* il2cpp_mono_debug_lookup_locals(MonoMethod* method); +MonoDebugMethodAsyncInfo* il2cpp_mono_debug_lookup_method_async_debug_info(MonoMethod* method); MonoDebugSourceLocation* il2cpp_mono_debug_method_lookup_location(MonoDebugMethodInfo* minfo, int il_offset); -gint32 il2cpp_mono_debug_il_offset_from_address(Il2CppMonoMethod* method, Il2CppMonoDomain* domain, guint32 native_offset); +gint32 il2cpp_mono_debug_il_offset_from_address(MonoMethod* method, Il2CppMonoDomain* domain, guint32 native_offset); void il2cpp_mono_debug_free_source_location(MonoDebugSourceLocation* location); void il2cpp_mono_set_is_debugger_attached(gboolean attached); -char* il2cpp_mono_type_full_name(Il2CppMonoType* type); -char* il2cpp_mono_method_full_name(Il2CppMonoMethod* method, gboolean signature); +char* il2cpp_mono_type_full_name(MonoType* type); +char* il2cpp_mono_method_full_name(MonoMethod* method, gboolean signature); void il2cpp_mono_debug_get_seq_points(MonoDebugMethodInfo* minfo, char** source_file, GPtrArray** source_file_list, int** source_files, MonoSymSeqPoint** seq_points, int* n_seq_points); void il2cpp_mono_debug_free_locals(MonoDebugLocalsInfo* info); void il2cpp_mono_debug_free_method_async_debug_info(MonoDebugMethodAsyncInfo* info); -Il2CppMonoThread* il2cpp_mono_thread_current(); -Il2CppMonoThread* il2cpp_mono_thread_get_main(); -Il2CppMonoThread* il2cpp_mono_thread_attach(Il2CppMonoDomain* domain); +MonoThread* il2cpp_mono_thread_current(); +MonoThread* il2cpp_mono_thread_get_main(); +MonoThread* il2cpp_mono_thread_attach(Il2CppMonoDomain* domain); void il2cpp_mono_domain_lock(Il2CppMonoDomain* domain); void il2cpp_mono_domain_unlock(Il2CppMonoDomain* domain); MonoJitInfo* il2cpp_mono_jit_info_table_find_internal(Il2CppMonoDomain* domain, char* addr, gboolean try_aot, gboolean allow_trampolines); guint il2cpp_mono_aligned_addr_hash(gconstpointer ptr); -Il2CppMonoGenericInst* il2cpp_mono_metadata_get_generic_inst(int type_argc, Il2CppMonoType** type_argv); -Il2CppMonoMethod* il2cpp_mono_get_method_checked(Il2CppMonoImage* image, guint32 token, Il2CppMonoClass* klass, Il2CppMonoGenericContext* context, MonoError* error); -int il2cpp_mono_class_interface_offset_with_variance(Il2CppMonoClass* klass, Il2CppMonoClass* itf, gboolean* non_exact_match); -void il2cpp_mono_class_setup_supertypes(Il2CppMonoClass* klass); -void il2cpp_mono_class_setup_vtable(Il2CppMonoClass* klass); -void il2cpp_mono_class_setup_methods(Il2CppMonoClass* klass); -gboolean il2cpp_mono_class_field_is_special_static(Il2CppMonoClassField* field); -guint32 il2cpp_mono_class_field_get_special_static_type(Il2CppMonoClassField* field); -Il2CppMonoGenericContext* il2cpp_mono_class_get_context(Il2CppMonoClass* klass); -Il2CppMonoGenericContext* il2cpp_mono_method_get_context(Il2CppMonoMethod* method); -Il2CppMonoGenericContainer* il2cpp_mono_method_get_generic_container(Il2CppMonoMethod* method); -Il2CppMonoMethod* il2cpp_mono_class_inflate_generic_method_full_checked(Il2CppMonoMethod* method, Il2CppMonoClass* klass_hint, Il2CppMonoGenericContext* context, MonoError* error); -Il2CppMonoMethod* il2cpp_mono_class_inflate_generic_method_checked(Il2CppMonoMethod* method, Il2CppMonoGenericContext* context, MonoError* error); +MonoGenericInst* il2cpp_mono_metadata_get_generic_inst(int type_argc, MonoType** type_argv); +MonoMethod* il2cpp_mono_get_method_checked(MonoImage* image, guint32 token, MonoClass* klass, MonoGenericContext* context, MonoError* error); +int il2cpp_mono_class_interface_offset_with_variance(MonoClass* klass, MonoClass* itf, gboolean* non_exact_match); +void il2cpp_mono_class_setup_supertypes(MonoClass* klass); +void il2cpp_mono_class_setup_vtable(MonoClass* klass); +void il2cpp_mono_class_setup_methods(MonoClass* klass); +gboolean il2cpp_mono_class_field_is_special_static(MonoClassField* field); +guint32 il2cpp_mono_class_field_get_special_static_type(MonoClassField* field); +MonoGenericContext* il2cpp_mono_class_get_context(MonoClass* klass); +MonoGenericContext* il2cpp_mono_method_get_context(MonoMethod* method); +MonoGenericContainer* il2cpp_mono_method_get_generic_container(MonoMethod* method); +MonoMethod* il2cpp_mono_class_inflate_generic_method_full_checked(MonoMethod* method, MonoClass* klass_hint, MonoGenericContext* context, MonoError* error); +MonoMethod* il2cpp_mono_class_inflate_generic_method_checked(MonoMethod* method, MonoGenericContext* context, MonoError* error); void il2cpp_mono_loader_lock(); void il2cpp_mono_loader_unlock(); void il2cpp_mono_loader_lock_track_ownership(gboolean track); gboolean il2cpp_mono_loader_lock_is_owned_by_self(); -gpointer il2cpp_mono_method_get_wrapper_data(Il2CppMonoMethod* method, guint32 id); -char* il2cpp_mono_type_get_name_full(Il2CppMonoType* type, MonoTypeNameFormat format); -gboolean il2cpp_mono_class_is_nullable(Il2CppMonoClass* klass); -Il2CppMonoGenericContainer* il2cpp_mono_class_get_generic_container(Il2CppMonoClass* klass); -void il2cpp_mono_class_setup_interfaces(Il2CppMonoClass* klass, MonoError* error); -GPtrArray* il2cpp_mono_class_get_methods_by_name(Il2CppMonoClass* klass, const char* name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError* error); -gpointer il2cpp_mono_ldtoken_checked(Il2CppMonoImage* image, guint32 token, Il2CppMonoClass** handle_class, Il2CppMonoGenericContext* context, MonoError* error); -Il2CppMonoClass* il2cpp_mono_class_from_generic_parameter_internal(Il2CppMonoGenericParam* param); -Il2CppMonoClass* il2cpp_mono_class_load_from_name(Il2CppMonoImage* image, const char* name_space, const char* name); -Il2CppMonoGenericClass* il2cpp_mono_class_get_generic_class(Il2CppMonoClass* klass); -Il2CppMonoInternalThread* il2cpp_mono_thread_internal_current(); -gboolean il2cpp_mono_thread_internal_is_current(Il2CppMonoInternalThread* thread); -void il2cpp_mono_thread_internal_abort(Il2CppMonoInternalThread* thread, gboolean appdomain_unload); -void il2cpp_mono_thread_internal_reset_abort(Il2CppMonoInternalThread* thread); -gunichar2* il2cpp_mono_thread_get_name(Il2CppMonoInternalThread* this_obj, guint32* name_len); -void il2cpp_mono_thread_set_name_internal(Il2CppMonoInternalThread* this_obj, Il2CppMonoString* name, gboolean permanent, gboolean reset, MonoError* error); +gpointer il2cpp_mono_method_get_wrapper_data(MonoMethod* method, guint32 id); +char* il2cpp_mono_type_get_name_full(MonoType* type, MonoTypeNameFormat format); +gboolean il2cpp_mono_class_is_nullable(MonoClass* klass); +MonoGenericContainer* il2cpp_mono_class_get_generic_container(MonoClass* klass); +void il2cpp_mono_class_setup_interfaces(MonoClass* klass, MonoError* error); +GPtrArray* il2cpp_mono_class_get_methods_by_name(MonoClass* klass, const char* name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError* error); +gpointer il2cpp_mono_ldtoken_checked(MonoImage* image, guint32 token, MonoClass** handle_class, MonoGenericContext* context, MonoError* error); +MonoClass* il2cpp_mono_class_from_generic_parameter_internal(MonoGenericParam* param); +MonoClass* il2cpp_mono_class_load_from_name(MonoImage* image, const char* name_space, const char* name); +MonoGenericClass* il2cpp_mono_class_get_generic_class(MonoClass* klass); +MonoInternalThread* il2cpp_mono_thread_internal_current(); +gboolean il2cpp_mono_thread_internal_is_current(MonoInternalThread* thread); +void il2cpp_mono_thread_internal_abort(MonoInternalThread* thread, gboolean appdomain_unload); +void il2cpp_mono_thread_internal_reset_abort(MonoInternalThread* thread); +gunichar2* il2cpp_mono_thread_get_name(MonoInternalThread* this_obj, guint32* name_len); +void il2cpp_mono_thread_set_name_internal(MonoInternalThread* this_obj, MonoString* name, gboolean permanent, gboolean reset, MonoError* error); void il2cpp_mono_thread_suspend_all_other_threads(); void il2cpp_mono_stack_mark_record_size(MonoThreadInfo* info, HandleStackMark* stackmark, const char* func_name); Il2CppMonoRuntimeExceptionHandlingCallbacks* il2cpp_mono_get_eh_callbacks(); -void il2cpp_mono_reflection_create_custom_attr_data_args(Il2CppMonoImage* image, Il2CppMonoMethod* method, const guchar* data, guint32 len, Il2CppMonoArray** typed_args, Il2CppMonoArray** named_args, CattrNamedArg** named_arg_info, MonoError* error); -void il2cpp_mono_nullable_init(guint8* buf, Il2CppMonoObject* value, Il2CppMonoClass* klass); -Il2CppMonoObject* il2cpp_mono_value_box_checked(Il2CppMonoDomain* domain, Il2CppMonoClass* klass, gpointer value, MonoError* error); -void il2cpp_mono_field_static_get_value_checked(Il2CppMonoVTable* vt, Il2CppMonoClassField* field, void* value, MonoError* error); -void il2cpp_mono_field_static_get_value_for_thread(Il2CppMonoInternalThread* thread, Il2CppMonoVTable* vt, Il2CppMonoClassField* field, void* value, MonoError* error); -Il2CppMonoObject* il2cpp_mono_field_get_value_object_checked(Il2CppMonoDomain* domain, Il2CppMonoClassField* field, Il2CppMonoObject* obj, MonoError* error); -Il2CppMonoObject* il2cpp_mono_object_new_checked(Il2CppMonoDomain* domain, Il2CppMonoClass* klass, MonoError* error); -Il2CppMonoString* il2cpp_mono_ldstr_checked(Il2CppMonoDomain* domain, Il2CppMonoImage* image, guint32 idx, MonoError* error); -Il2CppMonoObject* il2cpp_mono_runtime_try_invoke(Il2CppMonoMethod* method, void* obj, void** params, Il2CppMonoObject** exc, MonoError* error); -Il2CppMonoObject* il2cpp_mono_runtime_invoke_checked(Il2CppMonoMethod* method, void* obj, void** params, MonoError* error); +void il2cpp_mono_reflection_create_custom_attr_data_args(MonoImage* image, MonoMethod* method, const guchar* data, guint32 len, MonoArray** typed_args, MonoArray** named_args, CattrNamedArg** named_arg_info, MonoError* error); +void il2cpp_mono_nullable_init(guint8* buf, Il2CppMonoObject* value, MonoClass* klass); +Il2CppMonoObject* il2cpp_mono_value_box_checked(Il2CppMonoDomain* domain, MonoClass* klass, gpointer value, MonoError* error); +void il2cpp_mono_field_static_get_value_checked(Il2CppMonoVTable* vt, MonoClassField* field, void* value, MonoError* error); +void il2cpp_mono_field_static_get_value_for_thread(MonoInternalThread* thread, Il2CppMonoVTable* vt, MonoClassField* field, void* value, MonoError* error); +Il2CppMonoObject* il2cpp_mono_field_get_value_object_checked(Il2CppMonoDomain* domain, MonoClassField* field, Il2CppMonoObject* obj, MonoError* error); +Il2CppMonoObject* il2cpp_mono_object_new_checked(Il2CppMonoDomain* domain, MonoClass* klass, MonoError* error); +MonoString* il2cpp_mono_ldstr_checked(Il2CppMonoDomain* domain, MonoImage* image, guint32 idx, MonoError* error); +Il2CppMonoObject* il2cpp_mono_runtime_try_invoke(MonoMethod* method, void* obj, void** params, Il2CppMonoObject** exc, MonoError* error); +Il2CppMonoObject* il2cpp_mono_runtime_invoke_checked(MonoMethod* method, void* obj, void** params, MonoError* error); void il2cpp_mono_gc_base_init(); int il2cpp_mono_gc_register_root(char* start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char* msg); void il2cpp_mono_gc_deregister_root(char* addr); @@ -558,26 +453,26 @@ gint32 il2cpp_mono_environment_exitcode_get(); void il2cpp_mono_environment_exitcode_set(gint32 value); void il2cpp_mono_threadpool_suspend(); void il2cpp_mono_threadpool_resume(); -Il2CppMonoImage* il2cpp_mono_assembly_get_image(Il2CppMonoAssembly* assembly); +MonoImage* il2cpp_mono_assembly_get_image(Il2CppMonoAssembly* assembly); gboolean il2cpp_mono_runtime_try_shutdown(); -gboolean il2cpp_mono_verifier_is_method_valid_generic_instantiation(Il2CppMonoMethod* method); -Il2CppMonoType* il2cpp_mono_reflection_get_type_checked(Il2CppMonoImage* rootimage, Il2CppMonoImage* image, Il2CppMonoTypeNameParse* info, gboolean ignorecase, gboolean* type_resolve, MonoError* error); -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_method_checked(Il2CppMonoMethod* method, MonoError* error); -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_class_checked(Il2CppMonoClass* klass, MonoError* error); -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_property_checked(Il2CppMonoClass* klass, Il2CppMonoProperty* property, MonoError* error); -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_field_checked(Il2CppMonoClass* klass, Il2CppMonoClassField* field, MonoError* error); +gboolean il2cpp_mono_verifier_is_method_valid_generic_instantiation(MonoMethod* method); +MonoType* il2cpp_mono_reflection_get_type_checked(MonoImage* rootimage, MonoImage* image, Il2CppMonoTypeNameParse* info, gboolean ignorecase, gboolean* type_resolve, MonoError* error); +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_method_checked(MonoMethod* method, MonoError* error); +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_class_checked(MonoClass* klass, MonoError* error); +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_property_checked(MonoClass* klass, MonoProperty* property, MonoError* error); +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_field_checked(MonoClass* klass, MonoClassField* field, MonoError* error); Il2CppMonoReflectionAssemblyHandle il2cpp_mono_assembly_get_object_handle(Il2CppMonoDomain* domain, Il2CppMonoAssembly* assembly, MonoError* error); -Il2CppMonoReflectionType* il2cpp_mono_type_get_object_checked(Il2CppMonoDomain* domain, Il2CppMonoType* type, MonoError* error); +MonoReflectionType* il2cpp_mono_type_get_object_checked(Il2CppMonoDomain* domain, MonoType* type, MonoError* error); void il2cpp_mono_network_init(); gint il2cpp_mono_w32socket_set_blocking(SOCKET sock, gboolean blocking); char* il2cpp_mono_get_runtime_build_info(); -Il2CppMonoMethod* il2cpp_mono_marshal_method_from_wrapper(Il2CppMonoMethod* wrapper); +MonoMethod* il2cpp_mono_marshal_method_from_wrapper(MonoMethod* wrapper); MonoDebugOptions* il2cpp_mini_get_debug_options(); -gpointer il2cpp_mono_jit_find_compiled_method_with_jit_info(Il2CppMonoDomain* domain, Il2CppMonoMethod* method, MonoJitInfo** ji); +gpointer il2cpp_mono_jit_find_compiled_method_with_jit_info(Il2CppMonoDomain* domain, MonoMethod* method, MonoJitInfo** ji); MonoLMF** il2cpp_mono_get_lmf_addr(); void il2cpp_mono_set_lmf(MonoLMF* lmf); -gpointer il2cpp_mono_aot_get_method_checked(Il2CppMonoDomain* domain, Il2CppMonoMethod* method, MonoError* error); +gpointer il2cpp_mono_aot_get_method_checked(Il2CppMonoDomain* domain, MonoMethod* method, MonoError* error); void il2cpp_mono_arch_setup_resume_sighandler_ctx(MonoContext* ctx, gpointer func); void il2cpp_mono_arch_set_breakpoint(MonoJitInfo* ji, guint8* ip); void il2cpp_mono_arch_clear_breakpoint(MonoJitInfo* ji, guint8* ip); @@ -595,18 +490,18 @@ gboolean il2cpp_mono_thread_state_init_from_monoctx(MonoThreadUnwindState* ctx, MonoJitInfo* il2cpp_mini_jit_info_table_find(Il2CppMonoDomain* domain, char* addr, Il2CppMonoDomain** out_domain); void il2cpp_mono_restore_context(MonoContext* ctx); gboolean il2cpp_mono_find_jit_info_ext(Il2CppMonoDomain* domain, Il2CppMonoJitTlsData* jit_tls, MonoJitInfo* prev_ji, MonoContext* ctx, MonoContext* new_ctx, char** trace, MonoLMF** lmf, mgreg_t** save_locations, StackFrameInfo* frame); -Il2CppMonoMethod* il2cpp_mono_method_get_declaring_generic_method(Il2CppMonoMethod* method); -Il2CppMonoMethod* il2cpp_jinfo_get_method (MonoJitInfo *ji); -gboolean il2cpp_mono_find_prev_seq_point_for_native_offset (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); +MonoMethod* il2cpp_mono_method_get_declaring_generic_method(MonoMethod* method); +MonoMethod* il2cpp_jinfo_get_method (MonoJitInfo *ji); +gboolean il2cpp_mono_find_prev_seq_point_for_native_offset (Il2CppMonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); SOCKET il2cpp_mono_w32socket_accept_internal (SOCKET s, struct sockaddr *addr, socklen_t *addrlen, gboolean blocking); -gboolean il2cpp_mono_find_next_seq_point_for_native_offset (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); -gboolean il2cpp_mono_class_has_parent (Il2CppMonoClass *klass, Il2CppMonoClass *parent); -Il2CppMonoGenericParam* il2cpp_mono_generic_container_get_param (Il2CppMonoGenericContainer *gc, int i); -gboolean il2cpp_mono_find_seq_point (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point); +gboolean il2cpp_mono_find_next_seq_point_for_native_offset (Il2CppMonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point); +gboolean il2cpp_mono_class_has_parent (MonoClass *klass, MonoClass *parent); +MonoGenericParam* il2cpp_mono_generic_container_get_param (MonoGenericContainer *gc, int i); +gboolean il2cpp_mono_find_seq_point (Il2CppMonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point); void il2cpp_mono_seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info); gboolean il2cpp_mono_seq_point_iterator_next (SeqPointIterator* it); void il2cpp_mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next); -MonoSeqPointInfo* il2cpp_mono_get_seq_points (Il2CppMonoDomain *domain, Il2CppMonoMethod *method); +MonoSeqPointInfo* il2cpp_mono_get_seq_points (Il2CppMonoDomain *domain, MonoMethod *method); void IL2CPP_G_BREAKPOINT(); void il2cpp_mono_thread_info_safe_suspend_and_run (MonoNativeThreadId id, gboolean interrupt_kernel, MonoSuspendThreadCallback callback, gpointer user_data); void il2cpp_mono_error_cleanup (MonoError *oerror); @@ -614,16 +509,10 @@ Il2CppMonoException* il2cpp_mono_error_convert_to_exception (MonoError *target_e const char* il2cpp_mono_error_get_message (MonoError *oerror); void il2cpp_mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno); Il2CppSequencePointC* il2cpp_get_sequence_points(void* *iter); -Il2CppSequencePointC* il2cpp_get_method_sequence_points(Il2CppMonoMethod* method, void* *iter); -Il2CppMonoGenericInst* il2cpp_generic_class_get_inst(Il2CppMonoGenericClass *monoGenClass); -guint il2cpp_generic_inst_type_argc(Il2CppMonoGenericInst *monoInst); -Il2CppMonoType* il2cpp_generic_inst_type_arg(Il2CppMonoGenericInst *monoInst, int i); -Il2CppMonoType* il2cpp_class_this_arg(Il2CppMonoClass *monoClass); -Il2CppMonoClass* il2cpp_class_get_nested_types_accepts_generic(Il2CppMonoClass *monoClass, void* *iter); -Il2CppMonoClass* il2cpp_defaults_object_class(); -guint8 il2cpp_array_rank(Il2CppMonoArray *monoArr); -mono_array_size_t il2cpp_array_bound_length(Il2CppMonoArray *monoArr, int i); -mono_array_lower_bound_t il2cpp_array_bound_lower_bound(Il2CppMonoArray *monoArr, int i); +Il2CppSequencePointC* il2cpp_get_method_sequence_points(MonoMethod* method, void* *iter); +MonoClass* il2cpp_class_get_nested_types_accepts_generic(MonoClass *monoClass, void* *iter); +MonoClass* il2cpp_defaults_object_class(); +guint8 il2cpp_array_rank(MonoArray *monoArr); const char* il2cpp_assembly_name_name(Il2CppMonoAssembly *monoAssembly); uint16_t il2cpp_assembly_name_major(Il2CppMonoAssembly *monoAssembly); uint16_t il2cpp_assembly_name_minor(Il2CppMonoAssembly *monoAssembly); @@ -633,31 +522,23 @@ const char* il2cpp_assembly_name_culture(Il2CppMonoAssembly *monoAssembly); mono_byte il2cpp_assembly_name_public_key_token(Il2CppMonoAssembly *monoAssembly, int i); const char* il2cpp_assembly_name_public_key_token_string(Il2CppMonoAssembly *monoAssembly); uint32_t il2cpp_assembly_name_flags(Il2CppMonoAssembly *monoAssembly); -const char* il2cpp_image_name(Il2CppMonoImage *monoImage); -Il2CppMonoAssembly* il2cpp_image_assembly(Il2CppMonoImage *monoImage); -guint8* il2cpp_field_get_address(Il2CppMonoObject *obj, Il2CppMonoClassField *monoField); -Il2CppMonoType* il2cpp_mono_object_get_type(Il2CppMonoObject* object); -Il2CppMonoClass* il2cpp_defaults_exception_class(); -Il2CppMonoImage* il2cpp_defaults_corlib_image(); -int il2cpp_generic_container_get_type_argc(Il2CppMonoGenericClass* container); -uint32_t il2cpp_method_get_flags_no_iflags (const Il2CppMonoMethod * method); -bool il2cpp_method_is_string_ctor (const Il2CppMonoMethod * method); -Il2CppMonoClass* il2cpp_defaults_void_class(); -void il2cpp_set_var(guint8* newValue, void *value, Il2CppMonoType *localVariableTypeMono); -Il2CppMonoMethod* il2cpp_get_interface_method(Il2CppMonoClass* klass, Il2CppMonoClass* itf, int slot); -gboolean il2cpp_field_is_deleted(Il2CppMonoClassField *field); -Il2CppMonoGenericClass* il2cpp_type_get_generic_class(Il2CppMonoType *type); -gboolean il2cpp_class_get_enumtype(Il2CppMonoClass *klass); -Il2CppMonoClass* il2cpp_iterate_loaded_classes(void* *iter); +const char* il2cpp_image_name(MonoImage *monoImage); +guint8* il2cpp_field_get_address(Il2CppMonoObject *obj, MonoClassField *monoField); +MonoType* il2cpp_mono_object_get_type(Il2CppMonoObject* object); +MonoClass* il2cpp_defaults_exception_class(); +MonoImage* il2cpp_defaults_corlib_image(); +bool il2cpp_method_is_string_ctor (const MonoMethod * method); +MonoClass* il2cpp_defaults_void_class(); +void il2cpp_set_var(guint8* newValue, void *value, MonoType *localVariableTypeMono); +MonoMethod* il2cpp_get_interface_method(MonoClass* klass, MonoClass* itf, int slot); +gboolean il2cpp_field_is_deleted(MonoClassField *field); +MonoClass* il2cpp_iterate_loaded_classes(void* *iter); Il2CppMonoAssembly* il2cpp_domain_get_assemblies_iter(Il2CppMonoAppDomain *domain, void* *iter); -const char** il2cpp_get_source_files_for_type(Il2CppMonoClass *klass, int *count); -Il2CppMonoInternalThread* il2cpp_mono_thread_get_internal(Il2CppMonoThread* thread); -uint32_t il2cpp_internal_thread_get_state(Il2CppMonoInternalThread* thread); -il2cpp_internal_thread_get_threadpool_thread(Il2CppMonoInternalThread* thread); -Il2CppMonoMethod* il2cpp_method_get_generic_definition(Il2CppMonoMethodInflated *imethod); -Il2CppMonoGenericInst* il2cpp_method_get_generic_class_inst(Il2CppMonoMethodInflated *imethod); -Il2CppMonoClass* il2cpp_generic_class_get_container_class(Il2CppMonoGenericClass *gclass); -void il2cpp_mono_thread_detach(Il2CppMonoThread* thread); -Il2CppMonoClass* il2cpp_mono_get_string_class (void); +const char** il2cpp_get_source_files_for_type(MonoClass *klass, int *count); +MonoMethod* il2cpp_method_get_generic_definition(Il2CppMonoMethodInflated *imethod); +MonoGenericInst* il2cpp_method_get_generic_class_inst(Il2CppMonoMethodInflated *imethod); +MonoClass* il2cpp_generic_class_get_container_class(MonoGenericClass *gclass); +void il2cpp_mono_thread_detach(MonoThread* thread); +MonoClass* il2cpp_mono_get_string_class (void); #endif // RUNTIME_IL2CPP diff --git a/mono/mini/il2cpp-stubs.cpp b/mono/mini/il2cpp-stubs.cpp index 99a1f115050a..379759cd2134 100644 --- a/mono/mini/il2cpp-stubs.cpp +++ b/mono/mini/il2cpp-stubs.cpp @@ -50,33 +50,33 @@ static MonoGHashTable *method_signatures; static il2cpp::os::Mutex s_il2cpp_mono_loader_lock(false); static uint64_t s_il2cpp_mono_loader_lock_tid = 0; -Il2CppMonoMethod* il2cpp_mono_image_get_entry_point (Il2CppMonoImage *image) +MonoMethod* il2cpp_mono_image_get_entry_point (MonoImage *image) { - return (Il2CppMonoMethod*)il2cpp::vm::Image::GetEntryPoint((Il2CppImage*)image); + return (MonoMethod*)il2cpp::vm::Image::GetEntryPoint((Il2CppImage*)image); } -const char* il2cpp_mono_image_get_filename (Il2CppMonoImage *monoImage) +const char* il2cpp_mono_image_get_filename (MonoImage *monoImage) { Il2CppImage *image = (Il2CppImage*)monoImage; return image->name; } -const char* il2cpp_mono_image_get_guid (Il2CppMonoImage *image) +const char* il2cpp_mono_image_get_guid (MonoImage *image) { return "00000000-0000-0000-0000-000000000000"; //IL2CPP doesn't have image GUIDs } -Il2CppMonoClass* il2cpp_mono_type_get_class (Il2CppMonoType *type) +MonoClass* il2cpp_mono_type_get_class (MonoType *type) { - return (Il2CppMonoClass*) il2cpp::vm::Type::GetClass((Il2CppType*)type); + return (MonoClass*) il2cpp::vm::Type::GetClass((Il2CppType*)type); } -mono_bool il2cpp_mono_type_is_struct (Il2CppMonoType *type) +mono_bool il2cpp_mono_type_is_struct (MonoType *type) { return il2cpp::vm::Type::IsStruct((Il2CppType*)type); } -mono_bool il2cpp_mono_type_is_reference (Il2CppMonoType *type) +mono_bool il2cpp_mono_type_is_reference (MonoType *type) { return il2cpp::vm::Type::IsReference((Il2CppType*)type); } @@ -86,7 +86,7 @@ void il2cpp_mono_metadata_free_mh (Il2CppMonoMethodHeader *mh) IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -Il2CppMonoMethodSignature* il2cpp_mono_method_signature (Il2CppMonoMethod *m) +Il2CppMonoMethodSignature* il2cpp_mono_method_signature (MonoMethod *m) { MethodInfo* method = (MethodInfo*)m; @@ -101,7 +101,7 @@ Il2CppMonoMethodSignature* il2cpp_mono_method_signature (Il2CppMonoMethod *m) sig->call_convention = MONO_CALL_DEFAULT; sig->hasthis = il2cpp::vm::Method::IsInstance(method); - sig->ret = (Il2CppMonoType*)il2cpp::vm::Method::GetReturnType(method); + sig->ret = (MonoType*)il2cpp::vm::Method::GetReturnType(method); sig->generic_param_count = 0; @@ -119,9 +119,9 @@ Il2CppMonoMethodSignature* il2cpp_mono_method_signature (Il2CppMonoMethod *m) } sig->param_count = il2cpp::vm::Method::GetParamCount(method); - sig->params = g_new(Il2CppMonoType*, sig->param_count); + sig->params = g_new(MonoType*, sig->param_count); for (int i = 0; i < sig->param_count; ++i) - sig->params[i] = (Il2CppMonoType*)il2cpp::vm::Method::GetParam(method, i); + sig->params[i] = (MonoType*)il2cpp::vm::Method::GetParam(method, i); mono_g_hash_table_insert(method_signatures, method, sig); @@ -144,7 +144,7 @@ void il2cpp_mono_free_method_signatures() } } -void il2cpp_mono_method_get_param_names (Il2CppMonoMethod *m, const char **names) +void il2cpp_mono_method_get_param_names (MonoMethod *m, const char **names) { MethodInfo* method = (MethodInfo*)m; uint32_t numberOfParameters = il2cpp::vm::Method::GetParamCount(method); @@ -152,7 +152,7 @@ void il2cpp_mono_method_get_param_names (Il2CppMonoMethod *m, const char **names names[i] = il2cpp::vm::Method::GetParamName(method, i); } -mono_bool il2cpp_mono_type_generic_inst_is_valuetype (Il2CppMonoType *monoType) +mono_bool il2cpp_mono_type_generic_inst_is_valuetype (MonoType *monoType) { static const int kBitIsValueType = 1; Il2CppType *type = (Il2CppType*)monoType; @@ -160,126 +160,126 @@ mono_bool il2cpp_mono_type_generic_inst_is_valuetype (Il2CppMonoType *monoType) return (typeDef->bitfield >> (kBitIsValueType - 1)) & 0x1; } -Il2CppMonoMethodHeader* il2cpp_mono_method_get_header_checked (Il2CppMonoMethod *method, MonoError *error) +Il2CppMonoMethodHeader* il2cpp_mono_method_get_header_checked (MonoMethod *method, MonoError *error) { return NULL; } -gboolean il2cpp_mono_class_init (Il2CppMonoClass *klass) +gboolean il2cpp_mono_class_init (MonoClass *klass) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -Il2CppMonoVTable* il2cpp_mono_class_vtable (Il2CppMonoDomain *domain, Il2CppMonoClass *klass) +Il2CppMonoVTable* il2cpp_mono_class_vtable (Il2CppMonoDomain *domain, MonoClass *klass) { return (Il2CppMonoVTable*)((Il2CppClass*)klass)->vtable; } -Il2CppMonoClassField* il2cpp_mono_class_get_field_from_name (Il2CppMonoClass *klass, const char *name) +MonoClassField* il2cpp_mono_class_get_field_from_name (MonoClass *klass, const char *name) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -int32_t il2cpp_mono_array_element_size (Il2CppMonoClass *monoClass) +int32_t il2cpp_mono_array_element_size (MonoClass *monoClass) { Il2CppClass *klass = (Il2CppClass*)monoClass; return klass->element_size; } -int32_t il2cpp_mono_class_instance_size (Il2CppMonoClass *klass) +int32_t il2cpp_mono_class_instance_size (MonoClass *klass) { return il2cpp::vm::Class::GetInstanceSize((Il2CppClass*)klass); } -int32_t il2cpp_mono_class_value_size (Il2CppMonoClass *klass, uint32_t *align) +int32_t il2cpp_mono_class_value_size (MonoClass *klass, uint32_t *align) { return il2cpp::vm::Class::GetValueSize((Il2CppClass*)klass, align); } -gboolean il2cpp_mono_class_is_assignable_from (Il2CppMonoClass *klass, Il2CppMonoClass *oklass) +gboolean il2cpp_mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass) { return il2cpp::vm::Class::IsAssignableFrom((Il2CppClass*)klass, (Il2CppClass*)oklass); } -Il2CppMonoClass* il2cpp_mono_class_from_mono_type (Il2CppMonoType *type) +MonoClass* il2cpp_mono_class_from_mono_type (MonoType *type) { - return (Il2CppMonoClass*)il2cpp::vm::Class::FromIl2CppType((Il2CppType*)type); + return (MonoClass*)il2cpp::vm::Class::FromIl2CppType((Il2CppType*)type); } -int il2cpp_mono_class_num_fields (Il2CppMonoClass *klass) +int il2cpp_mono_class_num_fields (MonoClass *klass) { return il2cpp::vm::Class::GetNumFields((Il2CppClass*)klass); } -int il2cpp_mono_class_num_methods (Il2CppMonoClass *klass) +int il2cpp_mono_class_num_methods (MonoClass *klass) { return il2cpp::vm::Class::GetNumMethods((Il2CppClass*)klass); } -int il2cpp_mono_class_num_properties (Il2CppMonoClass *klass) +int il2cpp_mono_class_num_properties (MonoClass *klass) { return il2cpp::vm::Class::GetNumProperties((Il2CppClass*)klass); } -Il2CppMonoClassField* il2cpp_mono_class_get_fields (Il2CppMonoClass* klass, gpointer *iter) +MonoClassField* il2cpp_mono_class_get_fields (MonoClass* klass, gpointer *iter) { - return (Il2CppMonoClassField*)il2cpp::vm::Class::GetFields((Il2CppClass*)klass, iter); + return (MonoClassField*)il2cpp::vm::Class::GetFields((Il2CppClass*)klass, iter); } -Il2CppMonoMethod* il2cpp_mono_class_get_methods (Il2CppMonoClass* klass, gpointer *iter) +MonoMethod* il2cpp_mono_class_get_methods (MonoClass* klass, gpointer *iter) { - return (Il2CppMonoMethod*)il2cpp::vm::Class::GetMethods((Il2CppClass*)klass, iter); + return (MonoMethod*)il2cpp::vm::Class::GetMethods((Il2CppClass*)klass, iter); } -Il2CppMonoProperty* il2cpp_mono_class_get_properties (Il2CppMonoClass* klass, gpointer *iter) +MonoProperty* il2cpp_mono_class_get_properties (MonoClass* klass, gpointer *iter) { - return (Il2CppMonoProperty*)il2cpp::vm::Class::GetProperties((Il2CppClass*)klass, iter); + return (MonoProperty*)il2cpp::vm::Class::GetProperties((Il2CppClass*)klass, iter); } -const char* il2cpp_mono_field_get_name (Il2CppMonoClassField *field) +const char* il2cpp_mono_field_get_name (MonoClassField *field) { return il2cpp::vm::Field::GetName((FieldInfo*)field); } -mono_unichar2* il2cpp_mono_string_chars (Il2CppMonoString *monoStr) +mono_unichar2* il2cpp_mono_string_chars (MonoString *monoStr) { Il2CppString *str = (Il2CppString*)monoStr; return (mono_unichar2*)str->chars; } -int il2cpp_mono_string_length (Il2CppMonoString *monoStr) +int il2cpp_mono_string_length (MonoString *monoStr) { Il2CppString *str = (Il2CppString*)monoStr; return str->length; } -char* il2cpp_mono_array_addr_with_size (Il2CppMonoArray *array, int size, uintptr_t idx) +char* il2cpp_mono_array_addr_with_size (MonoArray *array, int size, uintptr_t idx) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -uintptr_t il2cpp_mono_array_length (Il2CppMonoArray *array) +uintptr_t il2cpp_mono_array_length (MonoArray *array) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -Il2CppMonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text) +MonoString* il2cpp_mono_string_new (Il2CppMonoDomain *domain, const char *text) { - return (Il2CppMonoString*)il2cpp::vm::String::New(text); + return (MonoString*)il2cpp::vm::String::New(text); } -Il2CppMonoString* il2cpp_mono_string_new_checked (Il2CppMonoDomain *domain, const char *text, MonoError *merror) +MonoString* il2cpp_mono_string_new_checked (Il2CppMonoDomain *domain, const char *text, MonoError *merror) { error_init(merror); return il2cpp_mono_string_new (domain, text); } -char* il2cpp_mono_string_to_utf8_checked (Il2CppMonoString *string_obj, MonoError *error) +char* il2cpp_mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error) { error_init(error); Il2CppString *str = (Il2CppString*)string_obj; @@ -298,12 +298,12 @@ void* il2cpp_mono_object_unbox (Il2CppMonoObject *monoObj) return il2cpp::vm::Object::Unbox(obj); } -void il2cpp_mono_field_set_value (Il2CppMonoObject *obj, Il2CppMonoClassField *field, void *value) +void il2cpp_mono_field_set_value (Il2CppMonoObject *obj, MonoClassField *field, void *value) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -void il2cpp_mono_field_static_set_value (Il2CppMonoVTable *vt, Il2CppMonoClassField *field, void *value) +void il2cpp_mono_field_static_set_value (Il2CppMonoVTable *vt, MonoClassField *field, void *value) { il2cpp::vm::Field::StaticSetValue((FieldInfo*)field, value); } @@ -345,7 +345,7 @@ void il2cpp_mono_reflection_free_type_info (Il2CppMonoTypeNameParse *info) delete (il2cpp::vm::TypeNameParseInfo*)info->il2cppTypeNameParseInfo; } -mono_bool il2cpp_mono_custom_attrs_has_attr (Il2CppMonoCustomAttrInfo *ainfo, Il2CppMonoClass *attr_klass) +mono_bool il2cpp_mono_custom_attrs_has_attr (Il2CppMonoCustomAttrInfo *ainfo, MonoClass *attr_klass) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -393,18 +393,18 @@ MonoJitInfo* il2cpp_mono_jit_info_table_find(Il2CppMonoDomain* domain, char* add return NULL; } -Il2CppMonoMethod* il2cpp_mono_jit_info_get_method(MonoJitInfo* ji) +MonoMethod* il2cpp_mono_jit_info_get_method(MonoJitInfo* ji) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -MonoDebugMethodInfo* il2cpp_mono_debug_lookup_method(Il2CppMonoMethod* method) +MonoDebugMethodInfo* il2cpp_mono_debug_lookup_method(MonoMethod* method) { return NULL; } -MonoDebugMethodJitInfo* il2cpp_mono_debug_find_method(Il2CppMonoMethod* method, Il2CppMonoDomain* domain) +MonoDebugMethodJitInfo* il2cpp_mono_debug_find_method(MonoMethod* method, Il2CppMonoDomain* domain) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -415,13 +415,13 @@ void il2cpp_mono_debug_free_method_jit_info(MonoDebugMethodJitInfo* jit) IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -MonoDebugLocalsInfo* il2cpp_mono_debug_lookup_locals(Il2CppMonoMethod* method) +MonoDebugLocalsInfo* il2cpp_mono_debug_lookup_locals(MonoMethod* method) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -MonoDebugMethodAsyncInfo* il2cpp_mono_debug_lookup_method_async_debug_info(Il2CppMonoMethod* method) +MonoDebugMethodAsyncInfo* il2cpp_mono_debug_lookup_method_async_debug_info(MonoMethod* method) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -433,7 +433,7 @@ MonoDebugSourceLocation* il2cpp_mono_debug_method_lookup_location(MonoDebugMetho return NULL; } -gint32 il2cpp_mono_debug_il_offset_from_address(Il2CppMonoMethod* method, Il2CppMonoDomain* domain, guint32 native_offset) +gint32 il2cpp_mono_debug_il_offset_from_address(MonoMethod* method, Il2CppMonoDomain* domain, guint32 native_offset) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -449,13 +449,13 @@ void il2cpp_mono_set_is_debugger_attached(gboolean attached) il2cpp::utils::Debugger::SetIsDebuggerAttached(attached == TRUE); } -char* il2cpp_mono_type_full_name(Il2CppMonoType* type) +char* il2cpp_mono_type_full_name(MonoType* type) { std::string name = il2cpp::vm::Type::GetName((Il2CppType*)type, IL2CPP_TYPE_NAME_FORMAT_FULL_NAME); return g_strdup(name.c_str()); } -char* il2cpp_mono_method_full_name(Il2CppMonoMethod* method, gboolean signature) +char* il2cpp_mono_method_full_name(MonoMethod* method, gboolean signature) { return g_strdup(((MethodInfo*)method)->name); } @@ -475,31 +475,26 @@ void il2cpp_mono_debug_free_method_async_debug_info(MonoDebugMethodAsyncInfo* in IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -Il2CppMonoThread* il2cpp_mono_thread_current() +MonoThread* il2cpp_mono_thread_current() { - return (Il2CppMonoThread*)il2cpp::vm::Thread::Current(); + return (MonoThread*)il2cpp::vm::Thread::Current(); } -Il2CppMonoThread* il2cpp_mono_thread_get_main() +MonoThread* il2cpp_mono_thread_get_main() { - return (Il2CppMonoThread*)il2cpp::vm::Thread::Main(); + return (MonoThread*)il2cpp::vm::Thread::Main(); } -Il2CppMonoThread* il2cpp_mono_thread_attach(Il2CppMonoDomain* domain) +MonoThread* il2cpp_mono_thread_attach(Il2CppMonoDomain* domain) { - return (Il2CppMonoThread*)il2cpp::vm::Thread::Attach((Il2CppDomain*)domain); + return (MonoThread*)il2cpp::vm::Thread::Attach((Il2CppDomain*)domain); } -void il2cpp_mono_thread_detach(Il2CppMonoThread* thread) +void il2cpp_mono_thread_detach(MonoThread* thread) { il2cpp::vm::Thread::Detach((Il2CppThread*)thread); } -Il2CppMonoInternalThread* il2cpp_mono_thread_get_internal(Il2CppMonoThread* thread) -{ - return (Il2CppMonoInternalThread*)(((Il2CppThread*)thread)->internal_thread); -} - void il2cpp_mono_domain_lock(Il2CppMonoDomain* domain) { } @@ -519,12 +514,12 @@ guint il2cpp_mono_aligned_addr_hash(gconstpointer ptr) return GPOINTER_TO_UINT(ptr) >> 3; } -Il2CppMonoGenericInst* il2cpp_mono_metadata_get_generic_inst(int type_argc, Il2CppMonoType** type_argv) +MonoGenericInst* il2cpp_mono_metadata_get_generic_inst(int type_argc, MonoType** type_argv) { - return (Il2CppMonoGenericInst*)il2cpp::vm::MetadataCache::GetGenericInst((Il2CppType**)type_argv, type_argc); + return (MonoGenericInst*)il2cpp::vm::MetadataCache::GetGenericInst((Il2CppType**)type_argv, type_argc); } -Il2CppMonoMethod* il2cpp_mono_get_method_checked(Il2CppMonoImage* image, guint32 token, Il2CppMonoClass* klass, Il2CppMonoGenericContext* context, MonoError* error) +MonoMethod* il2cpp_mono_get_method_checked(MonoImage* image, guint32 token, MonoClass* klass, MonoGenericContext* context, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -546,73 +541,73 @@ MonoGCDescriptor il2cpp_mono_gc_make_vector_descr (void) return 0; } -int il2cpp_mono_class_interface_offset_with_variance(Il2CppMonoClass* klass, Il2CppMonoClass* itf, gboolean* non_exact_match) +int il2cpp_mono_class_interface_offset_with_variance(MonoClass* klass, MonoClass* itf, gboolean* non_exact_match) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -void il2cpp_mono_class_setup_supertypes(Il2CppMonoClass* klass) +void il2cpp_mono_class_setup_supertypes(MonoClass* klass) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -void il2cpp_mono_class_setup_vtable(Il2CppMonoClass* klass) +void il2cpp_mono_class_setup_vtable(MonoClass* klass) { il2cpp::vm::Class::Init((Il2CppClass*)klass); } -void il2cpp_mono_class_setup_methods(Il2CppMonoClass* klass) +void il2cpp_mono_class_setup_methods(MonoClass* klass) { il2cpp::vm::Class::SetupMethods((Il2CppClass*)klass); } -gboolean il2cpp_mono_class_field_is_special_static(Il2CppMonoClassField* field) +gboolean il2cpp_mono_class_field_is_special_static(MonoClassField* field) { return il2cpp::vm::Field::IsNormalStatic((FieldInfo*)field) ? FALSE : TRUE; } -guint32 il2cpp_mono_class_field_get_special_static_type(Il2CppMonoClassField* field) +guint32 il2cpp_mono_class_field_get_special_static_type(MonoClassField* field) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -Il2CppMonoGenericContext* il2cpp_mono_class_get_context(Il2CppMonoClass* klass) +MonoGenericContext* il2cpp_mono_class_get_context(MonoClass* klass) { - return (Il2CppMonoGenericContext*)&((Il2CppClass*)klass)->generic_class->context; + return (MonoGenericContext*)&((Il2CppClass*)klass)->generic_class->context; } -Il2CppMonoGenericContext* il2cpp_mono_method_get_context(Il2CppMonoMethod* monoMethod) +MonoGenericContext* il2cpp_mono_method_get_context(MonoMethod* monoMethod) { MethodInfo * method = (MethodInfo*)monoMethod; if (!method->is_inflated || method->is_generic) return NULL; - return (Il2CppMonoGenericContext*) &((MethodInfo*)method)->genericMethod->context; + return (MonoGenericContext*) &((MethodInfo*)method)->genericMethod->context; } -Il2CppMonoGenericContainer* il2cpp_mono_method_get_generic_container(Il2CppMonoMethod* monoMethod) +MonoGenericContainer* il2cpp_mono_method_get_generic_container(MonoMethod* monoMethod) { MethodInfo * method = (MethodInfo*)monoMethod; if (method->is_inflated || !method->is_generic) return NULL; - return (Il2CppMonoGenericContainer*) method->genericContainer; + return (MonoGenericContainer*) method->genericContainer; } -Il2CppMonoMethod* il2cpp_mono_class_inflate_generic_method_full_checked(Il2CppMonoMethod* method, Il2CppMonoClass* klass_hint, Il2CppMonoGenericContext* context, MonoError* error) +MonoMethod* il2cpp_mono_class_inflate_generic_method_full_checked(MonoMethod* method, MonoClass* klass_hint, MonoGenericContext* context, MonoError* error) { error_init(error); - return (Il2CppMonoMethod*) il2cpp::metadata::GenericMetadata::Inflate((MethodInfo*)method, (Il2CppClass*)klass_hint, (Il2CppGenericContext*)context); + return (MonoMethod*) il2cpp::metadata::GenericMetadata::Inflate((MethodInfo*)method, (Il2CppClass*)klass_hint, (Il2CppGenericContext*)context); } -Il2CppMonoMethod* il2cpp_mono_class_inflate_generic_method_checked(Il2CppMonoMethod* method, Il2CppMonoGenericContext* context, MonoError* error) +MonoMethod* il2cpp_mono_class_inflate_generic_method_checked(MonoMethod* method, MonoGenericContext* context, MonoError* error) { error_init(error); - return (Il2CppMonoMethod*)il2cpp::metadata::GenericMetadata::Inflate((MethodInfo*)method, NULL, (Il2CppGenericContext*)context); + return (MonoMethod*)il2cpp::metadata::GenericMetadata::Inflate((MethodInfo*)method, NULL, (Il2CppGenericContext*)context); } void il2cpp_mono_loader_lock() @@ -636,29 +631,29 @@ gboolean il2cpp_mono_loader_lock_is_owned_by_self() return s_il2cpp_mono_loader_lock_tid == il2cpp::os::Thread::CurrentThreadId(); } -gpointer il2cpp_mono_method_get_wrapper_data(Il2CppMonoMethod* method, guint32 id) +gpointer il2cpp_mono_method_get_wrapper_data(MonoMethod* method, guint32 id) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -char* il2cpp_mono_type_get_name_full(Il2CppMonoType* type, MonoTypeNameFormat format) +char* il2cpp_mono_type_get_name_full(MonoType* type, MonoTypeNameFormat format) { std::string name = il2cpp::vm::Type::GetName((Il2CppType*)type, (Il2CppTypeNameFormat)format); return g_strdup(name.c_str()); } -gboolean il2cpp_mono_class_is_nullable(Il2CppMonoClass* klass) +gboolean il2cpp_mono_class_is_nullable(MonoClass* klass) { return il2cpp::vm::Class::IsNullable((Il2CppClass*)klass); } -Il2CppMonoGenericContainer* il2cpp_mono_class_get_generic_container(Il2CppMonoClass* klass) +MonoGenericContainer* il2cpp_mono_class_get_generic_container(MonoClass* klass) { - return (Il2CppMonoGenericContainer*)il2cpp::vm::Class::GetGenericContainer((Il2CppClass*)klass); + return (MonoGenericContainer*)il2cpp::vm::Class::GetGenericContainer((Il2CppClass*)klass); } -void il2cpp_mono_class_setup_interfaces(Il2CppMonoClass* klass, MonoError* error) +void il2cpp_mono_class_setup_interfaces(MonoClass* klass, MonoError* error) { error_init(error); il2cpp::vm::Class::SetupInterfaces((Il2CppClass*)klass); @@ -698,7 +693,7 @@ method_nonpublic (MethodInfo* method, gboolean start_klass) } } -GPtrArray* il2cpp_mono_class_get_methods_by_name(Il2CppMonoClass* il2cppMonoKlass, const char* name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError* error) +GPtrArray* il2cpp_mono_class_get_methods_by_name(MonoClass* il2cppMonoKlass, const char* name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError* error) { GPtrArray *array; Il2CppClass *klass = (Il2CppClass*)il2cppMonoKlass; @@ -732,11 +727,11 @@ GPtrArray* il2cpp_mono_class_get_methods_by_name(Il2CppMonoClass* il2cppMonoKlas memset (method_slots, 0, sizeof (method_slots_default)); }*/ handle_parent: - il2cpp_mono_class_setup_methods ((Il2CppMonoClass*)klass); - il2cpp_mono_class_setup_vtable ((Il2CppMonoClass*)klass); + il2cpp_mono_class_setup_methods ((MonoClass*)klass); + il2cpp_mono_class_setup_vtable ((MonoClass*)klass); iter = NULL; - while ((method = (MethodInfo*)il2cpp_mono_class_get_methods ((Il2CppMonoClass*)klass, &iter))) { + while ((method = (MethodInfo*)il2cpp_mono_class_get_methods ((MonoClass*)klass, &iter))) { match = 0; /*if (method->slot != -1) { g_assert (method->slot < nslots); @@ -785,55 +780,55 @@ GPtrArray* il2cpp_mono_class_get_methods_by_name(Il2CppMonoClass* il2cppMonoKlas return array; } -gpointer il2cpp_mono_ldtoken_checked(Il2CppMonoImage* image, guint32 token, Il2CppMonoClass** handle_class, Il2CppMonoGenericContext* context, MonoError* error) +gpointer il2cpp_mono_ldtoken_checked(MonoImage* image, guint32 token, MonoClass** handle_class, MonoGenericContext* context, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -Il2CppMonoClass* il2cpp_mono_class_from_generic_parameter_internal(Il2CppMonoGenericParam* param) +MonoClass* il2cpp_mono_class_from_generic_parameter_internal(MonoGenericParam* param) { - return (Il2CppMonoClass*)il2cpp::vm::Class::FromGenericParameter((Il2CppGenericParameter*)param); + return (MonoClass*)il2cpp::vm::Class::FromGenericParameter((Il2CppGenericParameter*)param); } -Il2CppMonoClass* il2cpp_mono_class_load_from_name(Il2CppMonoImage* image, const char* name_space, const char* name) +MonoClass* il2cpp_mono_class_load_from_name(MonoImage* image, const char* name_space, const char* name) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -Il2CppMonoGenericClass* il2cpp_mono_class_get_generic_class(Il2CppMonoClass* monoClass) +MonoGenericClass* il2cpp_mono_class_get_generic_class(MonoClass* monoClass) { Il2CppClass *klass = (Il2CppClass*)monoClass; - return (Il2CppMonoGenericClass*)klass->generic_class; + return (MonoGenericClass*)klass->generic_class; } -Il2CppMonoInternalThread* il2cpp_mono_thread_internal_current() +MonoInternalThread* il2cpp_mono_thread_internal_current() { - return (Il2CppMonoInternalThread*)(((Il2CppThread*)il2cpp_mono_thread_current())->internal_thread); + return (MonoInternalThread*)(((Il2CppThread*)il2cpp_mono_thread_current())->internal_thread); } -gboolean il2cpp_mono_thread_internal_is_current(Il2CppMonoInternalThread* thread) +gboolean il2cpp_mono_thread_internal_is_current(MonoInternalThread* thread) { return il2cpp_mono_thread_internal_current () == thread; } -void il2cpp_mono_thread_internal_abort(Il2CppMonoInternalThread* thread, gboolean appdomain_unload) +void il2cpp_mono_thread_internal_abort(MonoInternalThread* thread, gboolean appdomain_unload) { il2cpp::vm::Thread::RequestAbort((Il2CppInternalThread*)thread); } -void il2cpp_mono_thread_internal_reset_abort(Il2CppMonoInternalThread* thread) +void il2cpp_mono_thread_internal_reset_abort(MonoInternalThread* thread) { il2cpp::vm::Thread::ResetAbort((Il2CppInternalThread*)thread); } -gunichar2* il2cpp_mono_thread_get_name(Il2CppMonoInternalThread* this_obj, guint32* name_len) +gunichar2* il2cpp_mono_thread_get_name(MonoInternalThread* this_obj, guint32* name_len) { return NULL; } -void il2cpp_mono_thread_set_name_internal(Il2CppMonoInternalThread* this_obj, Il2CppMonoString* name, gboolean permanent, gboolean reset, MonoError* error) +void il2cpp_mono_thread_set_name_internal(MonoInternalThread* this_obj, MonoString* name, gboolean permanent, gboolean reset, MonoError* error) { il2cpp::vm::Thread::SetName((Il2CppInternalThread*)this_obj, (Il2CppString*)name); error_init(error); @@ -855,53 +850,53 @@ Il2CppMonoRuntimeExceptionHandlingCallbacks* il2cpp_mono_get_eh_callbacks() return NULL; } -void il2cpp_mono_reflection_create_custom_attr_data_args(Il2CppMonoImage* image, Il2CppMonoMethod* method, const guchar* data, guint32 len, Il2CppMonoArray** typed_args, Il2CppMonoArray** named_args, CattrNamedArg** named_arg_info, MonoError* error) +void il2cpp_mono_reflection_create_custom_attr_data_args(MonoImage* image, MonoMethod* method, const guchar* data, guint32 len, MonoArray** typed_args, MonoArray** named_args, CattrNamedArg** named_arg_info, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -void il2cpp_mono_nullable_init(guint8* buf, Il2CppMonoObject* value, Il2CppMonoClass* klass) +void il2cpp_mono_nullable_init(guint8* buf, Il2CppMonoObject* value, MonoClass* klass) { il2cpp::vm::Object::NullableInit(buf, (Il2CppObject*)value, (Il2CppClass*)klass); } -Il2CppMonoObject* il2cpp_mono_value_box_checked(Il2CppMonoDomain* domain, Il2CppMonoClass* klass, gpointer value, MonoError* error) +Il2CppMonoObject* il2cpp_mono_value_box_checked(Il2CppMonoDomain* domain, MonoClass* klass, gpointer value, MonoError* error) { error_init(error); return (Il2CppMonoObject*)il2cpp::vm::Object::Box((Il2CppClass*)klass, value); } -void il2cpp_mono_field_static_get_value_checked(Il2CppMonoVTable* vt, Il2CppMonoClassField* field, void* value, MonoError* error) +void il2cpp_mono_field_static_get_value_checked(Il2CppMonoVTable* vt, MonoClassField* field, void* value, MonoError* error) { error_init(error); il2cpp::vm::Field::StaticGetValue((FieldInfo*)field, value); } -void il2cpp_mono_field_static_get_value_for_thread(Il2CppMonoInternalThread* thread, Il2CppMonoVTable* vt, Il2CppMonoClassField* field, void* value, MonoError* error) +void il2cpp_mono_field_static_get_value_for_thread(MonoInternalThread* thread, Il2CppMonoVTable* vt, MonoClassField* field, void* value, MonoError* error) { error_init(error); il2cpp::vm::Field::StaticGetValueForThread((FieldInfo*)field, value, (Il2CppInternalThread*)thread); } -Il2CppMonoObject* il2cpp_mono_field_get_value_object_checked(Il2CppMonoDomain* domain, Il2CppMonoClassField* field, Il2CppMonoObject* obj, MonoError* error) +Il2CppMonoObject* il2cpp_mono_field_get_value_object_checked(Il2CppMonoDomain* domain, MonoClassField* field, Il2CppMonoObject* obj, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -Il2CppMonoObject* il2cpp_mono_object_new_checked(Il2CppMonoDomain* domain, Il2CppMonoClass* klass, MonoError* error) +Il2CppMonoObject* il2cpp_mono_object_new_checked(Il2CppMonoDomain* domain, MonoClass* klass, MonoError* error) { error_init(error); return (Il2CppMonoObject*)il2cpp::vm::Object::New((Il2CppClass*)klass); } -Il2CppMonoString* il2cpp_mono_ldstr_checked(Il2CppMonoDomain* domain, Il2CppMonoImage* image, guint32 idx, MonoError* error) +MonoString* il2cpp_mono_ldstr_checked(Il2CppMonoDomain* domain, MonoImage* image, guint32 idx, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -Il2CppMonoObject* il2cpp_mono_runtime_try_invoke(Il2CppMonoMethod* method, void* obj, void** params, Il2CppMonoObject** exc, MonoError* error) +Il2CppMonoObject* il2cpp_mono_runtime_try_invoke(MonoMethod* method, void* obj, void** params, Il2CppMonoObject** exc, MonoError* error) { error_init(error); @@ -911,7 +906,7 @@ Il2CppMonoObject* il2cpp_mono_runtime_try_invoke(Il2CppMonoMethod* method, void* return (Il2CppMonoObject*)il2cpp::vm::Runtime::Invoke((MethodInfo*)method, obj, params, (Il2CppException**)exc); } -Il2CppMonoObject* il2cpp_mono_runtime_invoke_checked(Il2CppMonoMethod* method, void* obj, void** params, MonoError* error) +Il2CppMonoObject* il2cpp_mono_runtime_invoke_checked(MonoMethod* method, void* obj, void** params, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -970,9 +965,9 @@ void il2cpp_mono_threadpool_resume() #endif // NET_4_0 } -Il2CppMonoImage* il2cpp_mono_assembly_get_image(Il2CppMonoAssembly* assembly) +MonoImage* il2cpp_mono_assembly_get_image(Il2CppMonoAssembly* assembly) { - return (Il2CppMonoImage*)il2cpp::vm::Assembly::GetImage((Il2CppAssembly*)assembly); + return (MonoImage*)il2cpp::vm::Assembly::GetImage((Il2CppAssembly*)assembly); } gboolean il2cpp_mono_runtime_try_shutdown() @@ -981,7 +976,7 @@ gboolean il2cpp_mono_runtime_try_shutdown() return TRUE; } -gboolean il2cpp_mono_verifier_is_method_valid_generic_instantiation(Il2CppMonoMethod* method) +gboolean il2cpp_mono_verifier_is_method_valid_generic_instantiation(MonoMethod* method) { if (!method) return FALSE; @@ -992,7 +987,7 @@ gboolean il2cpp_mono_verifier_is_method_valid_generic_instantiation(Il2CppMonoMe return FALSE; } -Il2CppMonoType* il2cpp_mono_reflection_get_type_checked(Il2CppMonoImage* rootimage, Il2CppMonoImage* image, Il2CppMonoTypeNameParse* info, gboolean ignorecase, gboolean* type_resolve, MonoError* error) +MonoType* il2cpp_mono_reflection_get_type_checked(MonoImage* rootimage, MonoImage* image, Il2CppMonoTypeNameParse* info, gboolean ignorecase, gboolean* type_resolve, MonoError* error) { error_init(error); @@ -1000,28 +995,28 @@ Il2CppMonoType* il2cpp_mono_reflection_get_type_checked(Il2CppMonoImage* rootima if (!klass) return NULL; - return (Il2CppMonoType*)il2cpp::vm::Class::GetType(klass); + return (MonoType*)il2cpp::vm::Class::GetType(klass); } -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_method_checked(Il2CppMonoMethod* method, MonoError* error) +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_method_checked(MonoMethod* method, MonoError* error) { error_init(error); return NULL; } -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_class_checked(Il2CppMonoClass* klass, MonoError* error) +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_class_checked(MonoClass* klass, MonoError* error) { error_init(error); return NULL; } -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_property_checked(Il2CppMonoClass* klass, Il2CppMonoProperty* property, MonoError* error) +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_property_checked(MonoClass* klass, MonoProperty* property, MonoError* error) { error_init(error); return NULL; } -Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_field_checked(Il2CppMonoClass* klass, Il2CppMonoClassField* field, MonoError* error) +Il2CppMonoCustomAttrInfo* il2cpp_mono_custom_attrs_from_field_checked(MonoClass* klass, MonoClassField* field, MonoError* error) { error_init(error); return NULL; @@ -1032,10 +1027,10 @@ Il2CppMonoReflectionAssemblyHandle il2cpp_mono_assembly_get_object_handle(Il2Cpp return (Il2CppMonoReflectionAssemblyHandle)il2cpp::vm::Reflection::GetAssemblyObject((const Il2CppAssembly *)assembly); } -Il2CppMonoReflectionType* il2cpp_mono_type_get_object_checked(Il2CppMonoDomain* domain, Il2CppMonoType* type, MonoError* error) +MonoReflectionType* il2cpp_mono_type_get_object_checked(Il2CppMonoDomain* domain, MonoType* type, MonoError* error) { error_init(error); - return (Il2CppMonoReflectionType*)il2cpp::vm::Reflection::GetTypeObject((const Il2CppType*)type); + return (MonoReflectionType*)il2cpp::vm::Reflection::GetTypeObject((const Il2CppType*)type); } void il2cpp_mono_network_init() @@ -1053,7 +1048,7 @@ char* il2cpp_mono_get_runtime_build_info() return g_strdup_printf ("%s (%s)", "0.0", "IL2CPP"); } -Il2CppMonoMethod* il2cpp_mono_marshal_method_from_wrapper(Il2CppMonoMethod* wrapper) +MonoMethod* il2cpp_mono_marshal_method_from_wrapper(MonoMethod* wrapper) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -1065,7 +1060,7 @@ MonoDebugOptions* il2cpp_mini_get_debug_options() return NULL; } -gpointer il2cpp_mono_jit_find_compiled_method_with_jit_info(Il2CppMonoDomain* domain, Il2CppMonoMethod* method, MonoJitInfo** ji) +gpointer il2cpp_mono_jit_find_compiled_method_with_jit_info(Il2CppMonoDomain* domain, MonoMethod* method, MonoJitInfo** ji) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -1082,7 +1077,7 @@ void il2cpp_mono_set_lmf(MonoLMF* lmf) IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -gpointer il2cpp_mono_aot_get_method_checked(Il2CppMonoDomain* domain, Il2CppMonoMethod* method, MonoError* error) +gpointer il2cpp_mono_aot_get_method_checked(Il2CppMonoDomain* domain, MonoMethod* method, MonoError* error) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -1178,7 +1173,7 @@ gboolean il2cpp_mono_find_jit_info_ext(Il2CppMonoDomain* domain, MonoJitTlsData* return 0; } -Il2CppMonoMethod* il2cpp_mono_method_get_declaring_generic_method(Il2CppMonoMethod* method) +MonoMethod* il2cpp_mono_method_get_declaring_generic_method(MonoMethod* method) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -1190,13 +1185,13 @@ gboolean il2cpp_mono_error_ok (MonoError *error) return 0; } -Il2CppMonoMethod* il2cpp_jinfo_get_method (MonoJitInfo *ji) +MonoMethod* il2cpp_jinfo_get_method (MonoJitInfo *ji) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; } -gboolean il2cpp_mono_find_prev_seq_point_for_native_offset (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point) +gboolean il2cpp_mono_find_prev_seq_point_for_native_offset (Il2CppMonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -1217,24 +1212,24 @@ void* il2cpp_mono_w32socket_accept_internal (void* s, struct sockaddr *addr, voi return 0; } -gboolean il2cpp_mono_find_next_seq_point_for_native_offset (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point) +gboolean il2cpp_mono_find_next_seq_point_for_native_offset (Il2CppMonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -gboolean il2cpp_mono_class_has_parent (Il2CppMonoClass *klass, Il2CppMonoClass *parent) +gboolean il2cpp_mono_class_has_parent (MonoClass *klass, MonoClass *parent) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; } -Il2CppMonoGenericParam* il2cpp_mono_generic_container_get_param (Il2CppMonoGenericContainer *gc, int i) +MonoGenericParam* il2cpp_mono_generic_container_get_param (MonoGenericContainer *gc, int i) { - return (Il2CppMonoGenericParam*)il2cpp::vm::GenericContainer::GetGenericParameter((Il2CppGenericContainer*)gc, i); + return (MonoGenericParam*)il2cpp::vm::GenericContainer::GetGenericParameter((Il2CppGenericContainer*)gc, i); } -gboolean il2cpp_mono_find_seq_point (Il2CppMonoDomain *domain, Il2CppMonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point) +gboolean il2cpp_mono_find_seq_point (Il2CppMonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return 0; @@ -1256,7 +1251,7 @@ void il2cpp_mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPo IL2CPP_ASSERT(0 && "This method is not yet implemented"); } -MonoSeqPointInfo* il2cpp_mono_get_seq_points (Il2CppMonoDomain *domain, Il2CppMonoMethod *method) +MonoSeqPointInfo* il2cpp_mono_get_seq_points (Il2CppMonoDomain *domain, MonoMethod *method) { IL2CPP_ASSERT(0 && "This method is not yet implemented"); return NULL; @@ -1305,11 +1300,6 @@ void* il2cpp_mono_gc_invoke_with_gc_lock (Il2CppMonoGCLockedCallbackFunc func, v // These functions expose the IL2CPP VM C++ API to C -void il2cpp_internal_thread_set_state_background(Il2CppMonoThread* thread) -{ - il2cpp::vm::Thread::SetState((Il2CppInternalThread*)thread, il2cpp::vm::kThreadStateBackground); -} - void* il2cpp_domain_get_agent_info(Il2CppMonoAppDomain* domain) { return ((Il2CppDomain*)domain)->agent_info; @@ -1355,21 +1345,6 @@ void il2cpp_start_debugger_thread() il2cpp::utils::Debugger::StartDebuggerThread(); } -uintptr_t il2cpp_internal_thread_get_thread_id(Il2CppMonoInternalThread* thread) -{ - return il2cpp::vm::Thread::GetId((Il2CppInternalThread*)thread); -} - -uint32_t il2cpp_internal_thread_get_state(Il2CppMonoInternalThread* thread) -{ - return il2cpp::vm::Thread::GetState((Il2CppInternalThread*)thread); -} - -bool il2cpp_internal_thread_get_threadpool_thread(Il2CppMonoInternalThread* thread) -{ - return ((Il2CppInternalThread*)thread)->threadpool_thread; -} - void* il2cpp_gc_alloc_fixed(size_t size) { return il2cpp::gc::GarbageCollector::AllocateFixed(size, NULL); @@ -1391,17 +1366,12 @@ const char* il2cpp_domain_get_name(Il2CppMonoDomain* domain) return ((Il2CppDomain*)domain)->friendly_name; } -int il2cpp_mono_type_get_attrs(Il2CppMonoType* type) -{ - return ((Il2CppType*)type)->attrs; -} - Il2CppSequencePointC* il2cpp_get_sequence_points(void* *iter) { return (Il2CppSequencePointC*)il2cpp::utils::Debugger::GetSequencePoints(iter); } -Il2CppSequencePointC* il2cpp_get_method_sequence_points(Il2CppMonoMethod* method, void* *iter) +Il2CppSequencePointC* il2cpp_get_method_sequence_points(MonoMethod* method, void* *iter) { if (!method) return (Il2CppSequencePointC*)il2cpp::utils::Debugger::GetSequencePoints(iter); @@ -1409,7 +1379,7 @@ Il2CppSequencePointC* il2cpp_get_method_sequence_points(Il2CppMonoMethod* method return (Il2CppSequencePointC*)il2cpp::utils::Debugger::GetSequencePoints((const MethodInfo*)method, iter); } -gboolean il2cpp_mono_methods_match(Il2CppMonoMethod* left, Il2CppMonoMethod* right) +gboolean il2cpp_mono_methods_match(MonoMethod* left, MonoMethod* right) { MethodInfo* leftMethod = (MethodInfo*)left; MethodInfo* rightMethod = (MethodInfo*)right; @@ -1441,62 +1411,26 @@ gboolean il2cpp_mono_methods_match(Il2CppMonoMethod* left, Il2CppMonoMethod* rig return FALSE; } -Il2CppMonoGenericInst* il2cpp_generic_class_get_inst(Il2CppMonoGenericClass *monoGenClass) -{ - Il2CppGenericClass *klass = (Il2CppGenericClass*) monoGenClass; - return (Il2CppMonoGenericInst*)klass->context.class_inst; -} - -guint il2cpp_generic_inst_type_argc(Il2CppMonoGenericInst *monoInst) -{ - Il2CppGenericInst *inst = (Il2CppGenericInst*)monoInst; - return inst->type_argc; -} - -Il2CppMonoType* il2cpp_generic_inst_type_arg(Il2CppMonoGenericInst *monoInst, int i) -{ - Il2CppGenericInst *inst = (Il2CppGenericInst*)monoInst; - return (Il2CppMonoType*)inst->type_argv[i]; -} - -Il2CppMonoType* il2cpp_class_this_arg(Il2CppMonoClass *monoClass) -{ - Il2CppClass *klass = (Il2CppClass*)monoClass; - return (Il2CppMonoType*)klass->this_arg; -} - -Il2CppMonoClass* il2cpp_class_get_nested_types_accepts_generic(Il2CppMonoClass *monoClass, void* *iter) +MonoClass* il2cpp_class_get_nested_types_accepts_generic(MonoClass *monoClass, void* *iter) { Il2CppClass *klass = (Il2CppClass*)monoClass; if (klass->generic_class) return NULL; - return (Il2CppMonoClass*)il2cpp::vm::Class::GetNestedTypes(klass, iter); + return (MonoClass*)il2cpp::vm::Class::GetNestedTypes(klass, iter); } -Il2CppMonoClass* il2cpp_defaults_object_class() +MonoClass* il2cpp_defaults_object_class() { - return (Il2CppMonoClass*)il2cpp_defaults.object_class; + return (MonoClass*)il2cpp_defaults.object_class; } -guint8 il2cpp_array_rank(Il2CppMonoArray *monoArr) +guint8 il2cpp_array_rank(MonoArray *monoArr) { Il2CppArray *arr = (Il2CppArray*)monoArr; return arr->klass->rank; } -mono_array_size_t il2cpp_array_bound_length(Il2CppMonoArray *monoArr, int i) -{ - Il2CppArray *arr = (Il2CppArray*)monoArr; - return arr->bounds[i].length; -} - -mono_array_lower_bound_t il2cpp_array_bound_lower_bound(Il2CppMonoArray *monoArr, int i) -{ - Il2CppArray *arr = (Il2CppArray*)monoArr; - return arr->bounds[i].lower_bound; -} - const char* il2cpp_assembly_name_name(Il2CppMonoAssembly *monoAssembly) { Il2CppAssembly *assembly = (Il2CppAssembly*)monoAssembly; @@ -1551,56 +1485,45 @@ uint32_t il2cpp_assembly_name_flags(Il2CppMonoAssembly *monoAssembly) return assembly->aname.flags; } -const char* il2cpp_image_name(Il2CppMonoImage *monoImage) +const char* il2cpp_image_name(MonoImage *monoImage) { Il2CppImage *image = (Il2CppImage*)monoImage; return image->name; } -Il2CppMonoAssembly* il2cpp_image_assembly(Il2CppMonoImage *monoImage) -{ - Il2CppImage *image = (Il2CppImage*)monoImage; - return (Il2CppMonoAssembly*)image->assembly; -} - -guint8* il2cpp_field_get_address(Il2CppMonoObject *obj, Il2CppMonoClassField *monoField) +guint8* il2cpp_field_get_address(Il2CppMonoObject *obj, MonoClassField *monoField) { FieldInfo *field = (FieldInfo*)monoField; return (guint8*)obj + field->offset; } -Il2CppMonoType* il2cpp_mono_object_get_type(Il2CppMonoObject* object) -{ - return (Il2CppMonoType*)(((Il2CppObject*)object)->klass->byval_arg); -} - -Il2CppMonoClass* il2cpp_defaults_exception_class() +MonoType* il2cpp_mono_object_get_type(Il2CppMonoObject* object) { - return (Il2CppMonoClass*)il2cpp_defaults.exception_class; + return (MonoType*)&(((Il2CppObject*)object)->klass->byval_arg); } -Il2CppMonoImage* il2cpp_defaults_corlib_image() +MonoClass* il2cpp_defaults_exception_class() { - return (Il2CppMonoImage*)il2cpp_defaults.corlib; + return (MonoClass*)il2cpp_defaults.exception_class; } -uint32_t il2cpp_method_get_flags_no_iflags(const Il2CppMonoMethod * method) +MonoImage* il2cpp_defaults_corlib_image() { - return ((MethodInfo*)method)->flags; + return (MonoImage*)il2cpp_defaults.corlib; } -bool il2cpp_method_is_string_ctor(const Il2CppMonoMethod * method) +bool il2cpp_method_is_string_ctor(const MonoMethod * method) { MethodInfo* methodInfo = (MethodInfo*)method; return methodInfo->klass == il2cpp_defaults.string_class && !strcmp (methodInfo->name, ".ctor"); } -Il2CppMonoClass* il2cpp_defaults_void_class() +MonoClass* il2cpp_defaults_void_class() { - return (Il2CppMonoClass*)il2cpp_defaults.void_class; + return (MonoClass*)il2cpp_defaults.void_class; } -void il2cpp_set_var(guint8* newValue, void *value, Il2CppMonoType *localVariableTypeMono) +void il2cpp_set_var(guint8* newValue, void *value, MonoType *localVariableTypeMono) { il2cpp::metadata::SizeAndAlignment sa = il2cpp::metadata::FieldLayout::GetTypeSizeAndAlignment((const Il2CppType*)localVariableTypeMono); if (((Il2CppType*)localVariableTypeMono)->byref) @@ -1609,35 +1532,20 @@ void il2cpp_set_var(guint8* newValue, void *value, Il2CppMonoType *localVariable memcpy(value, newValue, sa.size); } -Il2CppMonoMethod* il2cpp_get_interface_method(Il2CppMonoClass* klass, Il2CppMonoClass* itf, int slot) +MonoMethod* il2cpp_get_interface_method(MonoClass* klass, MonoClass* itf, int slot) { const VirtualInvokeData* data = il2cpp::vm::Class::GetInterfaceInvokeDataFromVTable((Il2CppClass*)klass, (Il2CppClass*)itf, slot); if (!data) return NULL; - return (Il2CppMonoMethod*)data->method; + return (MonoMethod*)data->method; } -gboolean il2cpp_field_is_deleted(Il2CppMonoClassField *field) +gboolean il2cpp_field_is_deleted(MonoClassField *field) { return il2cpp::vm::Field::IsDeleted((FieldInfo*)field); } -int il2cpp_generic_container_get_type_argc(Il2CppMonoGenericClass* container) -{ - return ((Il2CppGenericContainer*)container)->type_argc; -} - -Il2CppMonoGenericClass* il2cpp_type_get_generic_class(Il2CppMonoType *type) -{ - return (Il2CppMonoGenericClass*)((Il2CppType*)type)->data.generic_class; -} - -gboolean il2cpp_class_get_enumtype(Il2CppMonoClass *klass) -{ - return ((Il2CppClass*)klass)->enumtype; -} - struct TypeIterState { il2cpp::vm::AssemblyVector* assemblies; @@ -1647,7 +1555,7 @@ struct TypeIterState il2cpp::vm::TypeVector::iterator type; }; -Il2CppMonoClass* il2cpp_iterate_loaded_classes(void* *iter) +MonoClass* il2cpp_iterate_loaded_classes(void* *iter) { if (!iter) return NULL; @@ -1661,7 +1569,7 @@ Il2CppMonoClass* il2cpp_iterate_loaded_classes(void* *iter) il2cpp::vm::Image::GetTypes(state->image, true, &state->types); state->type = state->types.begin(); *iter = state; - return (Il2CppMonoClass*)*state->type; + return (MonoClass*)*state->type; } TypeIterState *state = (TypeIterState*)*iter; @@ -1682,44 +1590,44 @@ Il2CppMonoClass* il2cpp_iterate_loaded_classes(void* *iter) state->type = state->types.begin(); } - return (Il2CppMonoClass*)*state->type; + return (MonoClass*)*state->type; } -const char** il2cpp_get_source_files_for_type(Il2CppMonoClass *klass, int *count) +const char** il2cpp_get_source_files_for_type(MonoClass *klass, int *count) { return il2cpp::utils::Debugger::GetTypeSourceFiles((Il2CppClass*)klass, *count); } -Il2CppMonoMethod* il2cpp_method_get_generic_definition(Il2CppMonoMethodInflated *imethod) +MonoMethod* il2cpp_method_get_generic_definition(Il2CppMonoMethodInflated *imethod) { MethodInfo *method = (MethodInfo*)imethod; if (!method->is_inflated || method->is_generic) return NULL; - return (Il2CppMonoMethod*)((MethodInfo*)imethod)->genericMethod->methodDefinition; + return (MonoMethod*)((MethodInfo*)imethod)->genericMethod->methodDefinition; } -Il2CppMonoGenericInst* il2cpp_method_get_generic_class_inst(Il2CppMonoMethodInflated *imethod) +MonoGenericInst* il2cpp_method_get_generic_class_inst(Il2CppMonoMethodInflated *imethod) { MethodInfo *method = (MethodInfo*)imethod; if (!method->is_inflated || method->is_generic) return NULL; - return (Il2CppMonoGenericInst*)method->genericMethod->context.class_inst; + return (MonoGenericInst*)method->genericMethod->context.class_inst; } -Il2CppMonoClass* il2cpp_generic_class_get_container_class(Il2CppMonoGenericClass *gclass) +MonoClass* il2cpp_generic_class_get_container_class(MonoGenericClass *gclass) { - return (Il2CppMonoClass*)il2cpp::vm::GenericClass::GetTypeDefinition((Il2CppGenericClass*)gclass); + return (MonoClass*)il2cpp::vm::GenericClass::GetTypeDefinition((Il2CppGenericClass*)gclass); } -Il2CppMonoClass* il2cpp_mono_get_string_class (void) +MonoClass* il2cpp_mono_get_string_class (void) { - return (Il2CppMonoClass*)il2cpp_defaults.string_class; + return (MonoClass*)il2cpp_defaults.string_class; } }