[Vm-dev] Why do superclassSend ensureBehaviorHash:

Eliot Miranda eliot.miranda at gmail.com
Tue Apr 26 23:04:36 UTC 2016


Hi Nicolas,

On Tue, Apr 26, 2016 at 2:43 PM, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

>
> Hi,
> I see that superclassSend sends:
>     objectMemory ensureBehaviorHash: superclass.
> and just after it does
>     lkupClassTag := objectMemory classTagForClass: superclass.
>
> But classTagForClass:  is doing the same as above:
>     <api>
>     self assert: (coInterpreter addressCouldBeClassObj: classObj).
>     ^self ensureBehaviorHash: classObj
>
> So we are sending ensureBehaviorHash: twice...
> It sounds un-ncecessary or is there a tricky reason to this?
>
> Moreover, it sounds like ensureBehaviorHash: will begin with
>     self assert: (coInterpreter addressCouldBeClassObj: aBehavior).
>
> So again, we are asserting twice the same thing, aren't we?
>

Yes.  Good catch.  The send in superclassSed is clearly superfluous; but I
would change the method to comment that classTagForClass: ensures there is
a hash.



-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160426/66f331ba/attachment.htm


More information about the Vm-dev mailing list