RFR: 8295023: Interpreter(AArch64): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options [v3]

Hao Sun haosun at openjdk.org
Thu Oct 13 04:12:23 UTC 2022


On Wed, 12 Oct 2022 13:48:25 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Hao Sun has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove rscratch3 for count_bytecode() and histogram_bytecode()
>
> src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp line 2004:
> 
>> 2002:                  /* kind */ Assembler::LSR,
>> 2003:                  /* shift */ BytecodePairHistogram::log2_number_of_codes);
>> 2004: 
> 
> I've had another look at this. `_index` is a two-element queue of bytecodes, but it is shared between all threads. If two threads access `_index` racily the result will be invalid, regardless of whether the OR into memory is atomic. This will make this PR much simpler.
> None of the other ports access `_index` atomically, and should need we. On the other hand, bumping the bytecode counter atomically is fine.
> We could make a thread-local `_index`, but it's too much code to be worthwhile.

Thanks for pointing this out. Updated.

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

PR: https://git.openjdk.org/jdk/pull/10642


More information about the hotspot-dev mailing list