[VM][Simulator] InterpreterSimulator broken?
Stephan Rudlof
sr at evolgo.de
Wed Dec 5 14:53:50 UTC 2001
Dear Squeakers,
I have problems with the InterpreterSimulator. The
InterpreterSimulator>>testBecome hasn't been successful yet.
#become:with:twoWay: works for the created arrays, but *not* for the values
on the stack.
I have played with a modified VM, but since it doesn't work, I have tried
the simulator. After faced with the problem described here with my modified
VM I tried the normal one, but there is the same problem :-((
I'd like to know, which are my and which are other errors...
Does InterpreterSimulator>>testBecome work for somebody?
Does anybody know this problem?
Greetings,
Stephan
Look for "!!!" below: all values on the stack haven't been affected by the
#become:with:twoWay: operation there (before the #popStack in this line).
Same result as with Squeak3.2alpha#4567 as with (last) Squeak3.1beta#4478.
InterpreterSimulator>>
testBecome
"Become some young things. AA testBecome "
| array list1 list2 p1 p2 p3 p4 |
array _ self splObj: ClassArray.
list1 _ self instantiateClass: array indexableSize: 2.
list2 _ self instantiateClass: array indexableSize: 2.
p1 _ self instantiateClass: (self splObj: ClassPoint) indexableSize: 0.
self push: p1.
self storePointer: 0 ofObject: list1 withValue: p1.
p2 _ self instantiateClass: (self splObj: ClassPoint) indexableSize: 0.
self push: p2.
self storePointer: 1 ofObject: list1 withValue: p2.
p3 _ self instantiateClass: (self splObj: ClassMessage) indexableSize: 0.
self push: p3.
self storePointer: 0 ofObject: list2 withValue: p3.
p4 _ self instantiateClass: (self splObj: ClassMessage) indexableSize: 0.
self push: p4.
self storePointer: 1 ofObject: list2 withValue: p4.
(self become: list1 with: list2 twoWay: true) ifFalse: [self error:
'failed'].
"!!!" self popStack = p2 ifFalse: ["stops here!" self halt].
self popStack = p1 ifFalse: [self halt].
self popStack = p4 ifFalse: [self halt].
self popStack = p3 ifFalse: [self halt].
(self fetchPointer: 0 ofObject: list1) = p3 ifFalse: [self halt].
(self fetchPointer: 1 ofObject: list1) = p4 ifFalse: [self halt].
(self fetchPointer: 0 ofObject: list2) = p1 ifFalse: [self halt].
(self fetchPointer: 1 ofObject: list2) = p2 ifFalse: [self halt].
BTW: Not using #pushRemappableOop: here doesn't seem to be clean to me, but
this hasn't been the problem here for me (at least with enough simulator mem
reserved).
--
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev
mailing list
|