RFR: 8309979: BootstrapMethods attribute is missing in class files recreated by SA [v2]

Kevin Walls kevinw at openjdk.org
Wed Jun 21 12:50:08 UTC 2023


On Thu, 15 Jun 2023 20:24:39 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:

>> Please review this PR that extends SA to write BootstrapMethods attribute when dumping the class files.
>> 
>> Tested it by dumping the class file for java/lang/String and comparing the BootstrapMethods attribute shown by javap for the original and the dumped class.
>
> Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review comments by plummercj
>   
>   Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java line 756:

> 754:                 }
> 755:             }
> 756:         }

Hi, it looks odd to me that we only write one short in the loop: should that be a bootstrap method ref, num arguments, and arguments?

I was comparing with: https://docs.oracle.com/javase/specs/jvms/se20/jvms20.pdf
4.7.23 The BootstrapMethods Attribute

We have bootstrap attribute written by other code, e.g.
"src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java" 
visitBootstrapMethods

"src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java" 
writeBootstrapMethods

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14495#discussion_r1236945616


More information about the serviceability-dev mailing list