RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]
Claes Redestad
redestad at openjdk.org
Sat Jun 22 18:30:21 UTC 2024
On Wed, 3 Apr 2024 16:17:57 GMT, ExE Boss <duke at openjdk.org> wrote:
>> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
>>
>> - Reflecting review feedback.
>> - Merge branch 'master' into JDK-8291966
>> - Adding comments
>> - Improving performance
>> - Merge branch 'master' into JDK-8291966
>> - 8291966: SwitchBootstrap.typeSwitch could be faster
>
> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 389:
>
>> 387: }
>> 388: }
>> 389: return enumMap.map[value.ordinal()];
>
> `enumMap.map` never gets set before this line.
There's a bug filed for this already: https://bugs.openjdk.org/browse/JDK-8332522
@lahodaj explained that this broken code is part of an optimization which is never attempted (IIRC due to the bug you noted on line 327). JDK-833522 seem like a good place to continue this conversation..?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/9779#discussion_r1649761928
More information about the core-libs-dev
mailing list