Commit Graph
589 Commits
Author SHA1 Message Date
Jb Evain 5af7b13766 2010-06-22 Jb Evain <[email protected]>
* ModuleBuilder.cs
	* AssemblyBuilder.cs:
		properly override the new net_4_0 methods in moonlight.


svn path=/trunk/mcs/; revision=159312
2010-06-22 08:18:42 +00:00
Jb Evain ed17c1d03a 2010-05-27 Jb Evain <[email protected]>
* EnumBuilder.cs (GetEnumUnderlyingType): override.


svn path=/trunk/mcs/; revision=158021
2010-05-27 11:39:58 +00:00
Marek Safar 656bfd8fc6 2010-05-18 Marek Safar <[email protected]>
* TypeBuilder.cs, PropertyBuilder.cs: Add DefineProperty overloads.



svn path=/trunk/mcs/; revision=157510
2010-05-18 17:33:42 +00:00
Marek Safar 4f81102f1c 2010-04-27 Marek Safar <[email protected]>
* TypeBuilder.cs: StructLayoutAttribute ctor can be builder when
	compiling corlib.


svn path=/trunk/mcs/; revision=156195
2010-04-27 17:23:59 +00:00
Rodrigo Kumpera 736df07e26 2010-04-20 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs (CreateType): Move default constructor
	and createTypeCalled assignment to before the parent checks.

	* TypeBuilder.cs (is_created): Return true even if creation
	fails.

	Fixes #331126

svn path=/trunk/mcs/; revision=155832
2010-04-20 19:29:34 +00:00
Rodrigo Kumpera 918eb0f78a 2010-04-09 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs (IsValueTypeImpl): Don't depend on
	type_is_subtype_of icall. Fixes corlib compilation.

svn path=/trunk/mcs/; revision=155172
2010-04-09 22:50:57 +00: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
Rodrigo Kumpera 4f09dcaf9f 2010-04-08 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs (GenericInstanceKey): Precalculate
	GenericInstanceKey hash code since this can cause infinite
	recursion when inflating "Foo<T> : Bar<Foo<T>>" parent.

	* TypeBuilder.cs (IsSubclassOf): Don't delegate to base class
	since the unmanaged information can be out of sync.

	* TypeBuilder.cs (UnderlyingSystemType): Invert the test order
	since IsEnum now is potentialy more expensive.

	Fixes #594728.

svn path=/trunk/mcs/; revision=155053
2010-04-08 14:53:25 +00:00
Marek Safar 6b119e8b04 2010-04-06 Marek Safar <[email protected]>
* ModuleBuilder.cs: Use Dictionary.


svn path=/trunk/mcs/; revision=154833
2010-04-06 09:47:13 +00:00
Rodrigo Kumpera e880014952 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement Resolve*.

svn path=/trunk/mcs/; revision=154676
2010-04-01 22:57:44 +00:00
Rodrigo Kumpera 0beef243b4 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement ModuleVersionId.

svn path=/trunk/mcs/; revision=154675
2010-04-01 22:57:36 +00:00
Rodrigo Kumpera 6d55e2c917 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement ResolveType.

svn path=/trunk/mcs/; revision=154663
2010-04-01 17:37:52 +00:00
Rodrigo Kumpera d5876b9b03 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement GetMethodImpl.

svn path=/trunk/mcs/; revision=154661
2010-04-01 17:37:35 +00:00
Rodrigo Kumpera 273cd925d4 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs (DefineType): Raise the correct exception
	when name is null.

svn path=/trunk/mcs/; revision=154659
2010-04-01 17:37:18 +00:00
Rodrigo Kumpera 814e0d27d2 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement IsResource.

svn path=/trunk/mcs/; revision=154658
2010-04-01 17:37:09 +00:00
Rodrigo Kumpera 37939abe92 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement ScopedName property.

svn path=/trunk/mcs/; revision=154656
2010-04-01 17:36:52 +00:00
Rodrigo Kumpera ddd89e3700 2010-04-01 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement Name property.

svn path=/trunk/mcs/; revision=154655
2010-04-01 17:36:43 +00:00
Rodrigo Kumpera 104964981d 2010-03-31 Rodrigo Kumpera <[email protected]>
* ModuleBuilder.cs: Implement Assembly property.

svn path=/trunk/mcs/; revision=154596
2010-04-01 00:16:12 +00:00
Zoltan Varga 1e41bd3687 2010-04-01 Zoltan Varga <[email protected]>
* TypeBuilder.cs (GetField): Avoid a crash if this is called on a
	FieldOnTypeBuilderInst. Fixes #586944.

svn path=/trunk/mcs/; revision=154580
2010-03-31 23:09:53 +00:00
Zoltan Varga f9ae95c854 2010-03-30 Zoltan Varga <[email protected]>
* ModuleBuilder.cs (DefinedType): Lookup inside the name_cache before creating
	the TypeBuilder since the runtime code can't handle a duplicate type name.

svn path=/trunk/mcs/; revision=154486
2010-03-30 20:11:02 +00:00
Zoltan Varga 4fc39eebd4 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeType.cs (IsValidType): Implement proper checking for value types
	as well.

svn path=/trunk/mcs/; revision=154473
2010-03-30 18:03:26 +00:00
Zoltan Varga 7a53545cf5 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs: Fix the calls to IsValidType, some were passing
	in DeclaringType instead of PropertyType/FieldType.

	* CustomAttributeType.cs (IsValidType): Implement proper checking for reference
	types. Fixes #591788.

svn path=/trunk/mcs/; revision=154423
2010-03-30 05:27:31 +00:00
Zoltan Varga 831b96547e 2010-03-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (IsValidType): Call Enum.GetUnderlyingType () for
	dynamic enums to avoid crashes in the unmanaged code. Fixes #591800.

svn path=/trunk/mcs/; revision=154419
2010-03-30 03:30:19 +00:00
Rodrigo Kumpera fd3b1afb67 2010-03-26 Rodrigo Kumpera <[email protected]>
* Assembly.cs: Add IsDynamic.

2010-03-26 Rodrigo Kumpera  <[email protected]>

        * AssemblyBuilder.cs: Add IsDynamic.

svn path=/trunk/mcs/; revision=154329
2010-03-26 22:35:19 +00:00
Rodrigo Kumpera c370b33899 2010-03-26 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs: Implement v4 GetSatelliteAssembly,
	ManifestModule, GlobalAssemblyCache.

svn path=/trunk/mcs/; revision=154312
2010-03-26 19:15:39 +00:00
Rodrigo Kumpera 280fce3bf7 2010-03-26 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs: Implement v4 GetReferencedAssemblies
	and GetLoadedModules.

2010-03-26 Rodrigo Kumpera  <[email protected]>

	* AssemblyBuilderTest.cs: Test GetReferencedAssemblies
	and GetLoadedModules.

svn path=/trunk/mcs/; revision=154311
2010-03-26 19:15:31 +00:00
Rodrigo Kumpera bb85d0c720 2010-03-25 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs: Implement v4 GetModule(s).

2010-03-25 Rodrigo Kumpera  <[email protected]>

	* AssemblyBuilderTest.cs: Add test for v4 GetModule(s).

svn path=/trunk/mcs/; revision=154232
2010-03-25 23:42:14 +00:00
Rodrigo Kumpera 6493d5e8ba 2010-03-25 Rodrigo Kumpera <[email protected]>
* AssemblyBuilder.cs: Implement v4 GetType.

2010-03-25 Rodrigo Kumpera  <[email protected]>

	* AssemblyBuilderTest.cs: Add test for v4 GetType and
	fix other test to not be broken.

svn path=/trunk/mcs/; revision=154231
2010-03-25 23:42:05 +00:00
Rodrigo Kumpera 45562016b5 2010-03-23 Rodrigo Kumpera <[email protected]>
* MethodOnTypeBuilderInst.cs (ContainsGenericParameters): Check
	the base_method first.

2010-03-23 Rodrigo Kumpera  <[email protected]>

	* MethodOnTypeBuilderInstTest.cs: Add Test for
	* ContainsGenericParameters.

svn path=/trunk/mcs/; revision=154062
2010-03-23 14:37:36 +00:00
Jb Evain 05a5b21fa0 use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153656
2010-03-16 12:10:19 +00:00
Jb Evain 7926de8d42 2010-03-12 Jb Evain <[email protected]>
* AssemblyBuilder.cs (AddTypeForwarder): throw if the
	type is a nested type.


svn path=/trunk/mcs/; revision=153501
2010-03-12 11:46:55 +00:00
Rodrigo Kumpera d923a87a54 2010-03-11 Rodrigo Kumpera <[email protected]>
* TypeBuilder.cs (GetMethod): Allow type to be the typebuilder
	* itself.
	Add better error checking to GetConstructor and GetField.

	Fixes #587106.

svn path=/trunk/mcs/; revision=153468
2010-03-11 15:00:51 +00:00
Sebastien Pouliot 88c66d5a4c In Assembly:
2010-02-09  Sebastien Pouliot  <[email protected]>

	* AssemblyInfo.cs: Mono.CompilerServices.SymbolWriter does not
	need to access mscorlib.dll internals anymore (ArrayList and
	Hashtable)

In .:
2010-02-09  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_corlib.dll.sources: Add Mono.CompilerServices.
	SymbolWriter source files directly into mscorlib 2.1

In System.Reflection.Emit:
2010-02-09  Sebastien Pouliot  <[email protected]>

	* ModuleBuilder.cs: Do not use reflection to create SymbolWriterImpl
	for Moonlight since the code is bundled inside mscorlib.dll to avoid
	having a non-platform assembly poking the internals of mscorlib.dll


svn path=/trunk/mcs/; revision=151176
2010-02-10 02:41:23 +00:00
Zoltan Varga ab8d6a64c9 2010-01-30 Zoltan Varga <[email protected]>
* CustomAttributeBuilder.cs (Initialize): Add more argument checking to avoid
	assertions in the runtime. Fixes #574353.

svn path=/trunk/mcs/; revision=150597
2010-01-30 19:58:35 +00:00
Rodrigo Kumpera 5f6e5d0806 2010-01-19 Rodrigo Kumpera <[email protected]>
* EventOnTypeBuilderInst.cs: Fix build.

svn path=/trunk/mcs/; revision=149828
2010-01-19 16:52:51 +00:00
Zoltan Varga c751247ae7 2010-01-03 Zoltan Varga <[email protected]>
* ILGenerator.cs (Emit): Disallow byref types. Fixes #564411.

svn path=/trunk/mcs/; revision=148981
2010-01-03 15:06:49 +00:00
Rodrigo Kumpera 4c2fff982e 2009-12-16 Rodrigo Kumpera <[email protected]>
* FieldOnTypeBuilderInst.cs: Add more CompilerContext hacks.

svn path=/trunk/mcs/; revision=148576
2009-12-16 19:45:39 +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 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
Jb Evain a29f0cf974 2009-12-09 Jb Evain <[email protected]>
* ILGenerator.cs (Emit(OpCode,LocalBuilder)): deal with
	opcodes not related to locals.


svn path=/trunk/mcs/; revision=147940
2009-12-09 19:27:58 +00:00
Rodrigo Kumpera 5274395f00 2009-12-08 Rodrigo Kumpera <[email protected]>
* MonoMethod.cs (MakeGenericMethod): If any of the arguments is
	a non system type, inflate to a MethodOnTypeBuilderInst.

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

	* MethodOnTypeBuilderInst.cs: Add new constructor that takes a MethodInfo
	as base method. Change how compiler context is calculated to take the
	instantiation vector into account.

svn path=/trunk/mcs/; revision=147852
2009-12-08 14:07:22 +00:00
Rodrigo Kumpera d76263e6ef 2009-12-08 Rodrigo Kumpera <[email protected]>
* ParameterInfo.cs: Add constructor that takes an array of ParameterInfo
	objects.

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

	* MethodOnTypeBuilderInst.cs: Change base_method type from MethodBuilder to
	MethodInfo.

svn path=/trunk/mcs/; revision=147850
2009-12-08 14:06:38 +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 bc35d6b8b1 2009-12-04 Rodrigo Kumpera <[email protected]>
* MethodBuilder.cs (MakeGenericMethod): Don't rely on the runtime to
	inflate a MethodBuilder. Create directly an instance of MethodOnTypeBuilderInst.

	* MethodOnTypeBuilderInst.cs (MakeGenericMethod): Cleanup this method and support
	inflating already inflated methods under compiler context.

svn path=/trunk/mcs/; revision=147668
2009-12-04 16:14:42 +00:00
Rodrigo Kumpera 1368f8e77d 2009-12-04 Rodrigo Kumpera <[email protected]>
* MethodOnTypeBuilderInst.cs: Change instantiation field type to System.Type.

	* MethodOnTypeBuilderInst.cs (MetadataToken): Explicitly throw if not under
	compiler context.

svn path=/trunk/mcs/; revision=147667
2009-12-04 16:14:24 +00:00
Rodrigo Kumpera 2a4965c5c7 2009-12-04 Rodrigo Kumpera <[email protected]>
* MethodOnTypeBuilderInst.cs: Rename mb to base_method to better reflect
	it's meaning. Introduce IsCompilerContext method and apply it's usage.

svn path=/trunk/mcs/; revision=147666
2009-12-04 16:14:06 +00:00
Marek Safar 2b16e5a55d 2009-11-16 Marek Safar <[email protected]>
* ILGenerator.cs, DynamicMethod.cs, MethodBuilder.cs,
	ConstructorBuilder.cs: Some 4.0 changes.


svn path=/trunk/mcs/; revision=146261
2009-11-16 14:42:40 +00:00
Sebastien Pouliot 0c1cacf8e0 In System.Reflection.Emit:
2009-10-30  Sebastien Pouliot  <[email protected]>

	* MethodBuilder.cs: Add missing 'names' validations in 
	DefineGenericParameters

In Test/System.Reflection.Emit:
2009-10-30  Sebastien Pouliot  <[email protected]>

	* MethodBuilderTest.cs: Add (copy from TypeBuilderTest) test 
	cases for two DefineGenericParameters


svn path=/trunk/mcs/; revision=145118
2009-10-30 20:12:20 +00:00
Sebastien Pouliot 1bcf41ee8e In System.Reflection.Emit:
2009-10-29  Sebastien Pouliot  <[email protected]>

	* ModuleBuilder.cs: Add missing 'className' validations in GetType
	* TypeBuilder.cs: Add missing 'names' validations in 
	DefineGenericParameters

In Test/System.Reflection.Emit:
2009-10-29  Sebastien Pouliot  <[email protected]>

	* ModuleBuilderTest.cs: Add test cases for GetType overloads
	* TypeBuilderTest.cs: Remove NotWorking from two DefineGenericParameters test case.


svn path=/trunk/mcs/; revision=145013
2009-10-29 12:51:36 +00:00