harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Cornwall (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5682) [classlib][pack200] Sped up hashCode and removed dead getCpAll()
Date Wed, 02 Apr 2008 16:57:27 GMT
[classlib][pack200] Sped up hashCode and removed dead getCpAll()

                 Key: HARMONY-5682
                 URL: https://issues.apache.org/jira/browse/HARMONY-5682
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
         Environment: All Pack200
            Reporter: Andrew Cornwall
         Attachments: main.patch

This patch does two things, one of which may be controversial.

The uncontroversial code removes SegmentConstantPool.getCpAll(), since it is no longer used.

The other code changes hashCode in CPUTF8, CPClass and CPRef. Because hashCode is used frequently,
making it fast is a good idea. In the pack200 code as it exists, hashCode is never called
for CPUTF8, CPClass or CPRef unless all instance variables have been set. The changes to hashCode
make the assumption that this will always hold. As a consequence, hashCode will throw a NullPointerException
when sent to uninitialized instances of these classes.

The changes to hashCode do improve runtime by about 10%.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message