RFR: 8309979: BootstrapMethods attribute is missing in class files recreated by SA [v2]
Ashutosh Mehra
duke at openjdk.org
Thu Jun 22 16:13:03 UTC 2023
On Thu, 22 Jun 2023 03:21:33 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
> Do we have any automatic test coverage for this?
Nope, I don't think there is any test for BootstrapMethods. As mentioned [here](https://github.com/openjdk/jdk/pull/14556#issuecomment-1601946451) the existing tests - ClhsdbDumpclass.java and TestClassDump.java - are very basic.
I think there is scope for improving testing so that SA's dump feature does not become stale over a period of time as new attributes/tags are added to the classfile format.
I am thinking of a comprehensive test that creates a classfile with specific attribute, load it in the VM, dump that class file using SA, then disassemble the generated class file to check for the presence of the attribute. We would also need some mechanism to ensure all attributes and cp tags supported by the VM level being tested are covered. Does that sound feasible?
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java line 475:
>
>> 473: if (operands != null) {
>> 474: count = getOperandOffsetAt(operands, 0) / 2;
>> 475: }
>
> Nit: Could you, please, add a small comment why the bootstrap methods count is calculated this way?
Done.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14495#issuecomment-1602943392
PR Review Comment: https://git.openjdk.org/jdk/pull/14495#discussion_r1238752462
More information about the serviceability-dev
mailing list