* Merge System/MonoType.cs into ReferenceSources/RuntimeType.cs, use the latter in the runtime code.
* [sdb] Fix a test which referenced System.MonoType.
TypeMirror t = o.Type;
- Assert.AreEqual ("MonoType", t.GetTypeObject ().Type.Name);
+ Assert.AreEqual ("RuntimeType", t.GetTypeObject ().Type.Name);
}
[Test]
namespace System
{
+ // Contains information about the type which is expensive to compute
+ [StructLayout (LayoutKind.Sequential)]
+ internal class MonoTypeInfo {
+ // this is the displayed form: special characters
+ // ,+*&*[]\ in the identifier portions of the names
+ // have been escaped with a leading backslash (\)
+ public string full_name;
+ public MonoCMethod default_ctor;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
partial class RuntimeType
{
+ [NonSerialized]
+ MonoTypeInfo type_info;
+
internal Object GenericCache;
- internal virtual MonoCMethod GetDefaultConstructor ()
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private static extern void type_from_obj (RuntimeType type, Object obj);
+
+ internal RuntimeType (Object obj)
+ {
+ // this should not be used - lupus
+ type_from_obj (this, obj);
+
+ throw new NotImplementedException ();
+ }
+
+ internal MonoCMethod GetDefaultConstructor ()
{
- // TODO: Requires MonoType
- throw new NotSupportedException ();
+ MonoCMethod ctor = null;
+
+ if (type_info == null)
+ type_info = new MonoTypeInfo ();
+ else
+ ctor = type_info.default_ctor;
+
+ if (ctor == null) {
+ var ctors = GetConstructors (BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
+
+ for (int i = 0; i < ctors.Length; ++i) {
+ if (ctors [i].GetParametersCount () == 0) {
+ type_info.default_ctor = ctor = (MonoCMethod) ctors [i];
+ break;
+ }
+ }
+ }
+
+ return ctor;
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern MethodInfo GetCorrespondingInflatedMethod (MethodInfo generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern ConstructorInfo GetCorrespondingInflatedConstructor (ConstructorInfo generic);
+
+ internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+ {
+ if (fromNoninstanciated == null)
+ throw new ArgumentNullException ("fromNoninstanciated");
+ return GetCorrespondingInflatedMethod (fromNoninstanciated);
+ }
+
+ internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+ if (fromNoninstanciated == null)
+ throw new ArgumentNullException ("fromNoninstanciated");
+ return GetCorrespondingInflatedConstructor (fromNoninstanciated);
+ }
+
+ internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+ /* create sensible flags from given FieldInfo */
+ BindingFlags flags = fromNoninstanciated.IsStatic ? BindingFlags.Static : BindingFlags.Instance;
+ flags |= fromNoninstanciated.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic;
+ return GetField (fromNoninstanciated.Name, flags);
}
string GetDefaultMemberName ()
get;
}
- public override string FullName {
- get {
- throw new NotImplementedException ();
- }
- }
-
public extern override string Name {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
get;
get { return get_core_clr_security_level () == 1; }
}
#endif
+
+ public override int GetHashCode()
+ {
+ Type t = UnderlyingSystemType;
+ if (t != null && t != this)
+ return t.GetHashCode ();
+ return (int)_impl.Value;
+ }
+
+ public override string FullName {
+ get {
+ string fullName;
+ // This doesn't need locking
+ if (type_info == null)
+ type_info = new MonoTypeInfo ();
+ if ((fullName = type_info.full_name) == null)
+ fullName = type_info.full_name = getFullName (true, false);
+
+ return fullName;
+ }
+ }
+
+ internal override bool IsUserType {
+ get {
+ return false;
+ }
+ }
}
}
foreach (Type type in methodInstantiation) {
if (type == null)
throw new ArgumentNullException ();
- if (!(type is MonoType))
+ if (!(type is RuntimeType))
hasUserType = true;
}
public static bool IsMethodOverloaded(IMethodMessage msg)
{
const BindingFlags bfinst = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance;
- MonoType type = (MonoType) msg.MethodBase.DeclaringType;
+ RuntimeType type = (RuntimeType) msg.MethodBase.DeclaringType;
return type.GetMethodsByName (msg.MethodName, bfinst, false, type).Length > 1;
}
* of icalls, do not require an increment.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 147;
+ private const int mono_corlib_version = 148;
#pragma warning restore 169
[ComVisible (true)]
[ThreadStatic]
static Dictionary<Type, AttributeUsageAttribute> usage_cache;
- /* Treat as user types all corlib types extending System.Type that are not MonoType and TypeBuilder */
+ /* Treat as user types all corlib types extending System.Type that are not RuntimeType and TypeBuilder */
static bool IsUserCattrProvider (object obj)
{
Type type = obj as Type;
#if !FULL_AOT_RUNTIME
- if ((type is MonoType) || (type is TypeBuilder))
+ if ((type is RuntimeType) || (type is TypeBuilder))
#else
- if (type is MonoType)
+ if (type is RuntimeType)
#endif
return false;
if ((obj is Type))
namespace System
{
- // Contains information about the type which is expensive to compute
- [StructLayout (LayoutKind.Sequential)]
- internal class MonoTypeInfo {
- // this is the displayed form: special characters
- // ,+*&*[]\ in the identifier portions of the names
- // have been escaped with a leading backslash (\)
- public string full_name;
- public MonoCMethod default_ctor;
- }
-
+ // Dummy type kept because lots of external code uses
+ // this to check whenever it is running on mono.
[Serializable]
[StructLayout (LayoutKind.Sequential)]
class MonoType : RuntimeType, ISerializable
{
- [NonSerialized]
- MonoTypeInfo type_info;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void type_from_obj (MonoType type, Object obj);
-
- internal MonoType (Object obj)
- {
- // this should not be used - lupus
- type_from_obj (this, obj);
-
- throw new NotImplementedException ();
- }
-
- internal override MonoCMethod GetDefaultConstructor ()
- {
- MonoCMethod ctor = null;
-
- if (type_info == null)
- type_info = new MonoTypeInfo ();
- else
- ctor = type_info.default_ctor;
-
- if (ctor == null) {
- var ctors = GetConstructors (BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
-
- for (int i = 0; i < ctors.Length; ++i) {
- if (ctors [i].GetParametersCount () == 0) {
- type_info.default_ctor = ctor = (MonoCMethod) ctors [i];
- break;
- }
- }
- }
-
- return ctor;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern MethodInfo GetCorrespondingInflatedMethod (MethodInfo generic);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern ConstructorInfo GetCorrespondingInflatedConstructor (ConstructorInfo generic);
-
- internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
- {
- if (fromNoninstanciated == null)
- throw new ArgumentNullException ("fromNoninstanciated");
- return GetCorrespondingInflatedMethod (fromNoninstanciated);
- }
-
- internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
- {
- if (fromNoninstanciated == null)
- throw new ArgumentNullException ("fromNoninstanciated");
- return GetCorrespondingInflatedConstructor (fromNoninstanciated);
- }
-
- internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
- {
- /* create sensible flags from given FieldInfo */
- BindingFlags flags = fromNoninstanciated.IsStatic ? BindingFlags.Static : BindingFlags.Instance;
- flags |= fromNoninstanciated.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic;
- return GetField (fromNoninstanciated.Name, flags);
- }
-
- public override int GetHashCode()
- {
- Type t = UnderlyingSystemType;
- if (t != null && t != this)
- return t.GetHashCode ();
- return (int)_impl.Value;
- }
-
- public override string FullName {
- get {
- string fullName;
- // This doesn't need locking
- if (type_info == null)
- type_info = new MonoTypeInfo ();
- if ((fullName = type_info.full_name) == null)
- fullName = type_info.full_name = getFullName (true, false);
-
- return fullName;
- }
- }
-
- internal override bool IsUserType {
- get {
- return false;
- }
- }
}
}
if (info == null)
throw new ArgumentNullException ("info");
- MonoType mt = ((MonoType) info.GetValue ("TypeObj", typeof (MonoType)));
+ RuntimeType mt = ((RuntimeType) info.GetValue ("TypeObj", typeof (RuntimeType)));
value = mt.TypeHandle.Value;
if (value == IntPtr.Zero)
throw new SerializationException (Locale.GetText ("Insufficient state."));
if (value == IntPtr.Zero)
throw new SerializationException ("Object fields may not be properly initialized");
- info.AddValue ("TypeObj", Type.GetTypeHandle (this), typeof (MonoType));
+ info.AddValue ("TypeObj", Type.GetTypeHandle (this), typeof (RuntimeType));
}
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
}
// check a class in mscorlib to determine if we're running on Mono
- if (Type.GetType ("System.MonoType", false) != null)
+ if (Type.GetType ("Mono.Runtime", false) != null)
is_mono = true;
}
return obj == (object)this;
}
+#if !MONO
public override int GetHashCode()
{
return RuntimeHelpers.GetHashCode(this);
}
+#endif
#if !FEATURE_CORECLR
public static bool operator ==(RuntimeType left, RuntimeType right)
* Changes which are already detected at runtime, like the addition
* of icalls, do not require an increment.
*/
-#define MONO_CORLIB_VERSION 147
+#define MONO_CORLIB_VERSION 148
typedef struct
{
MonoClass *fieldhandle_class;
MonoClass *methodhandle_class;
MonoClass *systemtype_class;
- MonoClass *monotype_class;
MonoClass *runtimetype_class;
MonoClass *exception_class;
MonoClass *threadabortexception_class;
mono_defaults.systemtype_class = mono_class_load_from_name (
mono_defaults.corlib, "System", "Type");
- mono_defaults.monotype_class = mono_class_load_from_name (
- mono_defaults.corlib, "System", "MonoType");
-
mono_defaults.runtimetype_class = mono_class_load_from_name (
mono_defaults.corlib, "System", "RuntimeType");
{
MonoObject *type = (MonoObject *)vtable->type;
- if (type->vtable->klass != mono_defaults.monotype_class)
+ if (type->vtable->klass != mono_defaults.runtimetype_class)
MONO_GC_UNREGISTER_ROOT_IF_MOVING (vtable->type);
}
ICALL(MCATTR_2, "GetCustomAttributesInternal", custom_attrs_get_by_type)
ICALL(MCATTR_3, "IsDefinedInternal", custom_attrs_defined_internal)
-ICALL_TYPE(MTYPE, "System.MonoType", MTYPE_1)
-ICALL(MTYPE_1, "GetCorrespondingInflatedConstructor", ves_icall_MonoType_GetCorrespondingInflatedMethod)
-ICALL(MTYPE_2, "GetCorrespondingInflatedMethod", ves_icall_MonoType_GetCorrespondingInflatedMethod)
-ICALL(MTYPE_3, "type_from_obj", ves_icall_MonoType_type_from_obj)
-
#ifndef DISABLE_SOCKETS
ICALL_TYPE(NDNS, "System.Net.Dns", NDNS_1)
ICALL(NDNS_1, "GetHostByAddr_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByAddr_internal)
ICALL_TYPE(RT, "System.RuntimeType", RT_1)
ICALL(RT_1, "CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceInternal)
-ICALL(RT_2, "GetConstructors_internal", ves_icall_Type_GetConstructors_internal)
-ICALL(RT_3, "GetEvents_internal", ves_icall_Type_GetEvents_internal)
-ICALL(RT_5, "GetFields_internal", ves_icall_Type_GetFields_internal)
-ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_MonoType_GetGenericArguments)
-ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes)
-ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints)
-ICALL(RT_9, "GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition)
-ICALL(RT_10, "GetInterfaceMapData", ves_icall_Type_GetInterfaceMapData)
-ICALL(RT_11, "GetInterfaces", ves_icall_Type_GetInterfaces)
-ICALL(RT_12, "GetMethodsByName", ves_icall_Type_GetMethodsByName)
-ICALL(RT_13, "GetNestedTypes_internal", ves_icall_Type_GetNestedTypes)
-ICALL(RT_14, "GetPacking", ves_icall_Type_GetPacking)
-ICALL(RT_15, "GetPropertiesByName", ves_icall_Type_GetPropertiesByName)
+ICALL(RT_2, "GetConstructors_internal", ves_icall_RuntimeType_GetConstructors_internal)
+ICALL(RT_30, "GetCorrespondingInflatedConstructor", ves_icall_RuntimeType_GetCorrespondingInflatedMethod)
+ICALL(RT_31, "GetCorrespondingInflatedMethod", ves_icall_RuntimeType_GetCorrespondingInflatedMethod)
+ICALL(RT_3, "GetEvents_internal", ves_icall_RuntimeType_GetEvents_internal)
+ICALL(RT_5, "GetFields_internal", ves_icall_RuntimeType_GetFields_internal)
+ICALL(RT_6, "GetGenericArgumentsInternal", ves_icall_RuntimeType_GetGenericArguments)
+ICALL(RT_7, "GetGenericParameterAttributes", ves_icall_RuntimeType_GetGenericParameterAttributes)
+ICALL(RT_8, "GetGenericParameterConstraints_impl", ves_icall_RuntimeType_GetGenericParameterConstraints)
+ICALL(RT_9, "GetGenericParameterPosition", ves_icall_RuntimeType_GetGenericParameterPosition)
+ICALL(RT_10, "GetInterfaceMapData", ves_icall_RuntimeType_GetInterfaceMapData)
+ICALL(RT_11, "GetInterfaces", ves_icall_RuntimeType_GetInterfaces)
+ICALL(RT_12, "GetMethodsByName", ves_icall_RuntimeType_GetMethodsByName)
+ICALL(RT_13, "GetNestedTypes_internal", ves_icall_RuntimeType_GetNestedTypes)
+ICALL(RT_14, "GetPacking", ves_icall_RuntimeType_GetPacking)
+ICALL(RT_15, "GetPropertiesByName", ves_icall_RuntimeType_GetPropertiesByName)
ICALL(RT_16, "GetTypeCodeImplInternal", ves_icall_type_GetTypeCodeInternal)
ICALL(RT_28, "IsTypeExportedToWindowsRuntime", ves_icall_System_RuntimeType_IsTypeExportedToWindowsRuntime)
ICALL(RT_29, "IsWindowsRuntimeObjectType", ves_icall_System_RuntimeType_IsWindowsRuntimeObjectType)
-ICALL(RT_17, "MakeGenericType", ves_icall_Type_MakeGenericType)
-ICALL(RT_18, "MakePointerType", ves_icall_Type_MakePointerType)
+ICALL(RT_17, "MakeGenericType", ves_icall_RuntimeType_MakeGenericType)
+ICALL(RT_18, "MakePointerType", ves_icall_RuntimeType_MakePointerType)
ICALL(RT_19, "getFullName", ves_icall_System_MonoType_getFullName)
-ICALL(RT_21, "get_DeclaringMethod", ves_icall_MonoType_get_DeclaringMethod)
-ICALL(RT_22, "get_DeclaringType", ves_icall_MonoType_get_DeclaringType)
-ICALL(RT_23, "get_Name", ves_icall_MonoType_get_Name)
-ICALL(RT_24, "get_Namespace", ves_icall_MonoType_get_Namespace)
-ICALL(RT_25, "get_core_clr_security_level", vell_icall_MonoType_get_core_clr_security_level)
-ICALL(RT_26, "make_array_type", ves_icall_Type_make_array_type)
-ICALL(RT_27, "make_byref_type", ves_icall_Type_make_byref_type)
+ICALL(RT_21, "get_DeclaringMethod", ves_icall_RuntimeType_get_DeclaringMethod)
+ICALL(RT_22, "get_DeclaringType", ves_icall_RuntimeType_get_DeclaringType)
+ICALL(RT_23, "get_Name", ves_icall_RuntimeType_get_Name)
+ICALL(RT_24, "get_Namespace", ves_icall_RuntimeType_get_Namespace)
+ICALL(RT_25, "get_core_clr_security_level", vell_icall_RuntimeType_get_core_clr_security_level)
+ICALL(RT_26, "make_array_type", ves_icall_RuntimeType_make_array_type)
+ICALL(RT_27, "make_byref_type", ves_icall_RuntimeType_make_byref_type)
+ICALL(RT_32, "type_from_obj", ves_icall_RuntimeType_type_from_obj)
ICALL_TYPE(RTH, "System.RuntimeTypeHandle", RTH_1)
ICALL(RTH_1, "GetArrayRank", ves_icall_RuntimeTypeHandle_GetArrayRank)
}
ICALL_EXPORT void
-ves_icall_MonoType_type_from_obj (MonoReflectionType *mtype, MonoObject *obj)
+ves_icall_RuntimeType_type_from_obj (MonoReflectionType *mtype, MonoObject *obj)
{
mtype->type = &obj->vtable->klass->byval_arg;
g_assert (mtype->type->type);
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetInterfaces (MonoReflectionType* type)
+ves_icall_RuntimeType_GetInterfaces (MonoReflectionType* type)
{
MonoError error;
MonoClass *klass = mono_class_from_mono_type (type->type);
if (len == 0) {
g_hash_table_destroy (iface_hash);
if (!data.domain->empty_types) {
- data.domain->empty_types = mono_array_new_cached (data.domain, mono_defaults.monotype_class, 0, &error);
+ data.domain->empty_types = mono_array_new_cached (data.domain, mono_defaults.runtimetype_class, 0, &error);
if (!is_ok (&error))
goto fail;
}
return data.domain->empty_types;
}
- data.iface_array = mono_array_new_cached (data.domain, mono_defaults.monotype_class, len, &error);
+ data.iface_array = mono_array_new_cached (data.domain, mono_defaults.runtimetype_class, len, &error);
if (!is_ok (&error))
goto fail;
g_hash_table_foreach (iface_hash, fill_iface_array, &data);
}
ICALL_EXPORT void
-ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType *iface, MonoArray **targets, MonoArray **methods)
+ves_icall_RuntimeType_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType *iface, MonoArray **targets, MonoArray **methods)
{
gboolean variance_used;
MonoClass *klass = mono_class_from_mono_type (type->type);
}
ICALL_EXPORT void
-ves_icall_Type_GetPacking (MonoReflectionType *type, guint32 *packing, guint32 *size)
+ves_icall_RuntimeType_GetPacking (MonoReflectionType *type, guint32 *packing, guint32 *size)
{
MonoError error;
MonoClass *klass = mono_class_from_mono_type (type->type);
}
ICALL_EXPORT MonoReflectionType*
-ves_icall_MonoType_get_DeclaringType (MonoReflectionType *type)
+ves_icall_RuntimeType_get_DeclaringType (MonoReflectionType *type)
{
MonoError error;
MonoReflectionType *ret;
}
ICALL_EXPORT MonoString*
-ves_icall_MonoType_get_Name (MonoReflectionType *type)
+ves_icall_RuntimeType_get_Name (MonoReflectionType *type)
{
MonoDomain *domain = mono_domain_get ();
MonoClass *klass = mono_class_from_mono_type (type->type);
}
ICALL_EXPORT MonoString*
-ves_icall_MonoType_get_Namespace (MonoReflectionType *type)
+ves_icall_RuntimeType_get_Namespace (MonoReflectionType *type)
{
MonoDomain *domain = mono_domain_get ();
MonoClass *klass = mono_class_from_mono_type (type->type);
}
ICALL_EXPORT MonoArray*
-ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type, MonoBoolean runtimeTypeArray)
+ves_icall_RuntimeType_GetGenericArguments (MonoReflectionType *type, MonoBoolean runtimeTypeArray)
{
MonoError error;
MonoReflectionType *rt;
}
ICALL_EXPORT MonoReflectionType*
-ves_icall_Type_MakeGenericType (MonoReflectionType *type, MonoArray *type_array)
+ves_icall_RuntimeType_MakeGenericType (MonoReflectionType *type, MonoArray *type_array)
{
MonoError error;
MonoReflectionType *ret;
}
ICALL_EXPORT gint32
-ves_icall_Type_GetGenericParameterPosition (MonoReflectionType *type)
+ves_icall_RuntimeType_GetGenericParameterPosition (MonoReflectionType *type)
{
if (!IS_MONOTYPE (type))
return -1;
}
ICALL_EXPORT GenericParameterAttributes
-ves_icall_Type_GetGenericParameterAttributes (MonoReflectionType *type)
+ves_icall_RuntimeType_GetGenericParameterAttributes (MonoReflectionType *type)
{
g_assert (IS_MONOTYPE (type));
g_assert (is_generic_parameter (type->type));
}
ICALL_EXPORT MonoArray *
-ves_icall_Type_GetGenericParameterConstraints (MonoReflectionType *type)
+ves_icall_RuntimeType_GetGenericParameterConstraints (MonoReflectionType *type)
{
MonoError error;
MonoReflectionType *rt;
for (count = 0, ptr = param_info->constraints; ptr && *ptr; ptr++, count++)
;
- res = mono_array_new_checked (domain, mono_defaults.monotype_class, count, &error);
+ res = mono_array_new_checked (domain, mono_defaults.runtimetype_class, count, &error);
if (mono_error_set_pending_exception (&error))
return NULL;
for (i = 0; i < count; i++) {
}
ICALL_EXPORT MonoReflectionMethod*
-ves_icall_MonoType_GetCorrespondingInflatedMethod (MonoReflectionType *type,
+ves_icall_RuntimeType_GetCorrespondingInflatedMethod (MonoReflectionType *type,
MonoReflectionMethod* generic)
{
MonoDomain *domain;
}
ICALL_EXPORT MonoReflectionMethod *
-ves_icall_MonoType_get_DeclaringMethod (MonoReflectionType *ref_type)
+ves_icall_RuntimeType_get_DeclaringMethod (MonoReflectionType *ref_type)
{
MonoMethod *method;
MonoType *type = ref_type->type;
};
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetFields_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
+ves_icall_RuntimeType_GetFields_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
{
MonoError error;
MonoDomain *domain;
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetMethodsByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
+ves_icall_RuntimeType_GetMethodsByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
{
static MonoClass *MethodInfo_array;
MonoError error;
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetConstructors_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
+ves_icall_RuntimeType_GetConstructors_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
{
MonoDomain *domain;
MonoClass *startklass, *klass, *refklass;
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetPropertiesByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
+ves_icall_RuntimeType_GetPropertiesByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
{
MonoError error;
MonoDomain *domain;
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetEvents_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
+ves_icall_RuntimeType_GetEvents_internal (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoReflectionType *reftype)
{
MonoError error;
MonoDomain *domain;
}
ICALL_EXPORT MonoArray*
-ves_icall_Type_GetNestedTypes (MonoReflectionType *type, MonoString *name, guint32 bflags)
+ves_icall_RuntimeType_GetNestedTypes (MonoReflectionType *type, MonoString *name, guint32 bflags)
{
MonoError error;
MonoReflectionType *rt;
domain = ((MonoObject *)type)->vtable->domain;
if (type->type->byref) {
- MonoArray *result = mono_array_new_cached (domain, mono_defaults.monotype_class, 0, &error);
+ MonoArray *result = mono_array_new_cached (domain, mono_defaults.runtimetype_class, 0, &error);
mono_error_set_pending_exception (&error);
return result;
}
mono_ptr_array_append (tmp_array, (MonoObject*) rt);
}
- res = mono_array_new_cached (domain, mono_defaults.monotype_class, mono_ptr_array_size (tmp_array), &error);
+ res = mono_array_new_cached (domain, mono_defaults.runtimetype_class, mono_ptr_array_size (tmp_array), &error);
if (!is_ok (&error))
goto leave;
}
ICALL_EXPORT int
-vell_icall_MonoType_get_core_clr_security_level (MonoReflectionType *rfield)
+vell_icall_RuntimeType_get_core_clr_security_level (MonoReflectionType *rfield)
{
MonoError error;
MonoClass *klass = mono_class_from_mono_type (rfield->type);
} else {
count = tdef->rows - 1;
}
- res = mono_array_new_checked (domain, mono_defaults.monotype_class, count, error);
+ res = mono_array_new_checked (domain, mono_defaults.runtimetype_class, count, error);
return_val_if_nok (error, NULL);
*exceptions = mono_array_new_checked (domain, mono_defaults.exception_class, count, error);
return_val_if_nok (error, NULL);
len1 = mono_array_length (res);
len2 = mono_array_length (res2);
- res3 = mono_array_new_checked (domain, mono_defaults.monotype_class, len1 + len2, &error);
+ res3 = mono_array_new_checked (domain, mono_defaults.runtimetype_class, len1 + len2, &error);
if (mono_error_set_pending_exception (&error))
return NULL;
mono_array_memcpy_refs (res3, 0, res, 0, len1);
mono_array_memcpy_refs (res3, len1, res2, 0, len2);
res = res3;
- ex3 = mono_array_new_checked (domain, mono_defaults.monotype_class, len1 + len2, &error);
+ ex3 = mono_array_new_checked (domain, mono_defaults.runtimetype_class, len1 + len2, &error);
if (mono_error_set_pending_exception (&error))
return NULL;
mono_array_memcpy_refs (ex3, 0, exceptions, 0, len1);
int i;
if (!module->image) {
- MonoArray *arr = mono_array_new_checked (mono_object_domain (module), mono_defaults.monotype_class, 0, &error);
+ MonoArray *arr = mono_array_new_checked (mono_object_domain (module), mono_defaults.runtimetype_class, 0, &error);
mono_error_set_pending_exception (&error);
return arr;
} else {
}
ICALL_EXPORT MonoReflectionType *
-ves_icall_Type_make_array_type (MonoReflectionType *type, int rank)
+ves_icall_RuntimeType_make_array_type (MonoReflectionType *type, int rank)
{
MonoError error;
MonoReflectionType *ret;
}
ICALL_EXPORT MonoReflectionType *
-ves_icall_Type_make_byref_type (MonoReflectionType *type)
+ves_icall_RuntimeType_make_byref_type (MonoReflectionType *type)
{
MonoError error;
MonoReflectionType *ret;
}
ICALL_EXPORT MonoReflectionType *
-ves_icall_Type_MakePointerType (MonoReflectionType *type)
+ves_icall_RuntimeType_MakePointerType (MonoReflectionType *type)
{
MonoError error;
MonoReflectionType *ret;
MonoType *type;
};
+/* This corresponds to System.RuntimeType */
typedef struct {
MonoReflectionType type;
MonoObject *type_info;
* re-acquire them and check if another thread has created the vtable in the meantime.
*/
/* Special case System.MonoType to avoid infinite recursion */
- if (klass != mono_defaults.monotype_class) {
+ if (klass != mono_defaults.runtimetype_class) {
vt->type = mono_type_get_object_checked (domain, &klass->byval_arg, error);
if (!is_ok (error)) {
mono_domain_unlock (domain);
return NULL;
}
- if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.monotype_class)
+ if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.runtimetype_class)
/* This is unregistered in
unregister_vtable_reflection_type() in
domain.c. */
klass->runtime_info = runtime_info;
}
- if (klass == mono_defaults.monotype_class) {
+ if (klass == mono_defaults.runtimetype_class) {
vt->type = mono_type_get_object_checked (domain, &klass->byval_arg, error);
if (!is_ok (error)) {
mono_domain_unlock (domain);
return NULL;
}
- if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.monotype_class)
+ if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.runtimetype_class)
/* This is unregistered in
unregister_vtable_reflection_type() in
domain.c. */
return_val_if_nok (error, 0);
token = mono_metadata_token_from_dor (mono_image_typedef_or_ref (assembly, type));
}
- } else if (strcmp (klass->name, "MonoType") == 0) {
+ } else if (strcmp (klass->name, "RuntimeType") == 0) {
MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
return_val_if_nok (error, 0);
MonoClass *mc = mono_class_from_mono_type (type);
}
}
/* This is stored in vtables/JITted code so it has to be pinned */
- res = (MonoReflectionType *)mono_object_new_pinned (domain, mono_defaults.monotype_class, error);
+ res = (MonoReflectionType *)mono_object_new_pinned (domain, mono_defaults.runtimetype_class, error);
if (!mono_error_ok (error))
return NULL;
} else if (strcmp (klass->name, "TypeBuilder") == 0) {
MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)obj;
token = tb->table_idx | MONO_TOKEN_TYPE_DEF;
- } else if (strcmp (klass->name, "MonoType") == 0) {
+ } else if (strcmp (klass->name, "RuntimeType") == 0) {
MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)obj, error);
return_val_if_nok (error, 0);
MonoClass *mc = mono_class_from_mono_type (type);
mono_error_init (error);
klass = obj->vtable->klass;
- if (klass == mono_defaults.monotype_class) {
+ if (klass == mono_defaults.runtimetype_class) {
MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
return_val_if_nok (error, NULL);
klass = mono_class_from_mono_type (type);
return_val_if_nok (error, NULL);
*handle_class = mono_defaults.string_class;
g_assert (result);
- } else if (strcmp (obj->vtable->klass->name, "MonoType") == 0) {
+ } else if (strcmp (obj->vtable->klass->name, "RuntimeType") == 0) {
MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)obj, error);
return_val_if_nok (error, NULL);
MonoClass *mc = mono_class_from_mono_type (type);
/* unlike most Invoke* cases InvokeMember is not inside System.Reflection[.Emit] but is SecuritySafeCritical */
if (((*kname == 'T') && (strcmp (kname, "Type") == 0)) ||
- ((*kname == 'M') && (strcmp (kname, "MonoType")) == 0)) {
+ ((*kname == 'R') && (strcmp (kname, "RuntimeType")) == 0)) {
/* if calling InvokeMember then we can't stop the stackwalk here and need to look at the caller */
if (strcmp (m->name, "InvokeMember") == 0)
static void
buffer_add_cattr_arg (Buffer *buf, MonoType *t, MonoDomain *domain, MonoObject *val)
{
- if (val && val->vtable->klass == mono_defaults.monotype_class) {
+ if (val && val->vtable->klass == mono_defaults.runtimetype_class) {
/* Special case these so the client doesn't have to handle Type objects */
buffer_add_byte (buf, VALUE_TYPE_ID_TYPE);
#define NEW_LDSTRLITCONST(cfg,dest,val) NEW_AOTCONST ((cfg), (dest), MONO_PATCH_INFO_LDSTR_LIT, (val))
-#define NEW_TYPE_FROM_HANDLE_CONST(cfg,dest,image,token,generic_context) NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_TYPE_FROM_HANDLE, (image), (token), (generic_context), STACK_OBJ, mono_defaults.monotype_class)
+#define NEW_TYPE_FROM_HANDLE_CONST(cfg,dest,image,token,generic_context) NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_TYPE_FROM_HANDLE, (image), (token), (generic_context), STACK_OBJ, mono_defaults.runtimetype_class)
#define NEW_LDTOKENCONST(cfg,dest,image,token,generic_context) NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_LDTOKEN, (image), (token), (generic_context), STACK_PTR, NULL)
#define EMIT_NEW_LDSTRLITCONST(cfg,dest,val) do { NEW_AOTCONST ((cfg), (dest), MONO_PATCH_INFO_LDSTR_LIT, (val)); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
-#define EMIT_NEW_TYPE_FROM_HANDLE_CONST(cfg,dest,image,token,generic_context) do { NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_TYPE_FROM_HANDLE, (image), (token), (generic_context), STACK_OBJ, mono_defaults.monotype_class); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
+#define EMIT_NEW_TYPE_FROM_HANDLE_CONST(cfg,dest,image,token,generic_context) do { NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_TYPE_FROM_HANDLE, (image), (token), (generic_context), STACK_OBJ, mono_defaults.runtimetype_class); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
#define EMIT_NEW_LDTOKENCONST(cfg,dest,image,token,generic_context) do { NEW_AOTCONST_TOKEN ((cfg), (dest), MONO_PATCH_INFO_LDTOKEN, (image), (token), (generic_context), STACK_PTR, NULL); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
g_free (as);
} else if (klass == mono_defaults.int32_class) {
printf ("[INT32:%p:%d], ", o, *(gint32 *)((char *)o + sizeof (MonoObject)));
- } else if (klass == mono_defaults.monotype_class) {
+ } else if (klass == mono_defaults.runtimetype_class) {
printf ("[TYPE:%s], ", mono_type_full_name (((MonoReflectionType*)o)->type));
} else
printf ("[%s.%s:%p], ", klass->name_space, klass->name, o);