On Wed, 4 Nov 2020 16:29:27 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
> Current Zero interpreter has the optimization for JVMTI support. It > recognizes that JVMTI is disabled most of the time, and that JVMTI checks in > the interpreter code slows it down considerably. (I measured it myself when > working on this patch: removing this optimization yields about 20% hit in > build times). > > Current optimization works as follows. At build time, an XSLT transform is > performed on `bytecodeInterpreter.cpp`, yielding > `bytecodeInterpreterWithChecks.cpp`. In that new compilation unit, `VM_JVMTI` > macro is defined, and a new entry point -- `BytecodeInterpreter::withChecks` > -- is defined. Then, both compilation units are compiled. In one of them, > `JVMTI` hooks are stripped out. In another, they persist. Then, callers have > to choose which entry point to use. > > I believe this can be rewritten to use C++ templates instead of XLST and > defines dance. This also allows to clean up JVMTI checks a bit. > > Additional testing: > - [x] Linux x86_64 Zero fastdebug build with `-jvmti` > - [x] Linux x86_64 Zero fastdebug/release build times are not regressing This pull request has now been integrated. Changeset: 643969a1 Author: Aleksey Shipilev <sh...@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/643969a1 Stats: 188 lines in 6 files changed: 5 ins; 128 del; 55 mod 8255822: Zero: improve build-time JVMTI handling Reviewed-by: dholmes, ihse ------------- PR: https://git.openjdk.java.net/jdk/pull/1061