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

Michael van der Gulik mikevdg at gmail.com
Wed Mar 5 20:11:57 UTC 2008


On Wed, Mar 5, 2008 at 7:01 PM, Igor Stasenko <siguctua at gmail.com> 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)?
>


FYI, I have a vested interested in message capture, as does Craig Latta.

My approach is at
http://www.squeaksource.com/DPON/MessageCapture-mvdg.13.mcz. It includes
special inspecters and print methods that let the debugger work (mostly) as
well, although its still as dangerous as programming in C or playing with
dynamite.

I can't remember if I also capture the ifTrue:/ifFalse sends; I may have
overridden #mustBeBoolean to handle that case.

Craig Latta's approach was to make a special class using VM modifications. I
think this is a better approach and I might rip his code off at some stage
:-P.

Gulik.

-- 
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080306/6746de4b/attachment.htm


More information about the Squeak-dev mailing list