This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Repository navigation
Fix generic context passed to resolved constrained method calls - #13577
Merged
MichalStrehovsky merged 2 commits intoAug 25, 2017
Merged
Conversation
If the EE was able to resolve a constrained call, the instantiating parameter to use is the type by which the call was constrained with. We embed pConstrainedResolvedToken as the extra argument because pResolvedToken is an interface method and interface types make a poor generic context. The CLR doesn't hit this path because these types of constrained method calls go through an instantiating stub. We don't do instantiating stubs in CoreRT.
Member
Author
|
@dotnet/jit-contrib PTAL |
|
@dotnet-bot test Tizen armel Cross Debug Build |
|
@dotnet-bot test Windows_NT Release pri1r2r |
|
Looks good to me. |
MichalStrehovsky
added a commit
to MichalStrehovsky/corert
that referenced
this pull request
Aug 28, 2017
Picks up: * dotnet/coreclr#13561 * dotnet/coreclr#13577
MichalStrehovsky
added a commit
to dotnet/corert
that referenced
this pull request
Aug 28, 2017
Picks up: * dotnet/coreclr#13561 * dotnet/coreclr#13577 Fixes #3608.
MichalStrehovsky
added a commit
to MichalStrehovsky/runtimelab
that referenced
this pull request
Aug 17, 2021
* We weren't able to get a usable generic context to the method being invoked. * Undoes dotnet/coreclr#13577 that was papering over the issue, fixing this for non-generic methods, but leaving generic methods unfixed. * The fix is similar to how CoreCLR handles this - on CoreCLR, we call a helper, get an instantiation thunk back, and invoke that. * Since we don't have instantiation thunks in NativeAOT, we ask for a fat function pointer and perform a fat call. * This is a bit less efficient than what we had in NativeAOT before this change (generic lookup for the context, and a direct call). We wouldn't be able to express the correct generic lookup sequence without a JitInterface change. What we get with this pull request is probably good enough. Fixes dotnet#1357. Fixes dotnet/corert#3608 (which is the same issue, but in CoreRT repo)
MichalStrehovsky
added a commit
to dotnet/runtimelab
that referenced
this pull request
Aug 18, 2021
* We weren't able to get a usable generic context to the method being invoked. * Undoes dotnet/coreclr#13577 that was papering over the issue, fixing this for non-generic methods, but leaving generic methods unfixed. * The fix is similar to how CoreCLR handles this - on CoreCLR, we call a helper, get an instantiation thunk back, and invoke that. * Since we don't have instantiation thunks in NativeAOT, we ask for a fat function pointer and perform a fat call. * This is a bit less efficient than what we had in NativeAOT before this change (generic lookup for the context, and a direct call). We wouldn't be able to express the correct generic lookup sequence without a JitInterface change. What we get with this pull request is probably good enough. Fixes #1357. Fixes dotnet/corert#3608 (which is the same issue, but in CoreRT repo)
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.
If the EE was able to resolve a constrained call, the instantiating
parameter to use is the type by which the call was constrained with. We
embed pConstrainedResolvedToken as the extra argument because
pResolvedToken is an interface method and interface types make a poor
generic context.
The CLR doesn't hit this path because these types of constrained method
calls go through an instantiating stub. We don't do instantiating stubs
in CoreRT.
Contributes to fixing dotnet/corert#3608 (we'll need to clean up a couple workarounds).