Mantis - Squeak
Viewing Issue Advanced Details
7229 VM tweak always 11-19-08 23:27 01-09-11 23:01
mikevdg  
lewis  
normal  
assigned 3.10.2  
open  
none    
none  
0007229: Remove optimisation for >>class
The VM uses bytecode 199 to send >>class; the implementation is optimised to not do a message send but to return the class directly.

In some cases such as using message catchers (i.e. the trick where you override >>doesNotUnderstand on a ProtoObject subclass), this is undesired behaviour. The optimisation prevents the user from being able to override the behaviour of >>class.

(code below from Eliot Miranda)

To fix this change
bytecodePrimClass
| rcvr |
rcvr := self internalStackTop.
self internalPop: 1 thenPush: (self fetchClassOf: rcvr).
self fetchNextBytecode.
to
bytecodePrimClass
messageSelector := self specialSelector: 23.
argumentCount := 0.
self normalSend.

There are no notes attached to this issue.