RFR: 8339113: AccessFlags can be u2 in metadata [v5]

Coleen Phillimore coleenp at openjdk.org
Fri Dec 20 13:30:38 UTC 2024


On Thu, 19 Dec 2024 01:40:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Restore ACC in comment.
>
> src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp line 75:
> 
>> 73:     while (!jfs.done()) {
>> 74:       if (offset == jfs.offset()) {
>> 75:         *modifiers = jfs.access_flags().as_int();
> 
> This looks wrong - we want a short and you extracted as an int when it was already a short. ??

I changed as_int() to as_unsigned_short() which hopefully is less confusing, so resolving these conversations/questions.

> src/hotspot/share/oops/method.cpp line 1655:
> 
>> 1653:     return;
>> 1654:   }
>> 1655:   jshort flags = access_flags().as_int();
> 
> Again why the short -> int -> short? And why isn't this unsigned?

The call below takes jshort, so added a checked_cast<>  The top sign bit won't be set because we filter that out (it was ACC_MODULE).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22246#discussion_r1893940015
PR Review Comment: https://git.openjdk.org/jdk/pull/22246#discussion_r1893941294


More information about the serviceability-dev mailing list