Ctor-eval: Don't stop evaluating when an imported global isn't used#8168
Merged
stevenfontanella merged 4 commits intomainfrom Jan 12, 2026
Merged
Ctor-eval: Don't stop evaluating when an imported global isn't used#8168stevenfontanella merged 4 commits intomainfrom
stevenfontanella merged 4 commits intomainfrom
Conversation
084a2f8 to
15ed8c6
Compare
e1e16b8 to
ae1b333
Compare
15ed8c6 to
8b13110
Compare
stevenfontanella
added a commit
that referenced
this pull request
Jan 7, 2026
Add an ImportResolver interface with some implementations to handle the spec interpreter and ctor-eval * Removes coupling of imported names from the module they come from. This will allows us to provide special imports like the spec test module better which have some 'magic' e.g. for printing functions which can't be implemented in Wasm (globals remain the same because they still come from a real module which is better). * Removes pointer chasing logic when resolving imported globals in both cases. * Also allows us to relax ctor-eval and allow programs that import globals to be optimized more (as long as they don't try to evaluate imports) #8168 * Fixes #8167 * Part of #8180
8b13110 to
c136076
Compare
tlively
reviewed
Jan 12, 2026
tlively
approved these changes
Jan 12, 2026
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.
Resolves the TODO is global-get-init.wast. Previously if a global was imported it would stop us from evaluating almost anything. After this change, an imported global doesn't prevent us from optimizing as long as the global isn't referenced in the constructor that we're targeting.
Part of #8180.