RFR: 8320649: C2: Optimize scoped values [v18]

Andrew Haley aph at openjdk.org
Thu May 30 17:56:12 UTC 2024


On Thu, 30 May 2024 16:38:34 GMT, Andrew Haley <aph at openjdk.org> wrote:

> > 1. use only a primary slot probe, no secondary
> > 
> > 2. use a deterministic secondary probe (based on the hash), not random
> > ```
> 
> Looks pretty deterministic to me. Every value has two hash codes, primary and secondary,and they are different.

Ah, I just realized what you meant. Without random replacement in the cache, there is a high probability that scoped values will collide, because the cache is small. Even with only two scoped values accessed alternately, each will repeatedly kick out the other, leading to a linear probe every time. The only way to avoid this without random replacement would be to make the cache considerably larger, and even then it would still occasionally happen.

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

PR Comment: https://git.openjdk.org/jdk/pull/16966#issuecomment-2140464387


More information about the hotspot-compiler-dev mailing list