Skip to content

[FeatureRequest]: Support edits to FieldRVAs in the runtime for EditAndContinue/etc. #112446

@phil-allen-msft

Description

@phil-allen-msft

With the merge of dotnet/roslyn#76036, there will be a much more common way to generate FieldRVA edits as part of HotReload as its anticipated that many of the strings to modify in a Razor project will be the content of the razor file (<tr><td>@someVar</td></tr> would be 2 literal strings; changing to divs would be new utf8 strings, which use FieldRVAs). Having those edits to FieldRVAs be supported at the runtime level means that EditAndContinue/HotReload of Razor, in the presence of utf8 strings, would work for customers.

Currently updating FieldRVA table is not supported. For this feature to work (and also other features that emit FieldRVA, such as UTF8 strings, initialized arrays, etc.) we need to be able to express FieldRVA updates in EnC delta metadata.

An RVA value is effectively an offset (relative virtual address) in the loaded PE image. As such it has no meaning in EnC delta metadata since the delta is not a PE Image.

However, we can reserve a block in the #Blob heap of the EnC metadata section and store the values there. A value of FieldRVA table field would then mean an offset within the blob heap.

When the runtime encounters FieldRVA table update in EnC delta it would copy the value from the delta #Blob heap to a runtime structure that it can later access when executing code that's loading the data.

UPDATE:

We can repurpose delta IL stream to store FieldRVA blobs. Method table in EnC delta already has a concept of RVA pointing to IL offset stream. FieldRVA would point to the IL stream as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions