}
static gint32
-ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilder *mb, MonoObject *obj)
+ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilder *mb, MonoObject *obj, gboolean create_open_instance)
{
MONO_ARCH_SAVE_REGS;
MONO_CHECK_ARG_NULL (obj);
- return mono_image_create_token (mb->dynamic_image, obj, TRUE, TRUE);
+ return mono_image_create_token (mb->dynamic_image, obj, create_open_instance, TRUE);
}
static gint32
return type_array_from_modifiers (field->field->parent->image, type, optional);
}
+static int
+vell_icall_get_method_attributes (MonoMethod *method)
+{
+ return method->flags;
+}
+
static void
ves_icall_get_method_info (MonoMethod *method, MonoMethodInfo *info)
{
+ MonoError error;
MonoDomain *domain = mono_domain_get ();
MonoMethodSignature* sig;
MONO_ARCH_SAVE_REGS;
- sig = mono_method_signature (method);
- if (!sig) {
- g_assert (mono_loader_get_last_error ());
- mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
- }
+ sig = mono_method_signature_checked (method, &error);
+ if (!mono_error_ok (&error))
+ mono_error_raise_exception (&error);
+
MONO_STRUCT_SETREF (info, parent, mono_type_get_object (domain, &method->klass->byval_arg));
MONO_STRUCT_SETREF (info, ret, mono_type_get_object (domain, sig->ret));
static void
ves_icall_MonoField_SetValueInternal (MonoReflectionField *field, MonoObject *obj, MonoObject *value)
{
+ MonoError error;
MonoClassField *cf = field->field;
+ MonoType *type;
gchar *v;
MONO_ARCH_SAVE_REGS;
if (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
mono_security_core_clr_ensure_reflection_access_field (cf);
+ type = mono_field_get_type_checked (cf, &error);
+ if (!mono_error_ok (&error))
+ mono_error_raise_exception (&error);
+
v = (gchar *) value;
- if (!cf->type->byref) {
- switch (cf->type->type) {
+ if (!type->byref) {
+ switch (type->type) {
case MONO_TYPE_U1:
case MONO_TYPE_I1:
case MONO_TYPE_BOOLEAN:
/* Do nothing */
break;
case MONO_TYPE_GENERICINST: {
- MonoGenericClass *gclass = cf->type->data.generic_class;
+ MonoGenericClass *gclass = type->data.generic_class;
g_assert (!gclass->context.class_inst->is_open);
- if (mono_class_is_nullable (mono_class_from_mono_type (cf->type))) {
- MonoClass *nklass = mono_class_from_mono_type (cf->type);
+ if (mono_class_is_nullable (mono_class_from_mono_type (type))) {
+ MonoClass *nklass = mono_class_from_mono_type (type);
MonoObject *nullable;
/*
}
default:
g_error ("type 0x%x not handled in "
- "ves_icall_FieldInfo_SetValueInternal", cf->type->type);
+ "ves_icall_FieldInfo_SetValueInternal", type->type);
return;
}
}
- if (cf->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+ if (type->attrs & FIELD_ATTRIBUTE_STATIC) {
MonoVTable *vtable = mono_class_vtable_full (mono_object_domain (field), cf->parent, TRUE);
if (!vtable->initialized)
mono_runtime_class_init (vtable);
mono_raise_exception (mono_get_exception_argument ("type", "Type must be an array type"));
class = mono_class_from_mono_type (type->type);
- mono_class_init_or_throw (class);
return class->rank;
}
return NULL;
klass = mono_class_from_mono_type (type->type);
- mono_class_init_or_throw (klass);
if (klass->generic_container) {
return type; /* check this one */
int (*compare_func) (const char *s1, const char *s2) = NULL;
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
- mono_class_init_or_throw (klass);
if (!name)
mono_raise_exception (mono_get_exception_argument_null ("name"));
mono_raise_exception (mono_class_get_exception_for_failure (klass));
iter = NULL;
- while ((field = mono_class_get_fields (klass, &iter))) {
+ while ((field = mono_class_get_fields_lazy (klass, &iter))) {
+ guint32 flags = mono_field_get_flags (field);
match = 0;
- if (field->type == NULL)
- continue;
- if (mono_field_is_deleted (field))
+ if (mono_field_is_deleted_with_flags (field, flags))
continue;
- if ((field->type->attrs & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) == FIELD_ATTRIBUTE_PUBLIC) {
+ if ((flags & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) == FIELD_ATTRIBUTE_PUBLIC) {
if (bflags & BFLAGS_Public)
match++;
- } else if ((klass == startklass) || (field->type->attrs & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) != FIELD_ATTRIBUTE_PRIVATE) {
+ } else if ((klass == startklass) || (flags & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) != FIELD_ATTRIBUTE_PRIVATE) {
if (bflags & BFLAGS_NonPublic) {
match++;
}
if (!match)
continue;
match = 0;
- if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+ if (flags & FIELD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
match++;
aname->revision = name->revision;
aname->hashalg = name->hash_alg;
aname->versioncompat = 1; /* SameMachine (default) */
+ aname->processor_architecture = name->arch;
if (by_default_version)
MONO_OBJECT_SETREF (aname, version, create_version (domain, name->major, name->minor, name->build, name->revision));
MONO_ARCH_SAVE_REGS;
klass = mono_class_from_mono_type (type->type);
- mono_class_init_or_throw (klass);
check_for_invalid_type (klass);
if (rank == 0) //single dimentional array