Skip to content

Display method variants in R2RDump#124010

Merged
jtschuster merged 7 commits intodotnet:mainfrom
jtschuster:feature/async-r2r-modifiers
Feb 6, 2026
Merged

Display method variants in R2RDump#124010
jtschuster merged 7 commits intodotnet:mainfrom
jtschuster:feature/async-r2r-modifiers

Conversation

@jtschuster
Copy link
Member

Adds signature prefixes to method signatures in R2RDump to differentiate task-returning, async, and (not yet implemented) async resumption stubs in the method entrypoint table dump.

Implements change dotnet#8 from async methods R2R breakdown.

Improves diagnostic tooling by showing async method modifiers in r2rdump output.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the ReadyToRun reflection tooling so that method signatures used by R2RDump can be annotated with prefixes that distinguish async-related variants (and other stub kinds), and ensures PGO keys stay consistent with the displayed signatures.

Changes:

  • Extend ReadyToRunMethod and PgoInfoKey to carry and incorporate SignaturePrefixes into their computed signature strings.
  • In ReadyToRunReader, decode ReadyToRunMethodSigFlags for instance entrypoints and PGO instrumentation records, build corresponding signature prefixes (currently for AsyncVariant), and thread them into ReadyToRunMethod and PgoInfoKey.
  • Add explicit NotImplementedException throws when encountering InstantiatingStub or UnboxingStub method signature flags in instance entrypoints or PGO data.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs Parses method signature flags for instance entrypoints and PGO methods, derives [Async] prefixes, wires signaturePrefixes through to ReadyToRunMethod and PgoInfoKey, and adds NotImplementedException for instantiating/unboxing stub flags.
src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs Adds a SignaturePrefixes property and updates the constructor to accept prefixes and prepend them to the human-readable SignatureString used by R2RDump.
src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs Extends PGO keys to include signaturePrefixes in their SignatureString, and updates FromReadyToRunMethod to construct keys consistent with ReadyToRunMethod.SignatureString.

@jtschuster jtschuster changed the title Add ResumptionStub signature flag and display variants in R2RDump Display method variants in R2RDump Feb 4, 2026
@jtschuster jtschuster requested review from agocke and jkotas February 6, 2026 00:59
Copilot AI review requested due to automatic review settings February 6, 2026 19:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs:40

  • PgoInfoKey is public and the constructor signature change adds a required signaturePrefixes parameter. Since this assembly is packable, consider keeping the old constructor as an overload (or make signaturePrefixes optional) to avoid unnecessarily breaking external source consumers.
        public PgoInfoKey(IAssemblyMetadata componentReader, string owningType, EntityHandle methodHandle, string[] instanceArgs, string[] signaturePrefixes)
        {
            ComponentReader = componentReader;
            EntityHandle owningTypeHandle;
            DisassemblingGenericContext genericContext = new DisassemblingGenericContext(typeParameters: Array.Empty<string>(), methodParameters: instanceArgs);

lewing pushed a commit to lewing/runtime that referenced this pull request Feb 9, 2026
Adds signature prefixes to method signatures in R2RDump to differentiate
task-returning, async, and (not yet implemented) async resumption stubs
in the method entrypoint table dump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-R2RDump-coreclr Ready-to-run image dump tool

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants