On Mon, 23 Sep 2024 00:33:26 GMT, Chen Liang <li...@openjdk.org> wrote:
>> Do some refactoring so that the code can be inlined by the C1/C2 optimizer. >> >> 1. DirectClassBuilder::build codeSize 361 -> 315 >> 2. DirectCodeBuilder::writeExceptionHandlers codeSize 183 -> 31 >> 3. BufWriterImpl::writeIndex codeSize 62 -> 37 (forceinline) >> 4. BufWriterImpl::writeU2 (forceinline) >> 5. Util::writeAttributes codSize 45 -> 40 (forceinline) >> 6. Util::writeList codSize 47 -> 42 (forceinline) > > src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java > line 99: > >> 97: } >> 98: >> 99: void writeMagic(int minorVersion, int majorVersion) { > > Can we call this `writeHeader` as this writes both the magic and the version? Now, through the local variable constantPool, codeSize < 325 can be achieved without extracting a separate method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21118#discussion_r1771513668