Skip to content

Allow devirtualization of the cDAC ProcessedData getter - #136646

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:cdac-devirtualize-processed-data-getter
Oct 30, 2026
Merged

max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:cdac-devirtualize-processed-data-getter

Conversation

@max-charlamb

@max-charlamb max-charlamb commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Small cDAC performance change that matches the ProcessedData override's return type to the base property, allowing NativeAOT to devirtualize and inline the getter.

Binary size

Local Release NativeAOT win-x64 comparison using compiler version 10.0.13, with otherwise identical cDAC sources:

mscordaccore.dll Before After Reduction
File size 3,668,992 bytes 3,660,800 bytes 8,192 bytes (8 KiB)

Generated code

For example, Loader_1.GetModuleLookupMapBase shrinks from 129 to 114 bytes. The getter call site changes from virtual dispatch to a direct field load:

Before:

mov rcx, qword ptr [rbx]          ; Target
mov rax, qword ptr [rcx]
mov rax, qword ptr [rax + 0xf0]   ; virtual getter slot
call qword ptr [rip + 0x1eaed3]   ; _guard_dispatch_icall_nop
mov rbx, rax                    ; ProcessedData

After:

mov rcx, qword ptr [rbx]          ; Target
mov rbx, qword ptr [rcx + 0x38]   ; inlined ProcessedData getter

The subsequent generic GetOrAdd<T> call still uses virtual dispatch; this change devirtualizes the property getter.

Note

This PR description was generated with GitHub Copilot.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@max-charlamb
max-charlamb requested a review from rcj1 October 29, 2026 18:19
@max-charlamb
max-charlamb merged commit 2e9b1f6 into dotnet:main Oct 30, 2026
101 checks passed
@max-charlamb
max-charlamb deleted the cdac-devirtualize-processed-data-getter branch October 30, 2026 19:00
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants