[VM-dev] Do we have special bytecode to push class of object or to compare object class?

Clément Bera bera.clement at gmail.com
Sat May 28 05:27:57 UTC 2016


Else in the sistaV1 bytecode set there is the #jumpIfNotInstanceOfOrPop:
bytecode, which is heavily optimized for class test. I would be compiled
much faster than obj class == Class ifTrue: [] because it compares class
tags and not class pointers. The problem is that this bytecode relies on
classes as literals, not as literal variables, which may not be convenient
in your case.



On Fri, May 27, 2016 at 11:04 PM, Eliot Miranda <eliot.miranda at gmail.com>
wrote:

>
> H Denis,
>
>     there are bytecodes for #== and #class that do no lookup.  Look for
> Smalltalk specialSelectors and you'll figure it out.  There are 32 special
> selectors.  The first is #+ and has bytecode 176 in the default bytecode
> set.
>
> _,,,^..^,,,_ (phone)
>
> On May 27, 2016, at 12:54 PM, Denis Kudriashov <dionisiydk at gmail.com>
> wrote:
>
> Hi.
>
> I want to play with idea to make #ifNil: optimization in the way that for
> particular receiver it will be always real message send.
> I want to compile it with extra check like
>
> receiver class = MySpecialClass ifTrue: ifNilBlock.
>
>
> I want to measure performance impact.
> I know in the past #class was compiled as special bytecode. Is it
> available now? And what bytecode I could use?
>
> Best regards,
> Denis
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160528/8c60b576/attachment.htm


More information about the Vm-dev mailing list