RFR: 8296301: Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options [v2]
Fei Yang
fyang at openjdk.org
Fri Nov 11 02:59:30 UTC 2022
On Thu, 10 Nov 2022 12:36:36 GMT, Yanhong Zhu <yzhu at openjdk.org> wrote:
>> In this patch, count_bytecode() is modified by using "x7" as temporary register. Also implement histogram_bytecode() and histogram_bytecode_pair(), which can be enabled on debug mode by setting the options PrintBytecodeHistogram and PrintBytecodePairHistogram.
>>
>> The following is the output when PrintBytecodeHistogram or PrintBytecodePairHistogram is TRUE.
>>
>> $ java -XX:+PrintBytecodeHistogram --version|head -n 20
>> openjdk 20 2022-11-09
>> OpenJDK Runtime Environment (fastdebug build 20)
>> OpenJDK 64-Bit Server VM (fastdebug build 20, mixed mode)
>>
>> Histogram of 8101142 executed bytecodes:
>>
>> absolute relative code name
>> ----------------------------------------------------------------------
>> 634592 7.83% dc fast_aload_0
>> 471840 5.82% b6 invokevirtual
>> 376275 4.64% 2b aload_1
>> 358520 4.43% e0 fast_iload
>> 332267 4.10% de fast_aaccess_0
>> 270189 3.34% a7 goto
>> 249831 3.08% 19 aload
>> 223361 2.76% b9 invokeinterface
>> 215666 2.66% 1c iload_2
>> 194877 2.41% b8 invokestatic
>> 192212 2.37% 2c aload_2
>> 185826 2.29% 1b iload_1
>>
>> $ java -XX:+PrintBytecodePairHistogram --version|head -n 20
>> openjdk 20 2022-11-09
>> OpenJDK Runtime Environment (fastdebug build 20)
>> OpenJDK 64-Bit Server VM (fastdebug build 20, mixed mode)
>>
>> Histogram of 7627721 executed bytecode pairs:
>>
>> absolute relative codes 1st bytecode 2nd bytecode
>> ----------------------------------------------------------------------
>> 102673 1.346% 84 a7 iinc goto
>> 85429 1.120% dc 2b fast_aload_0 aload_1
>> 84394 1.106% dc b6 fast_aload_0 invokevirtual
>> 73131 0.959% b7 dc invokespecial fast_aload_0
>> 64605 0.847% 2b b6 aload_1 invokevirtual
>> 64086 0.840% dc b9 fast_aload_0 invokeinterface
>> 63663 0.835% b6 dc invokevirtual fast_aload_0
>> 59946 0.786% b6 de invokevirtual fast_aaccess_0
>> 56631 0.742% 36 e0 istore fast_iload
>> 51261 0.672% b9 de invokeinterface fast_aaccess_0
>> 49556 0.650% 3a 19 astore aload
>> 49106 0.644% a7 e0 goto fast_iload
>>
>> The items in column "relative" are equal to percentages of bytecodes in the result of the TraceBytecodes option(counting bytecodes manually).
>
> Yanhong Zhu has updated the pull request incrementally with one additional commit since the last revision:
>
> replace atomic_addalw with atomic_addw
Updated change looks good. Thanks.
-------------
Marked as reviewed by fyang (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11051
More information about the hotspot-dev
mailing list