AaronRobinsonMSFT / DNMD

Reimplementation of ECMA-335 metadata APIs
MIT License
16 stars 3 forks source link

Add support for the uncompressed stream, indirection tables, and minimal delta images #22

Closed jkoritzinsky closed 1 year ago

jkoritzinsky commented 1 year ago

This PR adds support for the #- metadata stream, recognizing minimal deltas, and resolving tokens through the "indirect" tables like FieldPtr. All of these features are non-standard ECMA extensions, but they can be produced and read by the native metadata APIs (and the minimal delta format can be produced by System.Reflection.Metadata).

As ilasm cannot produce the EnC diff images or images with the indirect tables, we manually construct a base image and minimal diff images with Roslyn and construct the "indirect" image with our baseline metadata API implementation.

Supporting these features has a few good use cases:

  1. Supporting minimal deltas will be required to implement IMetadataEmit::ApplyEditAndContinue.
  2. Supporting the indirection tables enables us to successfully read any valid .NET metadata image.
  3. The baseline implementations use the indirection tables to implement their "edit" scenarios efficiently, which DNMD might want to match. In that case, it's better to have support for the indirection tables before we start implementing the "edit" scenarios instead of after.

Same as #12. Had to re-fork the repository after the visibility change.