-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Crossgen2 support for static virtual method resolution (take 2) #87438
Merged
Commits on Aug 8, 2023
-
WIP: Crossgen2 support for static virtual method resolution
This is my initial attempt at porting the CoreCLR runtime code for SVM resolution to Crossgen2. The TypeHierarchyTest now fails at 66-th scenario. The biggest problems I'm hitting are around making sure that we drop the constraint from the actual entrypoint import cells, otherwise we end up with constructs like BaseScenario61.Method() @ DerivedScenario61 and that crashes the runtime. I guess that my treatment of generics is most likely still incorrect. Thanks Tomas Address initial David's PR feedback I'm adding this as a separate commit as it's basically just a projection of David's PR suggestions without additional algorithmic changes. I'll follow up with additional fixes for the remaining test failures. Thanks Tomas Address remaining David's PR feedback Use existing virtual method algorithms per Michal's PR feedback I have removed the previously added special virtual method algorithm for static virtual method resolution and instead I added logic for SVM resolution to the existing methods ResolveInterfaceMethodToVirtualMethodOnType and ResolveVariantInterfaceMethodToVirtualMethodOnType I haven't made any functional changes in this commit. Thanks Tomas Remove the superfluous interfaceType parameter from DevirtualizationManager Address additional Michal's and David's feedback; all tests pass Several JIT interface fixes for static virtual methods Don't drop constrained type for SVMs unresolved at compile time With this change, more tests seem to be passing but there seems to be a runtime problem ending up as an assertion: for instance, in TypeHierarchyTests, Scenario 25, TryResolveConstraintMethodApprox resolves the constrained call to BaseScenario25<Func<String>>.Method() which subsequently gets wrapped into an instantiating stub and later crashes GC ref map check which seems to compare the GC ref map of the wrapped method with the original import cell for the constrained method. These naturally don't match as the wrapped canonical method requires the method dictionary argument. I continue investigating this but any insight into what exactly needs fixing here would be more than welcome. Thanks Tomas Use instantiating stubs for unresolved SVM import cells Simplify the change by applying David's suggestion to not JIT unresolved SVM callers Remove no longer used method AllowCompileTimeStaticVirtualMethodResolution
Configuration menu - View commit details
-
Copy full SHA for 0e68a2f - Browse repository at this point
Copy the full SHA 0e68a2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c69fcf - Browse repository at this point
Copy the full SHA 8c69fcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8513e6b - Browse repository at this point
Copy the full SHA 8513e6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 475c190 - Browse repository at this point
Copy the full SHA 475c190View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fee598 - Browse repository at this point
Copy the full SHA 9fee598View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8940fd1 - Browse repository at this point
Copy the full SHA 8940fd1View commit details -
Fix two Crossgen2 codegen bugs found via SVM testing
1. Delegate cctor helper JIT interface method was missing support for type constraint. 2. Methods wrapped in instantiation / unboxing stubs shouldn't claim they have a generic dictionary slot in their GC refmap. Thanks Tomas
Configuration menu - View commit details
-
Copy full SHA for af42831 - Browse repository at this point
Copy the full SHA af42831View commit details -
Configuration menu - View commit details
-
Copy full SHA for a6785a4 - Browse repository at this point
Copy the full SHA a6785a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc60009 - Browse repository at this point
Copy the full SHA bc60009View commit details -
Configuration menu - View commit details
-
Copy full SHA for c75a1b0 - Browse repository at this point
Copy the full SHA c75a1b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1d0603 - Browse repository at this point
Copy the full SHA c1d0603View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0916bfc - Browse repository at this point
Copy the full SHA 0916bfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 168908f - Browse repository at this point
Copy the full SHA 168908fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad44935 - Browse repository at this point
Copy the full SHA ad44935View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bad02e - Browse repository at this point
Copy the full SHA 5bad02eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ddc43c - Browse repository at this point
Copy the full SHA 5ddc43cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f5f530c - Browse repository at this point
Copy the full SHA f5f530cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56754ea - Browse repository at this point
Copy the full SHA 56754eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d642c6 - Browse repository at this point
Copy the full SHA 8d642c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 26dd5cf - Browse repository at this point
Copy the full SHA 26dd5cfView commit details -
Address David Wrighton's PR feedback
* Added stricter check to delegate constructor * Disabled MethodBodyOnUnrelatedType test in Crossgen2 mode * Reverted change to virtual method resolver Thanks Tomas
Configuration menu - View commit details
-
Copy full SHA for 1374c32 - Browse repository at this point
Copy the full SHA 1374c32View commit details
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.