RFR: 7903448: JMH: Override the use of compiler hints using a system property [v2]
Gilles Duboscq
gdub at openjdk.org
Fri Apr 21 14:21:16 UTC 2023
On Fri, 24 Mar 2023 08:56:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Gilles Duboscq has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>>
>> Allow forcing the use of compiler hints using a system property
>>
>> Using `-Djmh.compilerhints.mode=FORCE_ON` will force the use of compiler
>> hints. `-Djmh.compilerhints.mode=FORCE_OFF` will prevent the use of compiler
>> hints. When the system property is not set, or when it is set to `AUTO`,
>> the current beahviour based on vm name and version will be used.
>
> jmh-core/src/main/java/org/openjdk/jmh/runner/CompilerHints.java line 232:
>
>> 230: public static void addCompilerHints(List<String> command) {
>> 231: if (!compilerHintsEnabled()) {
>> 232: if (compilerHintsSelect() == CompilerHintsSelect.AUTO) {
>
> Collapsible `if`-s. I'd say:
>
>
> if (compilerHintsSelect() == CompilerHintsSelect.AUTO_OFF) {
> ...
> }
I can reduce the depth by printing the message when `compilerHintsSelect() == CompilerHintsSelect.AUTO_OFF)` but i still need another `if` to return early in the `FORCE_OFF` case.
-------------
PR Review Comment: https://git.openjdk.org/jmh/pull/96#discussion_r1173825308
More information about the jmh-dev
mailing list