RFR: 8341199: Use ClassFile's new API loadConstant(int)

Chen Liang liach at openjdk.org
Mon Sep 30 11:19:37 UTC 2024


On Mon, 30 Sep 2024 10:03:57 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> The new API loadConstant(int) can shorten the calling path and can replace ldc when the parameter is of int/Integer type.

Indeed, loadConstant was invented to be more optimized than ldc. This can also avoid cp entries for small values and use 2-byte bipush or 1-byte constants, both smaller in size.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21259#pullrequestreview-2337194592


More information about the core-libs-dev mailing list