RFR: 8285976: compiler/exceptions/OptimizeImplicitExceptions.java can't pass with -XX:+DeoptimizeALot

Xin Liu xliu at openjdk.java.net
Wed May 4 05:56:26 UTC 2022


On Tue, 3 May 2022 15:51:00 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java line 200:
>> 
>>> 198:         // The following options are both develop, getBooleanVMFlag() returns NULL in product build.
>>> 199:         // If they are set in debug build, disable them for more test stability.
>>> 200:         if (WB.getBooleanVMFlag("DeoptimizeALot")) {
>> 
>> If this really returns NULL in a product build, wont this cause an exception then?
>> 
>> Wouldn't it be easier to just unconditionally set them both to false:
>> 
>> WB.setBooleanVMFlag("DeoptimizeALot", false);
>> WB.setBooleanVMFlag("DeoptimizeRandom", false);
>
> If so, I think that should be done in the `@run` statement.

I prefer Volker style rather than @run annotation.   Here are my arguments. 

1. They need an extra one `-XX:+IgnoreUnrecognizedVMOptions` because those 2 options are not valid in debug builds.
2. Current makefile does put JTREG="VM_OPTIONS=-XX:+DeoptimizeALot" before, `@run` options will overwrite them.  We better off not reply on makefile's logic.
3. Writing them in code gives us an opportunity to write a comment.

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

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


More information about the hotspot-compiler-dev mailing list