Skip to content

Conversation

tmat
Copy link
Member

@tmat tmat commented Apr 7, 2025

As discussed on dotnet/runtime#112446, we append the field data to the IL stream and use existing RVA offset interpretation, except relative to the start of the IL stream.

Adds a new EnC capability AddFieldRva. If this capability is returned from the runtime the IDE instructs the compiler to use FieldRVA table to emit array initializers, stackalloc initializers, UTF8 strings and other features that rely on FieldRVA data in regular (non-EnC) emit.

Allow Hot Reload to emit string literals when the limit on #UserString heap is reached.

Moves emit of data section string literals down to ILBuilder, so that we can handle

  1. all string literals, not just those appearing in expressions
  2. heap overflow in EnC by tracking heap capacity.

Fixes #69480
Implements #78035
Depends on dotnet/runtime#112446

@ghost ghost added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 7, 2025
@dotnet-policy-service dotnet-policy-service bot added VSCode Needs API Review Needs to be reviewed by the API review council labels Apr 7, 2025
@tmat tmat marked this pull request as ready for review April 9, 2025 03:12
@tmat tmat requested review from a team as code owners April 9, 2025 03:12
@tmat
Copy link
Member Author

tmat commented Apr 9, 2025

@dotnet/roslyn-compiler @cston @jjonescz ptal
@DustinCampbell fyi

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Looks like this'll need API review?

@tmat tmat force-pushed the EncFieldRva branch 2 times, most recently from 037e0a2 to dc5239d Compare April 17, 2025 23:17
@tmat tmat force-pushed the EncFieldRva branch 3 times, most recently from fc50175 to 99aa804 Compare May 2, 2025 00:52
@jaredpar jaredpar requested a review from cston May 7, 2025 15:29
@jaredpar
Copy link
Member

jaredpar commented May 7, 2025

@cston PTAL

@tmat tmat enabled auto-merge (squash) May 9, 2025 02:26
@tmat tmat merged commit 7c62502 into dotnet:main May 10, 2025
27 of 28 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 10, 2025
@tmat tmat deleted the EncFieldRva branch May 11, 2025 15:31
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interactive Feature - String Literals in Data Section as UTF8 Needs API Review Needs to be reviewed by the API review council untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EnC: Emit array and UTF8 literals using FieldRva
6 participants