Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 some more array FCalls to managed #102739
Convert some more array FCalls to managed #102739
Changes from 14 commits
566b15e
8a592b9
0dce3d4
d29e5d8
5dd0e3c
527021c
e7d843a
2bb5fe7
f7da172
0924555
dc85381
f99c553
c5e6cc4
470b86f
c7821e6
5225203
07293e3
5da88c3
5222bca
335b2fb
93ec9d8
c3f5097
481e4d4
a266a30
b8e4584
5465a97
4ce4f51
30b7d8f
8a9c5bc
f95fa34
ebfd224
d9205c6
7eef724
8cfb58f
fbb9d71
324df76
089ae12
a5e7441
5552d63
133cd8a
e17bf0e
dd1e2dd
32b8789
582eaf1
1836ae5
cb6aa00
49cf866
7a0c398
db677ad
353715e
8fb1c96
26d4c80
5f7263f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Can we use
sizeof(byte)
and corresponding primitives for this switch statement?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.
We are using such pattern in CoreLib. Sounds reasonable.
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.
Since
MethodTable::GetVerifierCorElementType
is FCall, there is not much value in duplicating TypeDesc::GetVerifierCorElementType() in C#. I would make FCall for the wholeTypeHandle::GetVerifierCorElementType
instead.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.
GetVerifierCorElementType() seems unused on managed side. Maybe just delete this FCall and keep implementation on native side (for jitinterface, arraynative etc.)?
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.
It's used for deciding primitive widen. Some other usages were refactored away, but
GetCorElementType
is using it.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.
Ah nvm, I was searching on main branch.
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.
Well, the remaining CorElementType usages are about primitive widen and fast path of
int[]
<->uint[]
conversion. It's only used for primitive-like types. In these cases,GetVerifierCorElementType
has unnecessary overhead, andEnum
has defined a custom FCall.It think the
GetVerifierCorElementType
FCall should be removed and share a new FCall for primitive-like types with Enum. Is it correct that aTypeHandle
can only be primitive when it'sMethodTable
and the primitive flag is set? Are (U)IntPtr always represented asMethodTable
with ELEMENT_TYPE_I/U?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.
Yes, that's correct.
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.
Well all of the usages of
GetCorElementTypeOfElementType
are in fact about primitive types. It can be refactored later.