strangeness in the land of hunders and gatherers.

Lex Spoon lex at cc.gatech.edu
Thu Mar 25 21:09:24 UTC 2004


Alan Grimes <alangrimes at starpower.net> wrote:
> In doing profile analysies on my code I came across something truly 
> bizzare:
> 
> SmallInteger > bitAnd:  was, itself, calling  SmallInteger>  bitOr: !!!!
> 
> I thought "WTF?!?!?!?!"
> 

The code you see in SmallInteger>>bitAnd: is only used if the
interpreter's primitive fails.  If the primitive succeeds, then the
primitive chooses what value is returned and the code you see in the
image is ignored.

The code in the image is called "fail code".

There is probably a better syntax that we could use for primitive
methods, that would clear up how fail code works, but I don't have any
ideas off hand.  On a related note, it would be nice if browsers could
take you immediately to the primitive that implements the method,
whenever it is available in the present image.


-Lex



More information about the Squeak-dev mailing list