Pass opaque method signature handle between JIT/CG2#47779
Merged
nattress merged 2 commits intodotnet:masterfrom Feb 4, 2021
Merged
Pass opaque method signature handle between JIT/CG2#47779nattress merged 2 commits intodotnet:masterfrom
nattress merged 2 commits intodotnet:masterfrom
Conversation
Contributor
Author
|
cc @dotnet/crossgen-contrib |
jkoritzinsky
reviewed
Feb 2, 2021
BruceForstall
suggested changes
Feb 3, 2021
Contributor
BruceForstall
left a comment
There was a problem hiding this comment.
LGTM.
I'll submit a PR to this branch with the SuperPMI side of the change. (You need to fix the merge conflict from my change to jiteeversionguid.h)
* Crossgen2 presently abuses the `CORINFO_SIG_INFO` pSig field to pass a handle representing a managed method signature object which the JIT passes back to us later in compilation. This field is for byte arrays and causes problems with SuperPMI which rightly doesn't know how to interpret a zero-length buffer whose pointer is set. * Introduce a new field ,`methodSignature` where we pass the handle back to the JIT. This pattern saves us from allocating and pinning a byte buffer for signatures, something the native code VM and Crossgen1 don't have to worry about. * Add strongly typed `ObjectToHandle` and `HandleToObject` methods for `CORINFO_MODULE_STRUCT_` <=> `MethodIL` and `MethodSignatureInfo` <=> `MethodSignature`.
e17f880 to
8e4da9e
Compare
76e3f7f to
0880c18
Compare
BruceForstall
approved these changes
Feb 3, 2021
trylek
reviewed
Feb 4, 2021
Member
trylek
left a comment
There was a problem hiding this comment.
The removed typecasts look great, thanks for the wonderful cleanup!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
CORINFO_SIG_INFO.pSigfield to pass a handle representing a managed method signature object which the JIT passes back to us later in compilation. This field is for byte arrays and causes problems with SuperPMI which rightly doesn't know how to interpret a zero-length buffer whose pointer is set.methodSignaturewhere we pass the handle back to the JIT. This pattern saves us from allocating and pinning a byte buffer for signatures, something the native code VM and Crossgen1 don't have to worry about.@BruceForstall This should simplify the hackery needed to make SuperPMI work with CG2