Skip to content
Draft
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ Class {
BaselineOfDebuggableASTInterpreter >> baseline: spec [

<baseline>
spec for: #common do: [
spec for: #common do: [ "Dependencies""Groups"
spec
baseline: 'Ghost'
with: [ spec repository: 'gitlab://gitlab.inria.fr:RMOD/Ghost' ].

"Packages"
spec
package: 'DebuggableASTInterpreter';
package: 'DebuggableASTDebugger' with: [
spec requires: #( 'DebuggableASTInterpreter' ) ] ].
package: 'DebuggableASTDebugger'
with: [ spec requires: #( 'DebuggableASTInterpreter' ) ];
package: 'DebuggableASTInterpreterOverlays'
with: [ spec requires: #( 'DebuggableASTDebugger'
'Ghost' ) ] ].

"Groups"
spec
group: 'default' with: #( 'Model' );
group: 'Model' with: #( 'DebuggableASTInterpreter' );
group: 'Debugger' with: #( 'DebuggableASTDebugger' )
group: 'Debugger' with: #( 'DebuggableASTDebugger' );
group: 'Overlay' with: #( 'DebuggableASTInterpreterOverlays' )
]
2 changes: 1 addition & 1 deletion DebuggableASTInterpreter/DASTContext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -768,5 +768,5 @@ DASTContext >> write: value toInstVarNamed: name [
| index |
index := ((self evaluator classOf: self receiver) allInstVarNames indexOf: name).
(index = 0) ifTrue: [ InstanceVariableNotFound signalFor: name asString ].
self receiver instanceVariableAtIndex: index put: value
self receiver instVarAt: index put: value
]
14 changes: 12 additions & 2 deletions DebuggableASTInterpreter/DASTInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,19 @@ DASTInterpreter >> visitLiteralValueNode: aRBLiteralValueNode [
]

{ #category : #visiting }
DASTInterpreter >> visitLiteralVariableNode: aRBVariableNode [

^ self visitGlobalNode: aRBVariableNode
DASTInterpreter >> visitLiteralVariableNode: aNode [
"to be backward compatible, we visit for Gloabls here (there used to be no difference)"

^ self visitGlobalNode: aNode
]

{ #category : #visiting }
DASTInterpreter >> visitLocalVariableNode: aNode [

"call visitTemporaryNode: for backward compatibility"

^ self visitTemporaryNode: aNode
]

{ #category : #visiting }
Expand Down
17 changes: 13 additions & 4 deletions DebuggableASTInterpreter/DASTPostOrderTreeVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DASTPostOrderTreeVisitor >> visitArgumentNode: aRBArgumentNode [
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitArgumentVariableNode: aRBVariableNode [
DASTPostOrderTreeVisitor >> visitArgumentVariableNode: aRBVariableNode [

^ self visitTemporaryNode: aRBVariableNode
]
Expand Down Expand Up @@ -108,9 +108,18 @@ DASTPostOrderTreeVisitor >> visitLiteralValueNode: aRBLiteralValueNode [
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitLiteralVariableNode: aRBVariableNode [
DASTPostOrderTreeVisitor >> visitLiteralVariableNode: aNode [
"to be backward compatible, we visit for Gloabls here (there used to be no difference)"

^ self visitGlobalNode: aRBVariableNode
^ self visitGlobalNode: aNode
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitLocalVariableNode: aNode [

"call visitTemporaryNode: for backward compatibility"

^ self visitTemporaryNode: aNode
]

{ #category : #visiting }
Expand Down Expand Up @@ -157,7 +166,7 @@ DASTPostOrderTreeVisitor >> visitSuperNode: aRBSuperNode [
^ stack push: aRBSuperNode
]

{ #category : #'as yet unclassified' }
{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitTemporaryNode: aRBTemporaryNode [
stack push: aRBTemporaryNode
]
Expand Down
6 changes: 4 additions & 2 deletions DebuggableASTInterpreter/DASTSystemEnvironment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ DASTSystemEnvironment >> assignClassVariable: name inObject: anObject value: val

{ #category : #'variables-instance' }
DASTSystemEnvironment >> assignInstanceVariable: name inObject: anObject value: value [
(anObject class allInstVarNames includes: name)
ifTrue: [ anObject instVarNamed: name put: value . ^ true].

(anObject class allInstVarNames includes: name) ifTrue: [
interpreter write: value toInstVarNamed: name.
^ true ].
^ false
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ DASTOverlayInterpreter >> overlayCounter [
{ #category : #visiting }
DASTOverlayInterpreter >> overlayFor: anObject [
^ self objectStateOverlay
at: self receiver
ifAbsentPut: [ ObjectOverlay on: self receiver ]
at: anObject
ifAbsentPut: [ ObjectOverlay on: anObject ]
]

{ #category : #visiting }
Expand All @@ -44,9 +44,8 @@ DASTOverlayInterpreter >> overlaysForPC [

{ #category : #visiting }
DASTOverlayInterpreter >> readInstanceVariableNamed: name [
^ (self overlayFor: self receiver)
readInstanceVariableNamed: name
ifAbsent: [ ^ super readInstanceVariableNamed: name ]

^ self readInstanceVariableNamed: name for: self receiver
]

{ #category : #visiting }
Expand Down