Skip to content

Commit

Permalink
- move setting the compiledMethod to #parseTree
Browse files Browse the repository at this point in the history
- remove bcToASTCache
  • Loading branch information
MarcusDenker committed Jun 25, 2020
1 parent 4c60a3d commit 7aae0e4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/AST-Core/ASTCacheMissStrategy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ Class {

{ #category : #accessing }
ASTCacheMissStrategy >> getASTFor: aCompiledMethod [
| ast |
ast := aCompiledMethod parseTree doSemanticAnalysisIn: aCompiledMethod methodClass.
ast compilationContext compiledMethod: aCompiledMethod.
^ast
^ aCompiledMethod parseTree doSemanticAnalysisIn: aCompiledMethod methodClass
]
7 changes: 5 additions & 2 deletions src/AST-Core/CompiledMethod.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ CompiledMethod >> firstComment [
{ #category : #'*AST-Core' }
CompiledMethod >> parseTree [
"returns an AST for this method, do not cache it. (see #ast for the cached alternative)"
^self methodClass compiler
| ast |
ast := self methodClass compiler
source: self sourceCode;
failBlock: [^ self decompile ];
parse
parse.
ast compilationContext compiledMethod: self.
^ast
]
1 change: 0 additions & 1 deletion src/OpalCompiler-Core/RBMethodNode.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ RBMethodNode >> generate: trailer [
{ #category : #'*OpalCompiler-Core' }
RBMethodNode >> generateIR [
| ir |
bcToASTCache := nil.
scope ifNil: [self doSemanticAnalysis].
ir := (self compilationContext astTranslatorClass new
visitNode: self)
Expand Down
10 changes: 3 additions & 7 deletions src/Reflectivity/RFReflectivityASTCacheStrategy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ Class {

{ #category : #accessing }
RFReflectivityASTCacheStrategy >> getASTFor: aCompiledMethod [
| ast |
ast := aCompiledMethod reflectiveMethod
^ aCompiledMethod reflectiveMethod
ifNil: [ aCompiledMethod parseTree
doSemanticAnalysisIn: aCompiledMethod methodClass.
]
ifNotNil: [ :rfMethod | rfMethod ast ].
ast compilationContext compiledMethod: aCompiledMethod.
^ast
doSemanticAnalysisIn: aCompiledMethod methodClass ]
ifNotNil: [ :rfMethod | rfMethod ast ]
]

0 comments on commit 7aae0e4

Please sign in to comment.