-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Pack bits in SourceOrdinaryMethodSymbol into an existing bitflag structure we have for all source methods #68158
Conversation
Draft until #68157 goes in. |
…cture we have for all source methods (dotnet#68132) * In progresS * Utilize * initialize once * Save space in other methods * reorder * reorder * Move down * Reorder * Simplify * Add docs * move up
ceb02c2
to
ce343a6
Compare
@AlekseyTs this is ready for review. |
@333fred as well for the updated change at the end. Original PR is the first commit, revision is hte second commit. |
@CyrusNajmabadi I think the title of the PR should be changed to the title of the original PR. |
And the description should probably be copied as well |
src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceCustomEventAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
Outdated
Show resolved
Hide resolved
@@ -285,7 +276,7 @@ protected override MethodSymbol FindExplicitlyImplementedMethod(BindingDiagnosti | |||
|
|||
protected override TypeSymbol ExplicitInterfaceType => _explicitInterfaceType; | |||
|
|||
protected override bool HasAnyBody => _hasAnyBody; | |||
protected override bool HasAnyBody => flags.HasAnyBody; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceOrdinaryMethodSymbolBase.cs
Outdated
Show resolved
Hide resolved
@@ -161,7 +156,7 @@ internal sealed override ImmutableArray<string> NotNullWhenFalseMembers | |||
// ReturnsVoid property is overridden in this class so | |||
// returnsVoid argument to MakeFlags is ignored. | |||
bool isExplicitInterfaceImplementation = property.IsExplicitInterfaceImplementation; | |||
this.MakeFlags(MethodKind.PropertyGet, declarationModifiers, returnsVoid: false, isExtensionMethod: false, isNullableAnalysisEnabled: isNullableAnalysisEnabled, | |||
this.MakeFlags(MethodKind.PropertyGet, declarationModifiers, returnsVoid: false, isExpressionBodied: true, isExtensionMethod: false, isNullableAnalysisEnabled: isNullableAnalysisEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to answer this. What would make it not ok?
Afaict, these values are not stored for this part of the inheritance tree at all. They are stored for:
But a SourcePropertyAccessorSymbol is not a SourceOrdinaryMethodSymbol... so it's ok to not initialize... because it's not state you seem to care about?
(genuinely not sure what is being asked here).
This is ready for anohte rpass :) |
src/Compilers/CSharp/Portable/Symbols/Source/SourceFieldLikeEventSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedPrimaryConstructor.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 30) |
src/Compilers/CSharp/Portable/Symbols/Source/SourceFieldLikeEventSymbol.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 34), modulo suggested comment adjustment.
@333fred @dotnet/roslyn-compiler could you take another look? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 36)
src/Compilers/CSharp/Portable/Symbols/Source/SourceConstructorSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourceConstructorSymbol.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 37)
@CyrusNajmabadi Please squash commits while merging. |
Yup yup! |
Drop 0.8% of memory from:
to