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

Claes Redestad redestad at openjdk.org
Mon Sep 30 12:28:35 UTC 2024


On Mon, 30 Sep 2024 11:17:20 GMT, Chen Liang <liach at openjdk.org> wrote:

> This can also avoid cp entries for small values and use 2-byte bipush or 1-byte constants, both smaller in size.

Yikes, I was unaware `ldc` wouldn't optimize the emitted bytecode but reading through the code and docs it's pretty obvious. Still.. why?!

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

PR Comment: https://git.openjdk.org/jdk/pull/21259#issuecomment-2383044320


More information about the hotspot-jfr-dev mailing list