-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Shuffle some MethodTable
flags
#85634
Conversation
* `IDynamicInterfaceCastableFlag` cannot be set on types that have a component size, so move it from the valuable location in `Flags` to `FlagsEx`. * Move `HasSealedVTableEntriesFlag` from rare flags to flags. This flag is not so rare. All async state machine types set it, for example. * Delete `IsAbstractClassFlag`. This was introduce in .NET Native for `GetUninitializedObject` since accessing `Type.IsAbstract` could trigger a `MissingMetadataException` there. We got rid of that concept in NativeAOT because it cannot be reconciled with ILLink trimming. Rewrite the code to use `Type.IsAbstract`. Saves 15 kB on BasicMinimalApis, which is nice. Also makes things faster since we avoid reading optional fields and rare flags.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue Details
Saves 15 kB on BasicMinimalApis, which is nice. Also makes things faster since we avoid reading optional fields and rare flags. Cc @dotnet/ilc-contrib
|
@@ -319,6 +319,11 @@ public static void PrepareDelegate(Delegate d) | |||
throw new NotSupportedException(SR.NotSupported_ManagedActivation); | |||
} |
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.
(Unrelated to this PR)
We are missing a check for function pointers here. Could you please fix it in a follow up?
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.
Activator.CreateInstance seems to be missing it too.
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 close to a computer now but I think Activator should be fine because there's no constructor to run and they're not a valuetype. I don't see it handling pointers either.
IDynamicInterfaceCastableFlag
cannot be set on types that have a component size, so move it from the valuable location inFlags
toFlagsEx
.HasSealedVTableEntriesFlag
from rare flags to flags. This flag is not so rare. All async state machine types set it, for example.IsAbstractClassFlag
. This was introduce in .NET Native forGetUninitializedObject
since accessingType.IsAbstract
could trigger aMissingMetadataException
there. We got rid of that concept in NativeAOT because it cannot be reconciled with ILLink trimming. Rewrite the code to useType.IsAbstract
.Saves 15 kB on BasicMinimalApis, which is nice. Also makes things faster since we avoid reading optional fields and rare flags.
Cc @dotnet/ilc-contrib