Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert a few reflection FCalls to C##92512

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jkotas merged 5 commits intodotnet:mainfromjkotas:fcalls
Sep 23, 2023
Merged

Conversation

@jkotas
Copy link
Member

No description provided.

am11 reacted with heart emojijkoritzinsky, am11, PaulusParssinen, and hughbe reacted with rocket emoji
@ghost
Copy link

Tagging subscribers to this area: @dotnet/area-system-reflection
See info inarea-owners.md if you want to be subscribed.

Issue Details

null

Author:jkotas
Assignees:jkotas
Labels:

area-System.Reflection

Milestone:-

namespaceSystem
{
//
// This file contains methods on Type that are internal to the framework.
Copy link
MemberAuthor

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.

@Wraith2
Copy link
Contributor

The nameIsActualValueType seems strange. What is actual about a type which makes it not possible to useIsValueType and is there a way to make that distinction clearer?

@jkotas
Copy link
MemberAuthor

IsActualValueType matches the existingIsActualEnum name. The publicType.IsValueType andType.IsEnum properties have a questionable behavior for generic parameters: They return true for the generic parameters in some cases (#90993 (comment)). It is a behavior one pretty much never wants and it leads to bugs. Also, this quirk makes the API slower.

More self-descripting name would beIsValueTypeWithoutTheGenericParameterQuirk andIsEnumWithoutTheGenericParameterQuirk that is a mouthful. I am going to add better comment.

TypeHandleth=GetNativeTypeHandle();

boolisInterface=!th.IsTypeDesc&&th.AsMethodTable()->IsInterface;
GC.KeepAlive(this);
Copy link
Member

@EgorBoEgorBoSep 23, 2023
edited
Loading

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 foldtypeof(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

huoyaoyuan reacted with thumbs up emoji
Copy link
MemberAuthor

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.

@jkotasjkotas merged commitd45854c intodotnet:mainSep 23, 2023
@jkotasjkotas deleted the fcalls branchSeptember 23, 2023 18:09
@ghostghost locked asresolvedand limited conversation to collaboratorsOct 23, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@EgorBoEgorBoEgorBo approved these changes

@marek-safarmarek-safarAwaiting requested review from marek-safar

@MichalStrehovskyMichalStrehovskyAwaiting requested review from MichalStrehovskyMichalStrehovsky is a code owner

@stevehartersteveharterAwaiting requested review from steveharter

Assignees

@jkotasjkotas

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@jkotas@Wraith2@EgorBo

[8]ページ先頭

©2009-2025 Movatter.jp