RFR: 8364991: Incorrect not-exhaustive error [v3]

Vicente Romero vromero at openjdk.org
Wed Oct 15 17:16:30 UTC 2025


On Wed, 15 Oct 2025 16:50:52 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Yes, the identity map is intentional. It is entirely possible two equivalent types are produced from two different originating pattern sets, and when backtracking, we want to use the correct set. That is achieve by using the identity search. I've added a comment:
>> https://github.com/openjdk/jdk/pull/27247/commits/51b7fc283e88ac5947cfebfce6609704c360e235
>> 
>> Thanks!
>
> thanks for adding the comment!

to be honest, the problem I have with IdentityHashMap is that it has a lot of misses, at least that's that I saw while debugging some examples. What I saw was that in order to make sure that a given PatternDescription was not in the map, several keys in the table were visited. This somehow can kill the benefit of using a map as it can degenerate in some cases. So I wonder if it could be possible to define a key that takes into consideration the position of the JCRecordPattern we got the record pattern from, in order to make them "unique". Of course this is in the performance side and could be done in a follow-up patch

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27247#discussion_r2433383853


More information about the compiler-dev mailing list