Commit Graph
72 Commits
Author SHA1 Message Date
Zoltan Varga b58da19a66 [corlib] Implement MonoGenericClass:GetCustomAttributes () for created types. Fixes #23769. 2014-10-15 15:21:53 -04:00
Marek Safar 2f639b3c78 Use IReflectType interface instead of TypeDelegator for introspection type extensions. Fixes #14168 2013-08-28 17:55:53 +02:00
Rodrigo Kumpera 2c8c93b378 Remove SRE from Full AOT builds. 2012-11-06 18:18:14 -05:00
Rodrigo Kumpera c17fbc8e27 Kill more compiler context code. 2012-07-11 10:00:38 -03:00
Rodrigo Kumpera 5a5ceee166 MonoGenericClass::initialize runtime icall only needs fields. 2012-07-11 09:31:59 -03:00
Rodrigo Kumpera 751c900a63 First pass killing compiler context support code.
* MonoGenericClass.cs: Switch to MS's behavior and kill
	on ton of code in the process. Only MCS depended on it
	and now we can kill it.
2012-07-10 18:38:32 -03:00
Rodrigo Kumpera 28894b99c8 Use a simpler design for IsUserType based on virtual calls.
* Type.cs (IsUserType) Replace the current hacky way with
	a virtual call. This removes a direct dependency on a type
	and a bunch of stuff that would otherwise be loaded for
	no good reason.
2012-07-10 16:58:53 -03:00
Rodrigo Kumpera 83dccf8fe7 Add all missing sequential layout directives to corlib and system. 2011-12-13 11:57:23 -02:00
Zoltan Varga 929b66f583 Get rid of IsCompilerContext, mcs no longer uses SRE. 2011-11-06 19:36:36 +01:00
Sebastien Pouliot 438681d961 Use Type.EmptyTypes instead of new Type[0]
* mcs/class/corlib/System.Reflection/MonoGenericClass.cs:
* mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs:
	Use Type.EmptyTypes instead of new Type[0]
2011-03-21 09:38:48 -04:00
Marek Safar d84d7c7eb9 Remove no longer used BOOTSTRAP conditionals 2010-12-29 12:41:12 +00:00
Rodrigo Kumpera ef4cf45281 Fix #642130.
* MonoGenericClass.cs (.ctor): Only register with the runtime
	when the underlying TB is not finished.

	* MonoGenericClassTest.cs: Add regression test.

	* TypeTest.cs: Fix a test that had a broken assumption.

	Fix #642130
2010-10-04 15:58:22 -03:00
Rodrigo Kumpera 35dda30dac 2010-04-08 Rodrigo Kumpera <[email protected]>
* Type.cs: Add ResolveInternal virtual call that
	resolves a given type to it's concrete type.

2010-04-08 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Implement ResolveInternal.

2010-04-08 Rodrigo Kumpera  <[email protected]>

	* EnumBuilder.cs:
	* GenericTypeParameterBuilder.cs:
	* DerivedTypes.cs:
	* TypeBuilder.cs: Add ResolveInternal virtual call that
	resolves a given type to it's concrete type.

	* TypeBuilder.cs (DefineDefaultConstructor): Use
	ResolveInternal on parent to do the lookup on a
	finished type.

	Fixes #591225.

svn path=/trunk/mcs/; revision=155115
2010-04-09 02:38:22 +00:00
Zoltan Varga ae7654c878 2010-01-31 Zoltan Varga <[email protected]>
* MonoGenericClass.cs: Fix a warning.

svn path=/trunk/mcs/; revision=150607
2010-01-31 19:21:10 +00:00
Rodrigo Kumpera 94fa86a676 2009-12-17 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (GetMethods): When the GTD is not a typebuilder,
	calling GetMethods on it will return everything we need so no need to
	do the crazy loop.
	The returned methods might contains some that are not from a generic type
	so we need to guard against this as well.

	* MonoGenericClass.cs (GetMethodsInternal): Guard against methods that don't
	belong to a GTD as well.

svn path=/trunk/mcs/; revision=148735
2009-12-17 22:57:23 +00:00
Rodrigo Kumpera cd70db557e 2009-12-14 Rodrigo Kumpera <[email protected]>
Type.cs (IsCompilerContext): The default implementation now checks if the
	type's assembly is under compiler context or not.

2009-12-14 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Remove IsByRef hack.

2009-12-14 Rodrigo Kumpera  <[email protected]>

	* TypeBuilder.cs (GetConstructor/GetMethod): Fail with a NRE if method/ctor
	is null.

2009-12-14 Rodrigo Kumpera  <[email protected]>

	* TypeTest.cs: Fix test that checked for old and wrong behavior of mono.

svn path=/trunk/mcs/; revision=148433
2009-12-14 22:56:17 +00:00
Rodrigo Kumpera 91ac601fd4 2009-12-12 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Remove useless field.

2009-12-12 Rodrigo Kumpera  <[email protected]>

	* Environment.cs: Bump corlib version.

svn path=/trunk/mcs/; revision=148339
2009-12-13 01:18:45 +00:00
Rodrigo Kumpera 47e43931b0 2009-12-12 Rodrigo Kumpera <[email protected]>
* MonoType.cs: Make the GetConstructorImpl machinery available
	to be used by others.

	* Type.cs (MakeGenericType): Is any of the arguments is not a system
	type create an instance of MonoGenericClass instead.

2009-12-12 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Change it to support a non-sre generic type
	definition.

2009-12-10 Rodrigo Kumpera  <[email protected]>

	* AssemblyBuilder.cs (MakeGenericType): Accept a Type as argument.

	* ConstructorOnTypeBuilderInst.cs: Change it to support an underlying
	non-sre constructor.

	* MethodOnTypeBuilderInst.cs: Change it to support an underlying
	non-sre method.

	* FieldOnTypeBuilderInst.cs: Change it to support an underlying
	non-sre field.

	* EventOnTypeBuilderInst.cs: Change it to support an underlying
	non-sre event.

svn path=/trunk/mcs/; revision=148338
2009-12-13 01:18:27 +00:00
Rodrigo Kumpera 4f75aea804 2009-12-10 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs: Add MakeGenericType method while takes care of doing
	generic instance canonicalization under compiler context.

	* DerivedTypes.cs: Add ArrayType::GetEffectiveRank to make it possible to
	distinguish between [] and [*].

	* TypeBuilder.cs: Implement MakeGenericType in managed code.

2009-12-10 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Add new register_with_runtime icall to make
	sure that a managed code instantiated MGC will be returned when
	the generic instantiation happens in unmanaged code.

	This is a temporary workaround while Type::MakeGenericType doesn't
	handle user types properly.

svn path=/trunk/mcs/; revision=148083
2009-12-11 02:32:59 +00:00
Rodrigo Kumpera 6a71855784 2009-12-10 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Make this class inherit from Type instead of
	MonoType. Implement some missing methods and make sure we can still
	be used as a byref type.

svn path=/trunk/mcs/; revision=148082
2009-12-11 02:32:22 +00:00
Rodrigo Kumpera e1d99a0249 2009-12-08 Rodrigo Kumpera <[email protected]>
* Type.cs: Add virtual property IsCompilerContext to cleanup
	compiler context resolution across SRE.

2009-12-08 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Implement IsCompilerContext property and replace
	all checks to use it.

2009-12-08 Rodrigo Kumpera  <[email protected]>

	* DerivedTypes.cs: Implement IsCompilerContext property and replace
	all checks to use it.

	* EnumBuilder.cs: Ditto.

	* GenericTypeParameterBuilder.cs: Ditto.

	* TypeBuilder.cs: Ditto.

	* FieldOnTypeBuilderInst.cs: Replace ad-hoc check for compiler context
	with proper call to generic instance type.

	* MethodOnTypeBuilderInst.cs: Ditto.

	* ConstructorOnTypeBuilderInst.cs: Ditto.

svn path=/trunk/mcs/; revision=147849
2009-12-08 14:06:16 +00:00
Rodrigo Kumpera dc1555f40d 2009-12-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (InflateType): Add a type argument parameter and
	make this function static. Now it can inflate types using the context
	of any type.

svn path=/trunk/mcs/; revision=147665
2009-12-04 16:13:48 +00:00
Marek Safar 3086e99d75 Warnings cleanup
svn path=/trunk/mcs/; revision=146142
2009-11-13 14:52:59 +00:00
Miguel de Icaza 3400094d1a System.Reflection's turn to be de-ifdefified
svn path=/trunk/mcs/; revision=145240
2009-11-03 01:20:56 +00:00
Zoltan Varga 110af9e7c3 Fix the build.
svn path=/trunk/mcs/; revision=140199
2009-08-18 21:04:23 +00:00
Zoltan Varga c1f1c8dd77 2009-08-18 Zoltan Varga <[email protected]>
* MonoGenericClass.cs: Use StringComparison.Ordinal when calling
	String.EndsWith ().

svn path=/trunk/mcs/; revision=140185
2009-08-18 18:46:57 +00:00
Rodrigo Kumpera 8aba75ce1f 2009-08-07 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Implement almost all methods required
	to move to inherit from System.Type. The only missing methods
	are Is(Array|Pointer|ByRef)Impl and GetElementType since the
	runtime still generates weird instances for generics instances
	of non-SRE types with SRE types as generic arguments.

2009-08-07 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClassTest.cs: Test for methods that must
	throw.

svn path=/trunk/mcs/; revision=139596
2009-08-07 23:39:30 +00:00
Rodrigo Kumpera e5d7850ed8 2009-08-06 Rodrigo Kumpera <[email protected]>
* Environment.cs: Bump corlib version.

2009-08-06 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs (InflateType): Add support to inflate
	generic method arguments.

	* MonoGenericClass.cs (GetMethod): Remove restriction
	with generic methods.

2009-08-06 Rodrigo Kumpera  <[email protected]>

	* MethodOnTypeBuilderInstTest.cs: Add tests for
	generic method instances over generic type instances.

2009-08-06 Rodrigo Kumpera  <[email protected]>

	* MethodBuilder.cs: Mark generic_params internal.

	* MethodOnTypeBuilderInst.cs: Add fields to support
	inflated generic methods. Implement generics related
	methods.

svn path=/trunk/mcs/; revision=139534
2009-08-07 01:56:45 +00:00
Rodrigo Kumpera b30bc9dc1a 2009-08-05 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (FullName): mcs depends that FullName
	doesn't return null for instantiations over generic params
	of type builders. We special case this under compiler context.

svn path=/trunk/mcs/; revision=139403
2009-08-05 15:03:51 +00:00
Rodrigo Kumpera 62ac371188 2009-08-05 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Remove Is(Array|Pointer|ByRef)Impl
	and GetElementType since the runtime still produces instances
	of MonoGenericClass for those types.

svn path=/trunk/mcs/; revision=139400
2009-08-05 14:28:28 +00:00
Rodrigo Kumpera 96cea2f037 2009-08-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Implement more methods from MonoType.
	Done with all type name related properties.

svn path=/trunk/mcs/; revision=139380
2009-08-05 01:07:54 +00:00
Rodrigo Kumpera 01f8d10d86 2009-08-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Implement Is*Impl methods to simply
	return false.

svn path=/trunk/mcs/; revision=139379
2009-08-05 00:08:27 +00:00
Rodrigo Kumpera 7e56b7183d 2009-08-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Implement Make(Array,ByRef,Pointer) using the
	new managed types.

svn path=/trunk/mcs/; revision=139378
2009-08-05 00:08:05 +00:00
Rodrigo Kumpera 83de2c8050 2009-08-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (InflateType): Implement it in terms of managed
	code and kill the corresponding icall.

svn path=/trunk/mcs/; revision=139375
2009-08-05 00:06:57 +00:00
Rodrigo Kumpera 9b26abaed8 2009-08-04 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Add type_arguments field and constructor
	that initializes it.

2009-08-04 Rodrigo Kumpera  <[email protected]>

	* Environment.cs: Bump corlib version.

svn path=/trunk/mcs/; revision=139372
2009-08-05 00:06:13 +00:00
Rodrigo Kumpera 2909089503 2009-08-03 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (initialize): Remember the number
	of events available at initialization time. This is required as
	mcs expect this behavior under compiler context that new events
	are not returned for an instance that was inflated before.

	* MonoGenericClass.cs: Kill GetEvents_internal and implement it
	in terms of managed code.

2009-08-03 Rodrigo Kumpera  <[email protected]>

	* EventBuilder.cs: Make some fields internal.

	* TypeBuilder.cs: Make events field internal.
	Remove some MonoTODOs that are already done.

	* EventOnTypeBuilderInst.cs: New file which implements
	the required functionality by compiler context.

svn path=/trunk/mcs/; revision=139307
2009-08-04 00:10:17 +00:00
Rodrigo Kumpera 2ef395d58f 2009-07-29 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs (GetConstructors): Throw if
	TypeBuilder is incomplete.

2009-07-29 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs (initialize): Call TypeBuilder::GetConstructorsInternal
	since the public version throws.

2009-07-29 Rodrigo Kumpera  <[email protected]>

	* TypeBuilderTest: Test for GetConstructors.

svn path=/trunk/mcs/; revision=139009
2009-07-29 22:04:02 +00:00
Marek Safar 095de6fc98 2008-07-29 Marek Safar <[email protected]>
* MonoGenericClass.cs: Removed one IsCompilerContext hack.


svn path=/trunk/mcs/; revision=138948
2009-07-29 12:55:02 +00:00
Miguel de Icaza 5949b71fb0 Revert patch until Rodrigo comes back on Monday
svn path=/trunk/mcs/; revision=138681
2009-07-26 01:33:08 +00:00
Rodrigo Kumpera 5ab33cc376 2009-07-24 Rodrigo Kumpera <[email protected]>
* EventBuilder.cs: Make some fields internal.

	* TypeBuilder.cs: Make events field internal.
	Remove some MonoTODOs that are already done.

2009-07-24 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs (initialize): Remember the number
	of events available at initialization time. This is required as
	mcs expect this behavior under compiler context that new events
	are not returned for an instance that was inflated before.

	* MonoGenericClass.cs: Kill GetEvents_internal and implement it
	in terms of managed code.

svn path=/trunk/mcs/; revision=138669
2009-07-25 00:24:41 +00:00
Rodrigo Kumpera 8963bb7cb2 2009-07-24 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (GetParentType): Implement using managed code.

svn path=/trunk/mcs/; revision=138668
2009-07-25 00:24:26 +00:00
Rodrigo Kumpera 40cadb8e14 2009-07-24 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs: Make all icalls private. Kill GetInterfaces_internal.
	Add a workaround for a GetField under compiler context.

2009-07-24 Rodrigo Kumpera  <[email protected]>

	* TypeBuilder.cs: Make the interfaces field internal.

svn path=/trunk/mcs/; revision=138667
2009-07-25 00:24:15 +00:00
Rodrigo Kumpera f41f040c36 2009-07-24 Rodrigo Kumpera <[email protected]>
* FieldOnTypeBuilderInst.cs: Add a ToString() to help debugging.
	Make fields internal.

	* MethodOnTypeBuilderInst.cs: Build it under BOOTSTRAP_NET_2_0.

2009-07-24 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs (GetMethod): Use the new code always. Don't
	accept MethodOnTypeBuilderInst under compiler context.

	* MonoGenericClass.cs (GetField): Use the new code always.

	* MonoGenericClass.cs: Make a bunch of methods raise NotSupportedException
	when not under compiler context. Remove some dead code.

svn path=/trunk/mcs/; revision=138640
2009-07-24 15:59:27 +00:00
Rodrigo Kumpera fe8dbb3491 2009-07-23 Rodrigo Kumpera <[email protected]>
* ConstructorBuilder.cs: Make parameters and pinfo fields internal.

	* ConstructorOnTypeBuilderInst.cs: Build it under BOOTSTRAP_NET_2_0.
	Properly implement GetParameters under compiler context.

	* TypeBuilder.cs: Make ctors field internal.

2009-07-23 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Kill GetConstructors_internal and implement it
	all in terms of managed code.

	* MonoGenericClass.cs: Return instances of ConstructorOnTypeBuilderInst
	under bootstrap profile.

svn path=/trunk/mcs/; revision=138591
2009-07-23 21:05:01 +00:00
Rodrigo Kumpera dc3c422dbc 2009-07-23 Rodrigo Kumpera <[email protected]>
* FieldOnTypeBuilderInst.cs: Implement MetadataToken and FieldToken
	for compiler context.

	* TypeBuilder.cs: Make FieldBuilder related fields internal.

2009-07-23 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Kill GetFields_internal and implement it
	all in terms of managed code.

svn path=/trunk/mcs/; revision=138590
2009-07-23 21:04:50 +00:00
Rodrigo Kumpera 270a4ee7ee 2009-07-23 Rodrigo Kumpera <[email protected]>
* PropertyOnTypeBuilderInst.cs: Use TypeBuilder::GetMethod instead of
	MonoGenericClass::GetCorrespondingInflatedMethod. This is possible
	since the returned methods of MonoGenericClass::GetMethods have been
	unified with TypeBuilder::GetMethod.

	* TypeBuilder.cs: Make property related fields internal.

2009-07-23 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Kill GetMethods_internal and implement it
	all in terms of managed code.

svn path=/trunk/mcs/; revision=138589
2009-07-23 21:04:34 +00:00
Rodrigo Kumpera 488831bf77 2009-07-22 Rodrigo Kumpera <[email protected]>
* MethodOnTypeBuilderInst.cs: Implement ToString to help debugging.

	* TypeBuilder.cs: Make the properties field internal.

	* PropertyOnTypeBuilderInst.cs: New type implementing a property of an
	inflated TypeBuilder.

2009-07-22 Rodrigo Kumpera  <[email protected]>

	* MonoGenericClass.cs: Kill GetProperties_internal and implement it
	all in terms of managed code.

svn path=/trunk/mcs/; revision=138482
2009-07-23 02:22:31 +00:00
Zoltan Varga 5324163a6a 2009-01-24 Zoltan Varga <[email protected]>
* MonoGenericClass.cs: Fix warnings.

svn path=/trunk/mcs/; revision=124421
2009-01-24 21:31:06 +00:00
Marek Safar 2e6942f224 Warnings cleanup
svn path=/trunk/mcs/; revision=111908
2008-08-29 11:02:23 +00:00
Rodrigo Kumpera a6f6792df4 2008-07-30 Rodrigo Kumpera <[email protected]>
* MonoGenericClass.cs (InflateType): Guard against null types.
	Fixes #412965.


svn path=/trunk/mcs/; revision=109280
2008-07-30 17:08:38 +00:00