Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hxb] Add OFD and OBD chunks #11564

Merged
merged 3 commits into from Feb 8, 2024
Merged

[hxb] Add OFD and OBD chunks #11564

merged 3 commits into from Feb 8, 2024

Conversation

Simn
Copy link
Member

@Simn Simn commented Feb 8, 2024

We've come across a problem with the current way we handle anon fields and anons. Those are encoded on first use, which is convenient because in the general case anon fields might need type parameters from the local context. This works fine if the reader reads everything in order, but with delayed expression reading there can be the following situation:

  1. An anon is first seen, and thus written, inside an expression
  2. It is later seen in a different place, and written as a reference
  3. The reader delays the expression reading, and then comes across the reference place before the definition place

It would be good to have an isolated test case for this, but it's not very easy to find one because this only occurred in a substantial codebase and is affected by the intricacies of type loading.

With this PR we now distinguish between anon fields that require a local context and those that don't. The former are still written immediately, which should work fine because such abstracts cannot appear elsewhere anyway. The latter are stored in the OFD chunk which is then read separately, which should always work because no local context is required. By extension, this applies to anons and the OBD chunk.

@Simn Simn merged commit 30a0163 into development Feb 8, 2024
91 of 92 checks passed
@Simn Simn deleted the hxb_ofd branch February 8, 2024 12:28
@skial skial mentioned this pull request Feb 9, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant