[Vm-dev] Re: Direct object pointers vs indirect ones pros and cons
Javier Burroni
javier.burroni at gmail.com
Wed Oct 26 21:18:21 UTC 2011
well, I think you are right. You have the extra loading for all
message sends but when sending to self
entryPoint:
mov [objectTable + selfID], self
cmp [self -4], nativizedClass
jnz lookup
endOfPrologue:
when sending message to self, you just put a call to endOfPrologue
On Wed, Oct 26, 2011 at 6:10 PM, Javier Burroni
<javier.burroni at gmail.com> wrote:
>>
>> yes, but then i will ask you to compare results with JIT optimized for
>> direct pointers.. :)
>>
>>> We have:
>>> accessing ivar: no extra cost
>>> method lookup:
>>> one extra indirection
>>> sends with MonomorphicInlineCache:
>>> no extra cost if implemented in an instance basis (checking against selfID).
>>
>> hmm.. that doesn't makes inline cache to be effective.
>> usually many different objects are passing via single call site but
>> they having same class, this is where monomophic IC shines.
>> if you change the cache to work on per-instance basis, i think it will
>> make it less effective because of too much misses.
> but you can have the two of them.
> In the jited prologue you may have something like:
>
> mov [objectTable + selfID], self
> cmp [self -4], nativizedClass
> jz endOfPrologue // patching code must be added here
> jmp looupAndJIT
> cmp selfID, nativizedSelfID <- entry point
> jnz cmpClass
> mov nativizedSelf, self
> endOfPrologue
>
>
> you add (mainly) an extra memory access, if the branch predictor helps
>
> --
> " To be is to do " ( Socrates )
> " To be or not to be " ( Shakespeare )
> " To do is to be " ( Sartre )
> " Do be do be do " ( Sinatra )
>
--
" To be is to do " ( Socrates )
" To be or not to be " ( Shakespeare )
" To do is to be " ( Sartre )
" Do be do be do " ( Sinatra )
More information about the Vm-dev
mailing list