Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-05-16[runtime] Handle circular references in SRE typesAlexander Kyte
We previously recursed through the entire directed cyclic graph of the type passed to SRE. When given a (legal) circular type reference, we encountered stack overflows. This was particularly easy to trigger with fsharpi and with FAKE. By creating everything about the type before searching for the parent, and by defering all type hierarchy establishment until the type must be surfaced to manage code, we tease out the data dependencies caught up in the cycle. Note the bounded lifetime of the unmanaged object hidden in the SRE module, which acts as a global reference for all types reachable from the TypeBuilder passed to the runtime through the icall.
2016-10-06[SRE] Fixup the tokens in subtypes too. (#3721)Zoltan Varga
2016-10-04[SRE] Delay the creation of the MonoClass for dynamic types until CreateType ↵Zoltan Varga
() is called. Remove some icalls. (#3687)
2016-09-30[SRE] Rename MonoGenericClass to TypeBuilderInstantiation to match MS. (#3679)Zoltan Varga
2016-09-30Sre cleanup9 (#3661)Zoltan Varga
* [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.
2016-09-03[SRE] Move the resolving of user types to managed code, the runtime was not ↵Zoltan Varga
using write barriers. (#3515)
2016-09-02[SRE] Remove empty TypeBuilder:setup_generic_class () icall.Zoltan Varga
2016-09-02[corlib] Fix the signature of a few SRE icalls, they already receive a ↵Zoltan Varga
TypeBuilder as the 'this' argument.
2016-08-26[sre] Remove TypeBuilder::create_internal_class () icall, it doesn't seem to ↵Zoltan Varga
be needed. (#3458)
2016-08-18[mcs] Replace NET_2_1 by MOBILELudovic Henry
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2015-10-21[reflection] ModuleBuilder, TypeBuilder escaped type identifiers patchAleksey Kliger
1. Use the System.TypeSpec parser to parse components of the type name, then call out to native code to apply the modifiers, as before. 2. TypeName and TypeIdentifier abstractions to hide display name / internal name strings Update ModuleBuilder and TypeBuilder to use TypeIdentifier and TypeName internally in all places that don't need to talk to native code. 3. Change ModuleBuilder.name_cache from Hashtable to Dictionary<TypeName, TypeBuilder>
2015-07-06[SRE] Added TypeBuilder.DefineNestedType overload.Marcos Henrich
2015-03-11[corlib] Type from reference sourcesMarek Safar
2015-02-27[corlib] Binder from reference sourcesMarek Safar
2015-01-14[bcl] Remove NET_4_5 defines from class libs.Zoltan Varga
2015-01-14[bcl] Remove NET_4_0 defines from class libs.Zoltan Varga
2014-08-19Removing excess line with debug Console.WriteLineAndrey Akinshin
2014-08-19[bcl] Add a missing check to TypeBuilder.CreateType (). Fixes #22059.Zoltan Varga
2014-06-03[corlib] Add CreateTypeInfo methodMarek Safar
2013-08-28Use IReflectType interface instead of TypeDelegator for introspection type ↵Marek Safar
extensions. Fixes #14168
2013-02-25Optimize parameters handling to do much less allocationMarek Safar
2012-11-07Remove SRE from Full AOT builds.Rodrigo Kumpera
2012-07-10Use a simpler design for IsUserType based on virtual calls.Rodrigo Kumpera
* 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.
2011-12-13Add all missing sequential layout directives to corlib and system.Rodrigo Kumpera
2011-11-06Get rid of IsCompilerContext, mcs no longer uses SRE.Zoltan Varga
2010-11-22Removed SetCharSetMarek Safar
2010-10-26Fix exception messageRodrigo Kumpera
2010-10-26Check for declaring type.Rodrigo Kumpera
* TypeBuilder.cs (GetField): Check if the declaring type matches the supplied type gtd. * TypeBuilderTest.cs: Add regression test. Fixes #649237
2010-10-22Checks the constructor declaring type.Rodrigo Kumpera
* TypeBuilder.cs (GetConstructor): Check if the ctor declaring type is the right one and the same as type. * TypeBuilderTest.cs: Add regression test. Fixes #648391
2010-09-15Fix monotouch bootstrap.Rodrigo Kumpera
* Type.cs (GetTypeCodeImpl): If the type is a TypeBuilder call into specific code. * TypeBuilder.cs (GetTypeCodeInternal): New method that handles enums correctly. This change is required because calling into the runtime with incomplete TypeBuilders cause the runtime to crash.
2010-08-31Fix corlib self referencing bug.Rodrigo Kumpera
In mcs/class/corlib/System.Reflection.Emit: * TypeBuilder.cs (DefineDefaultConstructor): If the resolved type is either typeof (object) or typeof (ValueType) we backout to the non resolved type as it might be one of the corlib's typebuilders. In mcs/mcs: * rootcontext.cs (CloseTypes): Only apply the enum hack for corlib here. * rootcontext.cs (EmitCode): Do the corlib basic type hack here before types are emitted. This is required since EmitType produce type initializers, which derive from ValueType and must be able to see the TypeBuilder version of it.
2010-05-19Fixes buildMarek Safar
svn path=/trunk/mcs/; revision=157516
2010-05-182010-05-18 Marek Safar <marek.safar@gmail.com>Marek Safar
* TypeBuilder.cs, PropertyBuilder.cs: Add DefineProperty overloads. svn path=/trunk/mcs/; revision=157510
2010-04-272010-04-27 Marek Safar <marek.safar@gmail.com>Marek Safar
* TypeBuilder.cs: StructLayoutAttribute ctor can be builder when compiling corlib. svn path=/trunk/mcs/; revision=156195
2010-04-202010-04-20 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* 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-102010-04-09 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* TypeBuilder.cs (IsValueTypeImpl): Don't depend on type_is_subtype_of icall. Fixes corlib compilation. svn path=/trunk/mcs/; revision=155172
2010-04-092010-04-08 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* Type.cs: Add ResolveInternal virtual call that resolves a given type to it's concrete type. 2010-04-08 Rodrigo Kumpera <rkumpera@novell.com> * MonoGenericClass.cs: Implement ResolveInternal. 2010-04-08 Rodrigo Kumpera <rkumpera@novell.com> * 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-082010-04-08 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* 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-012010-04-01 Zoltan Varga <vargaz@gmail.com>Zoltan Varga
* TypeBuilder.cs (GetField): Avoid a crash if this is called on a FieldOnTypeBuilderInst. Fixes #586944. svn path=/trunk/mcs/; revision=154580
2010-03-112010-03-11 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* 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
2009-12-152009-12-14 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
Type.cs (IsCompilerContext): The default implementation now checks if the type's assembly is under compiler context or not. 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com> * MonoGenericClass.cs: Remove IsByRef hack. 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com> * TypeBuilder.cs (GetConstructor/GetMethod): Fail with a NRE if method/ctor is null. 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com> * TypeTest.cs: Fix test that checked for old and wrong behavior of mono. svn path=/trunk/mcs/; revision=148433
2009-12-112009-12-10 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* 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 <rkumpera@novell.com> * 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-082009-12-08 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* Type.cs: Add virtual property IsCompilerContext to cleanup compiler context resolution across SRE. 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com> * MonoGenericClass.cs: Implement IsCompilerContext property and replace all checks to use it. 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com> * 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-10-29In System.Reflection.Emit:Sebastien Pouliot
2009-10-29 Sebastien Pouliot <sebastien@ximian.com> * 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 <sebastien@ximian.com> * 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-24In System.Reflection.Emit:Sebastien Pouliot
2009-10-24 Sebastien Pouliot <sebastien@ximian.com> * AssemblyBuilder.cs: For Silverlight only AssemblyBuilderAccess.Run is supported (browser-side) but we still allow other values when compiling (e.g. smcs) outside the browser (wo coreclr) * TypeBuilder.cs (GetConstructor): Fix validations In Test/System.Reflection.Emit: 2009-10-24 Sebastien Pouliot <sebastien@ximian.com> * TypeBuilderTest.cs: Validation test cases for GetConstructor svn path=/trunk/mcs/; revision=144791
2009-10-22NET_2_0 cleanupMarek Safar
svn path=/trunk/mcs/; revision=144618
2009-09-182009-09-18 Sebastien Pouliot <sebastien@ximian.com>Sebastien Pouliot
* AssemblyBuilder.cs, ConstructorBuilder.cs, MethodBuilder.cs, TypeBuilder.cs: Don't process PermissionSet under NET_2_1 svn path=/trunk/mcs/; revision=142222
2009-08-042009-08-03 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* 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 <rkumpera@novell.com> * 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-07-312009-07-30 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* TypeBuilder.cs (IsDefined): Throw if not created and not in compiler context. 2009-07-30 Rodrigo Kumpera <rkumpera@novell.com> * TypeBuilderTest: Test for IsDefined. svn path=/trunk/mcs/; revision=139142
2009-07-312009-07-30 Rodrigo Kumpera <rkumpera@novell.com>Rodrigo Kumpera
* TypeBuilder.cs (GetNestedTypes): Throw if not created and not in compiler context. svn path=/trunk/mcs/; revision=139137