RFR: 8311102: Write annotations in the classfile dumped by SA [v3]

Ashutosh Mehra duke at openjdk.org
Tue Jul 11 19:56:25 UTC 2023


On Tue, 11 Jul 2023 06:32:24 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Some code motion and factoring out common code
>>   
>>   Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>
> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java line 494:
> 
>> 492:         offset += 1;
>> 493:       }
>> 494:       Address addr = getAddress().getAddressAt((getSize() - offset) * VM.getVM().getAddressSize());
> 
> Factor this address calculation out, and as @plummercj remarked, comment it?

Done.

> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java line 874:
> 
>> 872:       return null;
>> 873:     }
>> 874:   }
> 
> Would calling these functions even be valid to call if Annotations are not present?
> 
> If yes, maybe return Optional? But since the rest of the code does not use Optional either, maybe rather keep the code the same.
> 
> Up to you, feel free to ignore this.

I would keep it as is following existing code pattern.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14735#discussion_r1260208546
PR Review Comment: https://git.openjdk.org/jdk/pull/14735#discussion_r1260209779


More information about the serviceability-dev mailing list