Skip to content

Conversation

@am11
Copy link
Member

@am11 am11 commented Jan 7, 2026

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
Contributor

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

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

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.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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