Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make many helpers, factories and tables static in Microsoft.CSharp #1

Open
arcontechnologies opened this issue Dec 29, 2018 · 0 comments

Comments

@arcontechnologies
Copy link
Owner

arcontechnologies commented Dec 29, 2018

the C# function doesn't bind to the other and thrown an error

Microsoft.CSharp has several objects that are heavily used throughout the library that have circular dependencies on each other, as well as several other classes depending on them. Use of them hence requires either a field in each object that will use them, or to follow chains of such fields. Prior to #25191 it was necessary for them to be instances so that they could be replaced with new versions. This no longer being necessary it's possible to make them all static.    At the same time, the related RuntimeBinder, ExpressionBinder and BindingContext classes are relatively heavy, mostly due to these dependencies. They are hence created once unless a cast must be attempted with a different BindingContext, and BindingContext's state is overwritten for each operation. Removing these dependencies makes these very light, allowing them to be readonly structs that are created for each operation.    * Have TypeArray in charge of the empty TypeArray singleton    * Make TypeArray allocation a static responsibility of TypeArray    * Remove some orphaned members.    Mostly BSYMMGR-returning members that had been used to allocate TypeArrays    * Make members static where possible.    Those that can already be easily made static. Includes removing some members that this makes no longer necessary.    * Remove unused parameters    Since some are of the types we'll be making static, and such parameters will have to go anyway.    * Make TypeTable static    And more conventional names within TypeTable.    * More TypeManager state & methods to static    * Make SYMTBL.Key an immutable struct.    * SYMTBL completely static and renamed to SymbolStore    More conventional name, and doesn't clash with other SymbolTable class.    * GetWinRTCollectionIfacesAll to property.    * SymFactory static class.    * Remove PredefinedTypes._symbolManager field    Only used in assertion.    * Remove assert comparison with this in GetAggregate    Assert is the only reason to not be static, allows a cascade of more changes to static.    * Make InternalsVisibleTo check static.    * Make cycle of instance methods static    Take quite a large set of methods which must be instance because of cyclic instance dependencies, and make them all static.    Removes dependency in AggregateSymbol and NullableType on TypeManager instances.    * Replace GetAggTypeSym with virtual method on CType.    Merged with existing GetAts on NullableType. Comment says this would be nice, and indeed it would, and its easy now.    * Make those members that can now be static, static.    * Remove orphaned members and fields.    * PredefinedMembers entirely static.    * Remove UserStringBuilder.m_buildingInProgress    Only used in asserts, just assert on whether m_strBuilder is null or not.    Also rename m_strBuilder to _strBuilder to be more conventional.    * Favour returning over out in UserStringBuilder    And favour clearing StringBuilder over creating another.    * Make ErrorHandling completely static.    Creating UserStringBuilder instances on demand.    * TypeManager static.    * Make CNullable methods static and merge directly into ExpressionBinder    Don't cache method and property, as they're already cached.    * Don't preload types.    Either they'll be loaded soon anyway, or else it's a wasted effort.    * Move CompareTypes into Better.cs    * Remove BSYMMGR.LookupAggMember    Just call into SymbolStore.LookupSym    * Move LookupNextSym logic into Symbol    * Remove BSYMMGR and GlobalSymbolContext    No longer any use.    * ExprFactory static    * SymbolLoader static    * CSemanticChecker static    * Don't pre-emptively load System.Object    Will be loaded as a base of the first type encountered anyway.    * SymbolTable static    * More methods can be made static    * Remove orphaned method.    * Move methods for getting MemberInfos from expressions into those expressions    * Replace ExpressionTreeCallRewriter.GetObject with virtual property in Expr    * TypeArray tidy-up.    * Pass ExpressionBinder to operator delegates, and make them static.    Allows array to be created once statically, rather than on each instance construction.    * Create RuntimeBinder, ExpressionBinder and BindingContext per operation    These are now very lightweight, so it's simpler to create them anew each time rather than overwriting the values in the BindingContext.    * Make RuntimeBinder, ExpressionBinder and BindingContext structs    No need to allocate on the heap.    * Remove AggregateDeclaration    We only ever care about the AggregateSymbol it relates to.    (The two aren't really separate in dynamic code, where there aren't really declarations).    * Remove IsChecked and CallingContext from C# binders.    Now not used as they are passed to RuntimeBinder on construction, except for CallingContext remaining in CSharpInvokeMemberBinder for use in deferring.    * Make RecordBinOpSigFromArgs static.    A last member that can be made static.    CC @VSadov @OmarTawfik

@arcontechnologies arcontechnologies changed the title ML issue due to GPU Make many helpers, factories and tables static in Microsoft.CSharp Dec 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant