On 02/26/2012 08:07 PM, Gwenaël Casaccio wrote:
> 
>   classFor: anObject [
>     ^ ##(MirrorPrimitive class >> privateClass) valueWithReceiver:
> anObject withArguments: #()
>   ]
> 
> ##() is interesting because the compiled method (thus the primitive call)
> will be "injected" as a literal thus I don't need to do a lookup all the
> time (for getting the compiled method). Now I can execute the primitive
> on the object.

What about for even faster execution:

    classFor: anObject [
        <primitive VMpr_MirrorPrimitive_executePrimitive>
        ^##(VMpr_Object_class)
    ]

Paolo

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to