This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: _Jv_HashCode
Tom Tromey wrote:
>
> >>>>> "Jeff" == Jeff Sturm <jeff.sturm@appnet.com> writes:
>
> Jeff> It seems to me that synchronization objects could provide their
> Jeff> own hash algorithm as well.
>
> What could it be except object address? It has to be something that
> never changes, regardless of the object's contents. Also, we don't
> want to add an extra word to the object, because getting rid of a word
> is one point of making this change.
Like you said, the bottom 2 or 3 bits of the address are useless, so you
can shift right.
Perhaps _Jv_HashCode should be changed to do the same after all, if gdb
can be fixed. On 64-bit archs that could shift in some meaningful bits
too.
--
Jeff Sturm
jeff.sturm@appnet.com