This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Why does class _Jv_Utf8Const have only 16 bits of the String hash code?
- From: Per Bothner <per at bothner dot com>
- To: David Daney <ddaney at avtrex dot com>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 13 Mar 2006 18:44:56 -0800
- Subject: Re: Why does class _Jv_Utf8Const have only 16 bits of the String hash code?
- References: <441627E4.30006@avtrex.com>
David Daney wrote:
I don't really know what to make of it all, but it seems like it could
be an ABI breaking win to either get rid of the hash or increase its
size to 32 bits.
I don't fully remember why we decided on a 16-bit hash-code, though one
factor was having 16-bit alignment for _Jv_Utf8Const.
In any case, I agree we should in principle either remove the hash-code or
extend it to 32 bits. IIRC correctly I added the hash32, hash16, and hash8
methods to make it easier to make this change.
However, I don't think it is worth breaking the ABI
for this change alone. It should be done as part of a more comprehensive
redesign, or at least we should bundle a number of changes together.
As to the choice of removing the hash-code or extending it, I think it
should probably remove it. We might also want to remove the length field.
And as suggested earlier, places where the datastructures contain a
pointer to a _Jv_Utf8Const should be replaced by an offset into a
"string table segment", which can be shared across multiple classes.
--
--Per Bothner
per@bothner.com http://per.bothner.com/