Sre cleanup9 (#3661)
authorZoltan Varga <vargaz@gmail.com>
Fri, 30 Sep 2016 03:53:22 +0000 (23:53 -0400)
committerGitHub <noreply@github.com>
Fri, 30 Sep 2016 03:53:22 +0000 (23:53 -0400)
commita0ad8154f7cdca706802aa196d95686e0f8d3b7b
tree2f4bd97d6f3fc35ae80d74a3d616dfe8e352287b
parent2d86893ee60b50f40c5566841dba38ccaef3583c
Sre cleanup9 (#3661)

* [SRE] Assign pseudo tokens to SRE objects in the BCL instead of doing it in the runtime.

Real tokens are assigned after the dynamic types they depend on have been created, by creating the corresponding finished reflection object
(i.e. a MonoMethod for a MethodOnTypeBuilderInst etc.) and obtaining its token.
In Save mode, this is done in ModuleBuilder.Save ().
In Run mode, this is done on-demand when the JIT tries to resolve a token into its corresponding metadata object, by the runtime calling
the RuntimeResolve () method on the builder object.

* [SRE] Remove dead code.

* [SRE] Remove the MonoGenericMethod/MonoGenericCMethod classes, they have not needed.

* [SRE] Delay the creation of MonoClass-es for MonoGenericClass/GenericTypeParameterBuilder/SymbolType until its needed.

* [SRE] Small code cleanup.

* [SRE] Remove the TypeBuilder.IsGenericParameter () icall, it should return false.

* [SRE] Unify the calling of the various RuntimeResolve () methods by adding a RuntimeResolve () method to ModuleBuilder, and calling that from native code.

* [SRE] Remove unused TypeBuilder::get_event_info () icall.

* [SRE] Remove more unused/empty icalls.
26 files changed:
mcs/class/corlib/ReferenceSources/Type.cs
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/DerivedTypes.cs
mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
mcs/class/corlib/System.Reflection.Emit/FieldOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/GenericTypeParameterBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
mcs/class/corlib/System.Reflection/MonoGenericClass.cs
mcs/class/corlib/System.Reflection/MonoGenericMethod.cs [deleted file]
mcs/class/corlib/Test/System.Reflection.Emit/ModuleBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources
mcs/tools/linker/Descriptors/mscorlib.xml
mono/metadata/custom-attrs.c
mono/metadata/icall-def.h
mono/metadata/object-internals.h
mono/metadata/reflection.c
mono/metadata/sre-internals.h
mono/metadata/sre-save.c
mono/metadata/sre.c