[codegen] annotate member-access expressions with concrete class types#668
Merged
[codegen] annotate member-access expressions with concrete class types#668
Conversation
Contributor
Benchmark Results (Linux x86-64)
CLI Tool Benchmarks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
`obj.field` expressions where the object is a concrete class weren't cached in the typeOf map. Codegen live-resolved them every time.
After
Member-access expressions whose resolved type has `sourceKind === "class"` are annotated in the typeOf cache.
Description
Narrower relanding of the reverted #662. That PR also included `sourceKind === "interface"`, which caused x86-64-only Stage 0→Stage 1 self-hosting segfaults (passed on arm64, failed on x86-64 Linux CI and macOS CI). Root cause TBD — the class-dispatch path produces arch-divergent IR under `-O2` when an interface answer comes from the annotator cache instead of live-resolution.
Reproduced locally via `scripts/linux-x64.sh verify` (added in #667). Class-only filter passes full 3-stage bootstrap on both arm64 macOS and x86-64 Linux (via podman).
Verification
Refs #658. Interface-kind member_access annotation remains deferred pending x86-64 UB root-cause.