Cleanup OpalCompiler & CompilationContext#13423
Merged
MarcusDenker merged 8 commits intopharo-project:Pharo12from Apr 18, 2023
Merged
Cleanup OpalCompiler & CompilationContext#13423MarcusDenker merged 8 commits intopharo-project:Pharo12from
MarcusDenker merged 8 commits intopharo-project:Pharo12from
Conversation
78 tasks
Member
|
Sweet! I love that. |
Member
|
The formatter seems impacted by those changes: |
c74dce6 to
9c6ae3c
Compare
Contributor
Author
|
I rebased the PR to let plugins in place. For some reason is breaks FFI on the CI but not on my machine. Tests are now ok (beside #13446) |
jecisc
approved these changes
Apr 15, 2023
MarcusDenker
approved these changes
Apr 18, 2023
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.
In the OpalCompiler ecosystem, cohesion was very low and coupling very high.
In order to pass around information (and worse, store it is some escaping objects like AST) between the various components, a god-dataclass (two smells in one!) called CompilationContext was used.
After a few weeks of intense cleaning, the cohesion is higher and coupling lower, and some data stored in CompilationContext is now used by only a single class: OpalCompiler. Therefore, the present PR move this data to the class that has the responsibility to use them.
Beside the increase of code quality, this has the advantage of reducing the memory footprint caused by escaping CompilationContext. (maybe it's not that much, it's hard to quantify).
What remain (for the moment) in CompilationContext are:
noPattern