RFR: 8335820: java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java fails due to IllegalArgumentException: hash must be nonzero

Adam Sotona asotona at openjdk.org
Mon Jul 8 13:13:49 UTC 2024


Class-File API constant pool implementation requires non-zero entry hash code.
Unfortunately current implementation computes zero hash code for specific CP entries.

This patch removes invalid and obsolete `AbstractPoolEntry::phiMix` calculation and assures all pool entries have non-zero hash. A regression test of the actual zero-hash `IntegerEntry` has been added. 

All pre-computed hash codes in `BoundAttribute::standardAttribute` are updated.

The patch has no performance effect measurable by any of the actual Class-File API benchmarks.

Please review.

Thanks,
Adam

-------------

Commit messages:
 - 8335820: java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java fails due to IllegalArgumentException: hash must be nonzero

Changes: https://git.openjdk.org/jdk/pull/20074/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20074&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8335820
  Stats: 56 lines in 4 files changed: 7 ins; 7 del; 42 mod
  Patch: https://git.openjdk.org/jdk/pull/20074.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20074/head:pull/20074

PR: https://git.openjdk.org/jdk/pull/20074


More information about the core-libs-dev mailing list