On Mon, 30 Sep 2024 10:03:57 GMT, Shaojin Wen <s...@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. I was also curious about a few other seemingly "obvious" small optimizations, like loading `-1L` as `iconst_m1; i2l` and a few other things like that. Some of these depend on whether you happen to already have a constant pool entry for a value, but some (like this example) are either equivalent or better (in size) under all circumstances. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21259#issuecomment-2383080027