-
Notifications
You must be signed in to change notification settings - Fork 7
186 compile blocks using druid #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I made some comments.
Generally speaking:
- some method names could be improved
- lots of commented code and halts around
@@ -69,7 +69,6 @@ DRBlockClosure >> executeOn: interpreter [ | |||
{ #category : 'interpreting' } | |||
DRBlockClosure >> generateCFG [ | |||
|
|||
self error: #ToImplement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D
DruidTestInterpreter >> simpleMethodWithBlockReadingOuterVariable [ | ||
|
||
| temp | | ||
temp:=0. | ||
self basicMethodWithBlock: [ |x|. | ||
temp:=x. | ||
x]. | ||
|
||
^ temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is not reading the outer variable, its writing on it...
DruidTestInterpreter >> simpleMethodWithBlock [ | ||
|
||
| temp | | ||
temp:=0. | ||
self basicMethodWithBlock: [ | x | | ||
x:=5. | ||
x]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is reading it
Druid/DRBytecodeGenerator.class.st
Outdated
vectorTempName := aDRLoadTemporaryVariable isTempVectorTemp | ||
ifTrue: [ self vectorTempName ] | ||
ifFalse: [ 'vector1' ]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is duplicated with the code in visitStoreTempVar:
Druid/DRControlFlowGraph.class.st
Outdated
|
||
^ self instructions select: [ :i | i isStoreTemporaryVariable ] | ||
^ self instructions select: [ :i | (i isStoreTemporaryVariable or: [i isLoadTemporaryVariable]) "and: [i isTempVectorTemp not]"]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code
"optimisations add: DRInline new. | ||
optimisations add: DRInline new." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code!
Druid/DRMethodIRGenerator.class.st
Outdated
|
||
aRBAssignmentNode variable binding originalVar isTempVectorTemp ifTrue: [ | ||
| result | | ||
"maybe should create DRStoreVectorTemporaryVariable ???" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes?
Otherwise, how do you differentiate normal stores?
Or for now all stores go to the temp vector?
withState: executionState. | ||
aRBVariableNode variable isEscaping ifFalse: [ "should use isCopying" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why should use bien isCopying
For now, all arguments and temporaries are all stored in temp Vector.
|
First attempt to compile block on DRUID:
To do:
Fix #186