On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen <[email protected]> wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java line
124:
> 122: public void writeLong(long x) {
> 123: reserveSpace(8);
> 124: elems[offset ] = (byte) (x >> 56);
Since elems is mutable, should we pull it to a local variable and write
instead? Does C2 optimize this current code in compile logs?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20748#discussion_r1734740549