Repository navigation
[cDAC] Implement DacDbiImpl.ResolveTypeReference - #129958
Conversation
Co-authored-by: rcj1 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Implements cDAC-side support for DacDbiImpl.ResolveTypeReference by resolving mdTypeRef tokens to mdTypeDef tokens using ECMA-335 metadata (with support for AssemblyRef scopes, exported-type forwarders, and nested types), and adds unit tests covering several resolution scenarios.
Changes:
- Implement
DacDbiImpl.ResolveTypeReferencein the managed cDAC implementation (replacingE_NOTIMPL/ legacy fallback behavior). - Add unit tests that construct in-memory metadata graphs to validate AssemblyRef, type-forwarder, and nested-type resolution.
- Extend
EcmaMetadataUtils.TokenTypewithmdtAssemblyRefto support lookup-map token construction.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Adds managed implementation for ResolveTypeReference, including metadata-based scope/name walking and forwarder/nested-type resolution helpers. |
| src/native/managed/cdac/tests/UnitTests/DacDbiImplTests.cs | Adds new unit tests and metadata-builder helpers to validate the new resolution logic across several scenarios. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/EcmaMetadataUtils.cs | Adds mdtAssemblyRef token type constant used by the resolver logic and tests. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 3
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
@copilot please fix the unit tests |
Fixed in 7e9e2f1. The Note This response was AI-generated by Copilot. |
This comment has been minimized.
This comment has been minimized.
|
@copilot please fix the unit tests and build to confirm. |
Done in c6b1f1a. Built and confirmed all 248 DacDbiImpl tests pass (20 ResolveTypeReference). Also gated exported-type follow on Note This response was AI-generated by Copilot. |
…ereference-implementation
2bf53e7 to
557ad42
Compare
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot Code ReviewHolistic AssessmentMotivation: The PR ports Approach: The implementation correctly prioritizes the cached TypeRef→MethodTable lookup (fast path), then falls back to metadata-based resolution with type-forwarder chain following. The approach is appropriate. Summary: Detailed FindingsDetailed Findings
|
davidwrighton
left a comment
There was a problem hiding this comment.
The type resolution algorithm appears correct to me.
noahfalk
left a comment
There was a problem hiding this comment.
This looks reasonable to me but happy to defer to David who has more expertise in this part of the runtime behavior.
Port native ResolveTypeReference to cDAC, using metadata instead of the various DAC hash structures to resolve types in different assemblies by name. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Port native ResolveTypeReference to cDAC, using metadata instead of the various DAC hash structures to resolve types in different assemblies by name.