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

2024-07-12 Thread Chen Liang
On Mon, 8 Jul 2024 14:14:02 GMT, Adam Sotona  wrote:

>> 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
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fixed BootstrapMethodEntryImpl::computeHashCode

@asotona This patch is ready for integration. You can still backport this 
critical fix before rdp1.

-

PR Comment: https://git.openjdk.org/jdk/pull/20074#issuecomment-2226536671


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

2024-07-09 Thread Chen Liang
On Mon, 8 Jul 2024 14:14:02 GMT, Adam Sotona  wrote:

>> 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
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fixed BootstrapMethodEntryImpl::computeHashCode

Marked as reviewed by liach (Committer).

-

PR Review: https://git.openjdk.org/jdk/pull/20074#pullrequestreview-2166140052


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

2024-07-08 Thread Adam Sotona
On Mon, 8 Jul 2024 13:57:20 GMT, Chen Liang  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   fixed BootstrapMethodEntryImpl::computeHashCode
>
> src/java.base/share/classes/jdk/internal/classfile/impl/BootstrapMethodEntryImpl.java
>  line 79:
> 
>> 77: static int computeHashCode(MethodHandleEntryImpl handle,
>> 78:List 
>> arguments) {
>> 79: return 31 * handle.hashCode() + arguments.hashCode();
> 
> Should we update the algorithm here, as this algorithm processes hash codes 
> of the 2nd last item of arguments and the handle the same, both just 
> multiplied by 31?
> 
> Also need a copyright year update.

Right, BSMEntries are also stored in EntryMap.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/20074#discussion_r1668711691


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

2024-07-08 Thread Adam Sotona
> 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

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  fixed BootstrapMethodEntryImpl::computeHashCode

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/20074/files
  - new: https://git.openjdk.org/jdk/pull/20074/files/9d4a1a2a..d38b2ffb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20074&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20074&range=00-01

  Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 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