Draft
Conversation
0eb9fe0 to
ca16819
Compare
4a50a97 to
61fef76
Compare
76ec8dc to
b412ff9
Compare
SolalPirelli
added a commit
that referenced
this pull request
Feb 16, 2026
Prerequisite for #25165, extracting the stuff that touches the backend without actually being the optimizer, and cleaning up the overall architecture so it can be layered (this is especially important when adding back the optimizer so it's understandable...) I realize this PR is a little larger than is reasonable, sorry about that. Part of the point of the refactoring was that by following the code flow and simplifying it I got an understanding of how the JVM backend works... Main changes: - `BType` and its implementations are top-level now, no longer members of a module-like class - `CoreBTypes` is passed explicitly where needed - `BTypesFromSymbols` integrated into `CoreBTypesFromSymbols` (since its parent `BTypes` no longer exists) - `CoreBTypesFromSymbols` moved to its own file - `DottyBackendInterface` is an `object` only, the stateful stuff it did has been inlined where it was needed - (Most) classes now take their dependencies as constructor parameters, instead of "magically" importing what they need from `bTypes`/`int`/`postProcessor`. This makes dependencies explicit, and allowed me to remove some unneeded cycles in the object graph (especially in the next PR which is the optimizer) - `BackendReporting` moved to its own file - The `io` package no longer has a dependency on the `backend/jvm` package (!!!) - Cleanups of unnecessary parentheses etc. There's a lot of extra cleanup that could be done, and that I'd like to do once the optimizer is in, since we have many "utility" classes that could be either a single class or split in a way that makes sense (e.g., `AsmUtils` is currently just about... logging). From what I understand some of this dates back to the porting of the JVM backend to Dotty, which introduced "temporary" interfaces to the rest of the compiler. And more generally the overall state of the backend is spread across many classes that often touch what should be each other's internals (this is especially pronounced with the call graph, which will be added with the optimizer), and it's not easy to follow the data flow. But that's for later.
87b314c to
c84b017
Compare
…here the state they use is
…r primitive arrays
147bdae to
2eb3ae4
Compare
7463fa4 to
0906e90
Compare
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.
Fixes #22667
Depends on #25187Review commit by commit, the history has been heavily rewritten to facilitate that, individual commits mostly don't build. Commits until the tests are just porting stuff.
Noteworthy changes:
@FunctionalInterface, since it's just for inlining decisions it's OK if we are slightly off as long as reasonable cases behave reasonably