-
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
Convert a few reflection FCalls to C# #92512
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection Issue Detailsnull
|
namespace System | ||
{ | ||
// | ||
// This file contains methods on Type that are internal to the framework. |
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.
This historic split does not make sense anymore.
The name |
More self-descripting name would be |
TypeHandle th = GetNativeTypeHandle(); | ||
|
||
bool isInterface = !th.IsTypeDesc && th.AsMethodTable()->IsInterface; | ||
GC.KeepAlive(this); |
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.
I wonder if JIT is allowed to fold typeof(T).IsInterface
without intrinsics at all - the RuntimeType object is on the NonGC heap, GetNativeTypeHandle()
is basically MethodTable which is mostly immutable 🙂 so in theory jit could fold ->m_handle->field
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.
Yeah, it would be possible in theory. I am not sure whether it would make things simpler overall.
No description provided.