Jecel,
Thanks much for both your thoughtful reply and the paper reference.
This latter was the gold I was looking for! Too many Dispatch papers to
search through!
Good on ya,
-KenD
========
> A nice overview of the different ways to compress the class vs selector
tables can be found in the ECOOP 95 paper "Message Dispatch on Pipelined
Processors" by Karel Driesen, Urs Hölzle and Jan Vitek:
> https://www.researchgate.net/publication/221496253_Message_Dispatch_on_Pipe…
========
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: ca9794e2ffd60fe40292f88fc4ff0114d7591c18
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ca9794e2ffd60fe402…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2021-03-16 (Tue, 16 Mar 2021)
Changed paths:
M nsspur64src/vm/cointerp.c
M nsspur64src/vm/cointerp.h
M nsspur64src/vm/gcc3x-cointerp.c
M nsspursrc/vm/cointerp.c
M nsspursrc/vm/cointerp.h
M nsspursrc/vm/gcc3x-cointerp.c
M nsspurstack64src/vm/gcc3x-interp.c
M nsspurstack64src/vm/interp.c
M nsspurstacksrc/vm/gcc3x-interp.c
M nsspurstacksrc/vm/interp.c
M spur64src/vm/cointerp.c
M spur64src/vm/cointerp.h
M spur64src/vm/cointerpmt.c
M spur64src/vm/cointerpmt.h
M spur64src/vm/gcc3x-cointerp.c
M spur64src/vm/gcc3x-cointerpmt.c
M spurlowcode64src/vm/cointerp.c
M spurlowcode64src/vm/cointerp.h
M spurlowcode64src/vm/gcc3x-cointerp.c
M spurlowcodesrc/vm/cointerp.c
M spurlowcodesrc/vm/cointerp.h
M spurlowcodesrc/vm/gcc3x-cointerp.c
M spurlowcodestack64src/vm/gcc3x-interp.c
M spurlowcodestack64src/vm/interp.c
M spurlowcodestacksrc/vm/gcc3x-interp.c
M spurlowcodestacksrc/vm/interp.c
M spursista64src/vm/cointerp.c
M spursista64src/vm/cointerp.h
M spursista64src/vm/gcc3x-cointerp.c
M spursistasrc/vm/cointerp.c
M spursistasrc/vm/cointerp.h
M spursistasrc/vm/gcc3x-cointerp.c
M spursrc/vm/cointerp.c
M spursrc/vm/cointerp.h
M spursrc/vm/cointerpmt.c
M spursrc/vm/cointerpmt.h
M spursrc/vm/gcc3x-cointerp.c
M spursrc/vm/gcc3x-cointerpmt.c
M spurstack64src/vm/gcc3x-interp.c
M spurstack64src/vm/interp.c
M spurstack64src/vm/validImage.c
M spurstacksrc/vm/gcc3x-interp.c
M spurstacksrc/vm/interp.c
M spurstacksrc/vm/validImage.c
M src/vm/cointerp.c
M src/vm/cointerp.h
M src/vm/gcc3x-cointerp.c
M stacksrc/vm/gcc3x-interp.c
M stacksrc/vm/interp.c
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.2948
...and primitiveNotIdentical contains the same mistake.
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2948.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2948
Author: eem
Time: 16 March 2021, 1:24:48.66302 pm
UUID: 935d1ee7-0e61-47a5-92e2-953224c7ffcf
Ancestors: VMMaker.oscog-eem.2947
...and primitiveNotIdentical contains the same mistake.
=============== Diff against VMMaker.oscog-eem.2947 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveNotIdentical (in category 'object access primitives') -----
primitiveNotIdentical
"is the receiver/first argument not the same object as the (last) argument?.
pop argumentCount because this can be used as a mirror primitive."
+ "is the receiver/first argument the same object as the (last) argument?.
+ pop argumentCount because this can be used as a mirror primitive."
| thisObject otherObject |
+ thisObject := self stackValue: 1.
+ otherObject := self stackTop.
+ ((objectMemory isOopForwarded: otherObject)
+ or: [argumentCount > 1
+ and: [objectMemory isOopForwarded: thisObject]])
+ ifTrue:
+ [self primitiveFailFor: PrimErrBadArgument]
+ ifFalse:
+ [self pop: argumentCount + 1 thenPushBool: thisObject ~= otherObject]!
- otherObject := self stackValue: 1.
- thisObject := self stackTop.
- (objectMemory isOopForwarded: otherObject) ifTrue:
- [self assert: argumentCount > 1.
- otherObject := objectMemory followForwarded: thisObject].
- (objectMemory isOopForwarded: thisObject) ifTrue:
- [thisObject := objectMemory followForwarded: thisObject].
- self pop: argumentCount + 1 thenPushBool: thisObject ~= otherObject!
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 607b872095dc34d8d8473bb87014feb9c9c25412
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/607b872095dc34d8d8…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2021-03-16 (Tue, 16 Mar 2021)
Changed paths:
M nsspur64src/vm/cointerp.c
M nsspur64src/vm/cointerp.h
M nsspur64src/vm/gcc3x-cointerp.c
M nsspursrc/vm/cointerp.c
M nsspursrc/vm/cointerp.h
M nsspursrc/vm/gcc3x-cointerp.c
M nsspurstack64src/vm/gcc3x-interp.c
M nsspurstack64src/vm/interp.c
M nsspurstacksrc/vm/gcc3x-interp.c
M nsspurstacksrc/vm/interp.c
M spur64src/vm/cointerp.c
M spur64src/vm/cointerp.h
M spur64src/vm/cointerpmt.c
M spur64src/vm/cointerpmt.h
M spur64src/vm/gcc3x-cointerp.c
M spur64src/vm/gcc3x-cointerpmt.c
M spurlowcode64src/vm/cointerp.c
M spurlowcode64src/vm/cointerp.h
M spurlowcode64src/vm/gcc3x-cointerp.c
M spurlowcodesrc/vm/cointerp.c
M spurlowcodesrc/vm/cointerp.h
M spurlowcodesrc/vm/gcc3x-cointerp.c
M spurlowcodestack64src/vm/gcc3x-interp.c
M spurlowcodestack64src/vm/interp.c
M spurlowcodestacksrc/vm/gcc3x-interp.c
M spurlowcodestacksrc/vm/interp.c
M spursista64src/vm/cointerp.c
M spursista64src/vm/cointerp.h
M spursista64src/vm/gcc3x-cointerp.c
M spursistasrc/vm/cointerp.c
M spursistasrc/vm/cointerp.h
M spursistasrc/vm/gcc3x-cointerp.c
M spursrc/vm/cointerp.c
M spursrc/vm/cointerp.h
M spursrc/vm/cointerpmt.c
M spursrc/vm/cointerpmt.h
M spursrc/vm/gcc3x-cointerp.c
M spursrc/vm/gcc3x-cointerpmt.c
M spurstack64src/vm/gcc3x-interp.c
M spurstack64src/vm/interp.c
M spurstack64src/vm/validImage.c
M spurstacksrc/vm/gcc3x-interp.c
M spurstacksrc/vm/interp.c
M spurstacksrc/vm/validImage.c
M src/vm/cointerp.c
M src/vm/cointerp.h
M src/vm/gcc3x-cointerp.c
M stacksrc/vm/gcc3x-interp.c
M stacksrc/vm/interp.c
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.2947
Fix a dreadful slip in InterpreterPrimitives>>primitiveIdentical. In the one
argument case the old implementation checked the receiver for being forwarded
rather than the argument. This means that the interpreter and/or the debugger
will answer the wrong value for e.g. ObjectTest testBecomeForward pt3 == pt2.
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2947.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2947
Author: eem
Time: 16 March 2021, 12:55:58.857415 pm
UUID: 009d2db3-059e-4852-8a76-567d6ee0e2d2
Ancestors: VMMaker.oscog-eem.2946
Fix a dreadful slip in InterpreterPrimitives>>primitiveIdentical. In the one argument case the old implementation checked the receiver for being forwarded rather than the argument. This means that the interpreter and/or the debugger will answer the wrong value for e.g. ObjectTest testBecomeForward pt3 == pt2.
=============== Diff against VMMaker.oscog-eem.2946 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveIdentical (in category 'object access primitives') -----
primitiveIdentical
"is the receiver/first argument the same object as the (last) argument?.
pop argumentCount because this can be used as a mirror primitive."
| thisObject otherObject |
+ thisObject := self stackValue: 1.
+ otherObject := self stackTop.
- otherObject := self stackValue: 1.
- thisObject := self stackTop.
((objectMemory isOopForwarded: otherObject)
or: [argumentCount > 1
and: [objectMemory isOopForwarded: thisObject]])
ifTrue:
[self primitiveFailFor: PrimErrBadArgument]
ifFalse:
[self pop: argumentCount + 1 thenPushBool: thisObject = otherObject]!
Item was changed:
----- Method: StackInterpreterSimulator>>primitiveDoPrimitiveWithArgs (in category 'debugging traps') -----
primitiveDoPrimitiveWithArgs
+ | primIndex |
+ primIndex := objectMemory integerValueOf: (self stackValue: 1).
+ NewspeakVM ifFalse:
+ [transcript nextPutAll: 'DO PRIMITIVE: '; print: (self functionPointerFor: primIndex inClass: nil); cr; flush].
+ (#(110) includes: primIndex) ifTrue:
+ [self halt].
- NewspeakVM ifFalse: [self halt].
^super primitiveDoPrimitiveWithArgs!