RFR: JDK-8292561: Make "ReplayCompiles" a diagnostic product switch

Vladimir Kozlov kvn at openjdk.org
Fri Aug 19 23:44:35 UTC 2022


On Fri, 19 Aug 2022 06:53:08 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> See discussion: https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2022-August/057988.html
> 
> Making ReplayCompiles a (diagnostic) runtime switch can help when facing problems with shipped release VMs:
> - Investigate the effects of compiler errors in shipped VMs to estimate the bug impact
> - Investigate if a given build is affected by a compiler bug
> 
> Making the option product increases libjvm.so text size by 54kb (Linux x64). No measurable runtime overhead.
> 
> Tests: Almost all tests in compiler/ciReplay generate replay files by inducing a crash with `-XX:CICrashAt`. That won't work in release builds. I added a simple test that checks that invalid replay files are correctly refused, and that test can also be done on a release VM. So we at least have a test for release that checks argument parsing.
> 
> (Note: I have https://github.com/openjdk/jdk/pull/9891 open, which could in the future serve as an alternative to CICrashAt by limiting the compiler arena).

Current ciReplay tests requires `vm.debug == true` - that is why they can use debug flags.
I don't think we need to modify them. For new tests which you want to run in product VM we can use new NMT feature you are proposing.

src/hotspot/share/ci/ciEnv.hpp line 200:

> 198:           return ciEnv::_unloaded_ciinstance_klass;
> 199:         }
> 200:       }

May be make this part of code as `ciReplay` method and place it into ciReplay.cpp to reduce code in .hpp file.

src/hotspot/share/runtime/arguments.cpp line 3874:

> 3872: 
> 3873: static void apply_debugger_ergo() {
> 3874: #ifdef ASSERT

Use `#ifndef PRODUCT` as other `UseDebuggerErgo*` code.

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

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


More information about the hotspot-compiler-dev mailing list