[Vm-dev] Re: [Pharo-project] Do we have the new primitive?? [WAS] Re: IdentitySet but using #hash rather than #identityHash ?

Eliot Miranda eliot.miranda at gmail.com
Sat May 5 22:17:22 UTC 2012

On Sat, May 5, 2012 at 1:46 PM, Levente Uzonyi <leves at elte.hu> wrote:

> (neither alpine, nor imp/horde can quote your mail due to the empty first
> attachment added by gmail, sorry)
> Thanks Eliot for looking into this issue.
> Yes, endIndex is very useful. For example LargeIdentityDictionary uses
> dynamic arrays to store the keys and values. The first element is stored at
> the first slot and we know the index of the last slot where an element is
> stored. The slots after that index conatain nil. The endIndex parameter
> makes it possible to avoid searching those nils if the element is not in
> the dictionary and simplifies the code, because searching for nil doesn't
> need special handling.
> I'm not sure if it's okay to use #longAt: in the loop, because the
> receiver can be an object which stores bytes (e.g.: ByteString/ByteArray)
> and I'd expect that the primivite also works correctly in that case. This
> would also make it possible to replace the existing linear search primitive
> for strings with this primitive.

Is it OK if the primitive fails for CompiledMethod and/or MethodContext or
are you looking for good performance for these too, e.g. with the

> Levente

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120505/5fbddae1/attachment.htm

More information about the Vm-dev mailing list