[squeak-dev] Re: Boolean over-optimization #ifTrue:/#ifFalse:

Paolo Bonzini bonzini at gnu.org
Wed Mar 5 06:16:02 UTC 2008


Igor Stasenko wrote:
> Hello,
> 
> i currently tried to implement a proxy (subclass of ProtoObject) with
> own IfTrue:/ifFalse: methods.
> What i can't understand, is why VM throws me with #mustBeBoolean
> message instead of doing real send if optimized pattern fails (when
> receiver of #IfTrue: is a non-boolean)?

Because you cannot distinguish #ifTrue:#ifFalse: sends from #whileTrue: 
for example, and because there are no BlockC{ontext,losure} objects for 
the argument blocks.

Paolo



More information about the Squeak-dev mailing list