Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add a few EntityRegistry features in managed ilasm - #122957

#122957
Merged
jkoritzinsky merged 4 commits into
dotnet:maindotnet/runtime:mainfrom
am11:feature/managed-ilasmam11/runtime:feature/managed-ilasmCopy head branch name to clipboard
Jan 8, 2026
Merged

Add a few EntityRegistry features in managed ilasm#122957
jkoritzinsky merged 4 commits into
dotnet:maindotnet/runtime:mainfrom
am11:feature/managed-ilasmam11/runtime:feature/managed-ilasmCopy head branch name to clipboard

Conversation

@am11

@am11 am11 commented Jan 7, 2026

Copy link
Copy Markdown
Member

Implement several EntityRegistry.cs features for the C# ilasm replacement:

  • Add ClassLayout table emission: parse .pack and .size directives, emit AddTypeLayout for types with explicit packing or size

  • Add FieldLayout table emission: parse [offset] syntax on fields, emit AddFieldLayout for fields with explicit offsets

  • Add FieldRVA table emission: wire .data declarations to fields with 'at' syntax, emit AddFieldRelativeVirtualAddress

  • Implement GetPinnedType for pinned type signature encoding

  • Build full assembly-qualified names for type references with Version, Culture, and PublicKeyToken

  • Fix float32/float64 missing from VisitSimpleType switch

  • Fix core assembly resolution to match native ilasm: prefer System.Private.CoreLib, then System.Runtime, then mscorlib, then netstandard, with fallback to creating mscorlib reference. Also fix AssemblyRef table emission and dictionary key comparison.

  • Add tests for ClassLayout, FieldLayout, FieldRVA, and core assembly resolution functionality

Implement several EntityRegistry.cs features for the C# ilasm replacement:

- Add ClassLayout table emission: parse .pack and .size directives,
  emit AddTypeLayout for types with explicit packing or size

- Add FieldLayout table emission: parse [offset] syntax on fields,
  emit AddFieldLayout for fields with explicit offsets

- Add FieldRVA table emission: wire .data declarations to fields
  with 'at' syntax, emit AddFieldRelativeVirtualAddress

- Implement GetPinnedType for pinned type signature encoding

- Build full assembly-qualified names for type references with
  Version, Culture, and PublicKeyToken

- Fix float32/float64 missing from VisitSimpleType switch

- Fix core assembly resolution to match native ilasm: prefer
  System.Private.CoreLib, then System.Runtime, then mscorlib,
  then netstandard, with fallback to creating mscorlib reference.
  Also fix AssemblyRef table emission and dictionary key comparison.

- Add tests for ClassLayout, FieldLayout, FieldRVA, and core
  assembly resolution functionality
@am11 am11 added area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member labels Jan 7, 2026
@am11
am11 requested a review from jkoritzinsky January 7, 2026 02:11
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

@jkoritzinsky jkoritzinsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Just one question.

Comment thread src/tools/ilasm/src/ILAssembler/EntityRegistry.cs Outdated
@jkoritzinsky
jkoritzinsky merged commit d967910 into dotnet:main Jan 8, 2026
61 checks passed
@am11
am11 deleted the feature/managed-ilasm branch January 8, 2026 07:39
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.