RFR: 8309979: BootstrapMethods attribute is missing in class files recreated by SA [v2]
Kevin Walls
kevinw at openjdk.org
Wed Jun 21 16:42:05 UTC 2023
On Wed, 21 Jun 2023 13:32:55 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:
>> 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
>
> This is because the array returned by getBootstrapMethodAt() includes bootstrap method ref, num arguments and arguments. getBootstrapMethodAt() gets all the pieces and assembles them in the array which is then written out in this loop. There is already getBootstrapSpecifierAt() which is doing the same thing. So I just reused that implementation.
ah yes thanks, hadn't got there yet 8-)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14495#discussion_r1237293582
More information about the serviceability-dev
mailing list