Enable R2R for unresolved static virtual interface calls - #131282
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Enable Crossgen2 (ReadyToRun JIT interface) to R2R-compile unresolved constrained static virtual interface calls that require an exact-context runtime lookup, instead of bailing out to runtime JIT.
Changes:
- Replace the
RequiresRuntimeJitExceptionforexactContextNeedsRuntimeLookupunresolved constrained SVM calls with aCORINFO_CALL_CODE_POINTER+ runtime lookup path. - Use
DictionaryEntryKind.ConstrainedMethodEntrySlotfor the runtime lookup and request an instantiating stub (suppress hidden instantiation argument at the callsite).
|
/azp run runtime-coreclr crossgen2 outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run runtime-coreclr crossgen2-composite gcstress |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@jkoritzinsky Have you validated what happens when a case where the structure doesn't implement the interface method, but it is implemented by a default implementation on the interface? |
|
In https://dev.azure.com/dnceng-public/public/_build/results?buildId=1524294&view=logs&jobId=c7387c70-b93d-5740-226d-f0ff8a1214f4 (from f16965a, the first commit in this PR), I ran all the src/tests tree under ReadyToRun, so that should be covered by the |
|
/ba-g failure is only in NAOT and this code is only in R2R |
Summary
Enable Crossgen2 to compile unresolved constrained static virtual interface calls that require a runtime lookup.
The lookup now:
CORINFO_CALL_CODE_POINTERso the computed runtime lookup is preservedConstrainedMethodEntrySlotwith the runtime-determined constraintThis allows
System.RuntimeType+IGenericCacheEntry<TCache>.CreateAndCacheto be emitted as R2R code instead of falling back to runtime JIT compilation.Fixes #120405
Testing
dotnet.cmd build src/coreclr/tools/aot/crossgen2/crossgen2.csproj -c Debug --no-restoreIGenericCacheEntry<ActivatorCache>.CreateAndCachein Crossgen2 single-method modeCreateandGetStorageRefuse constrained lookups againstvar #0, notSystem.__Canon, followed by indirect callsStaticVirtualMethodsloader suite successfullyNote
This pull request description was generated by GitHub Copilot.