RFR: 8255737: Zero: DO_UPDATE_INSTRUCTION_COUNT should only update when relevant VM flags are set [v2]

Severin Gehwolf sgehwolf at openjdk.java.net
Tue Nov 3 13:34:04 UTC 2020


On Tue, 3 Nov 2020 12:17:24 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp line 138:
>> 
>>> 136: #define DO_UPDATE_INSTRUCTION_COUNT(opcode)                                                          \
>>> 137: {                                                                                                    \
>>> 138:     if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::_counter_value++;    \
>> 
>> Elsewhere we do `[...] || StopInterpreterAt > 0` which is clearer as it's a flag expecting an int value. Perhaps you could use that instead of the implicit boolean conversion?
>> 
>> Yes, this doesn't seem consistent throughout the code, but while at it...
>
> Right on. I went on fixing the uses of `StopInterpreterAt` in this macro. I thought we can just check it against `_counter_value` without implicitly checking for `0` in the line below. But then Zero fastdebug build times exploded on me! So I thought to rewrite the block to hide most of the branches under the big one. See the update. This also clusters the uses of `BytecodeCounter::_counter_value`.

Thanks for the update!

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

PR: https://git.openjdk.java.net/jdk/pull/997


More information about the hotspot-runtime-dev mailing list