Use common helper to decide runtime lookups for code pointers#129560
Use common helper to decide runtime lookups for code pointers#129560MichalStrehovsky wants to merge 1 commit into
Conversation
Instead of always using R2R helper, decide the appropriate lookup strategy with the shared helper.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR updates NativeAOT’s RyuJIT interface to compute method code-pointer runtime lookups using the shared ComputeLookup helper, rather than always forcing a ReadyToRun helper-based generic lookup. This aligns the MethodEntry lookup path with other callsite lookup paths that already use ComputeLookup.
Changes:
- Replace manual
CORINFO_LOOKUPinitialization for fat-function-pointer method entry lookups with a single call toComputeLookup. - Centralize the choice of lookup strategy (constant vs runtime lookup; helper vs fixed indirections/null) under the shared lookup computation logic.
Copilot Code ReviewHolistic AssessmentMotivation: The change eliminates duplicated inline runtime-lookup setup code in favor of the existing Approach: Correct approach. The replaced block at line ~1457 (fat function pointer + Summary: ✅ LGTM. Small, focused refactoring that replaces hardcoded R2R-helper-only logic with the shared Detailed FindingsDetailed Findings✅ Correctness — Behavioral equivalence verifiedThe old code always forced the R2R helper path:
The ✅ Consistency — Matches established patternAll other runtime-lookup call sites in
The changed block now matches these exactly. 💡 Cross-cutting observation — Other inline lookup sitesTwo other call sites in the same file still use the inline Note This review was created by GitHub Copilot.
|
Instead of always using R2R helper, decide the appropriate lookup strategy with the shared helper.