-
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. It refactor the semantics analyzer to not rely on #isLocalVariable…
… message and use a dispatch to the variable instead: #analyzeRead:by: and analyzeWrite:by: The changes are based on recently introduced visit~ConcreteTypeOf~Variable: methods in AST visitors. Related to this idea several renames are introduced: #analyseEscapingRead: and #analyseEscapingWrite: are replaced by #analyzeLocalVariableRead: and #analyzeLocalVariableWrite: accordingly The driver for this refactoring is DoItVariable issue (recently fixed #8774) when it represents the external temp during a compilation. Compiler is trying to call some locals specific code during doIt compilation and it was failing because DoItVariable is not a local for newly compiled doIt methods. The Marcus fix introduced missing methods. But this PR allows to avoid it completely. 2. It optimizes how variables are represented in doIt expressions. The idea is that only variables which can't be used directly in doIts needs to be converted. And it is only local variables. Therefore Variable>>#asDoItVariable will returns self as default behaviour. And local variables will be converted to DoItVariable instances.
- Loading branch information
1 parent
93d6505
commit 65c21d3
Showing
7 changed files
with
106 additions
and
79 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Extension { #name : #Variable } | ||
|
||
{ #category : #'*OpalCompiler-Core' } | ||
Variable >> analyzeRead: aVariableNode by: aSemanticAnalyzer [ | ||
|
||
self isUninitialized ifTrue: [ aSemanticAnalyzer uninitializedVariable: aVariableNode ] | ||
] | ||
|
||
{ #category : #'*OpalCompiler-Core' } | ||
Variable >> analyzeWrite: aVariableNode by: aSemanticAnalyzer [ | ||
|
||
self isReservedVariable ifTrue: [ aSemanticAnalyzer storeIntoReservedVariable: aVariableNode ]. | ||
|
||
self isWritable ifFalse: [ aSemanticAnalyzer storeIntoReadOnlyVariable: aVariableNode ] | ||
] |
This file contains 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