RFR: 8008243: Zero: Implement fast bytecodes [v2]

Aleksey Shipilev shade at openjdk.java.net
Tue Oct 19 16:08:51 UTC 2021

On Tue, 19 Oct 2021 15:54:26 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp line 394:
>>> 392:         }
>>> 393: 
>>> 394: #define MAYBE_POST_FIELD_ACCESS(obj) {                              \
>> I wonder if making these functions would reduce the size of the code in the big case statement and improve the compiler's ability to optimize it?
> I actually look through the machine code for that file very often (as `perf record` / `perf report` for understanding where the bottlenecks are), and there seem to be little to gain w.r.t. code quality. I suspect out-of-line service functions would improve code density, but I also suspect the `BytecodeInterpreter::run` is so large, most non-trivial inlining fails. I'd need to do a much larger investigation if we can re-massage the code to maybe optimize it.
> Meanwhile, I would like to keep these defines, as they fit the current style of helper "methods".

Ah, also, notice `JVMTI_ENABLED`? That one is the template argument, which means when nothing JVMTI-like is enabled in runtime (like actual JVMTI hooks), the whole block is compiled away from `BytecodeInterpreter::run</* jvmti_enabled = */ false>`.


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

More information about the hotspot-runtime-dev mailing list