[Vm-dev] Interpreter>>isContextHeader: optimization

Igor Stasenko siguctua at gmail.com
Mon Feb 23 07:01:54 UTC 2009


2009/2/23 Yoshiki Ohshima <yoshiki at vpri.org>:
>
> At Sat, 21 Feb 2009 09:37:29 +0200,
> Igor Stasenko wrote:
>>
>>
>> i think it wouldn't hurt to rewrite it as:
>>
>> isContextHeader: aHeader
>>       self inline: true.
>>  | hdr |
>>   hdr := aHeader bitAnd: (16r1F << 12).
>>       ^ hdr = (13 << 12)                      "MethodContext"
>>               or: [ hdr = (14 << 12)          "BlockContext"
>>               or: [ hdr = (4 << 12)]]  "PseudoContext"
>
>  This is totally tangent but I was supposed to relay a message from
> somebody (IIRC it was originally from Dave Ungar but a few hops in
> between) pointed out that "13" is BlockContext and "14" is
> MethodContext in the image.
>
I just copied the source, didn't really changed anything in it.. so it
sits there for a while :)

>  (This level of nitpicking may not have anything to do with average
> Squeakers but for VM hackers I understand it could be crucial^^;)
>
Yup, this is another argument in having:

OopHeader>>isContextHeader
  ^ self isMethodContext or: [self isBlockContext or: [self isPseudoContext ]]

instead of numerous #bitAnd: and #<< in many different places :)

> -- Yoshiki
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list