RFR: 8342700: Set the default value of DirectCodeBuilder::handlers to Null

Chen Liang liach at openjdk.org
Mon Oct 21 14:24:14 UTC 2024


On Sun, 20 Oct 2024 23:15:44 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> Set the default value of DirectCodeBuilder::handlers to Null to reduce overhead in scenarios where there is no handler.

src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java line 805:

> 803:     public List<AbstractPseudoInstruction.ExceptionCatchImpl> getHandlers() {
> 804:         if (handlers == null) {
> 805:             return Collections.emptyList();

We prefer using `List.of()` now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21598#discussion_r1808923520


More information about the core-libs-dev mailing list