RFR: 8257848: -XX:CompileCommand=blackhole, * should be diagnostic [v2]

Aleksey Shipilev shade at openjdk.java.net
Mon Dec 7 19:24:35 UTC 2020


On Mon, 7 Dec 2020 19:21:38 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> This follows up on retroactive CSR review comments (JDK-8257827). As the result of discussion, it is decided to demote the "blackhole" compile command to diagnostic. Examples:
>> 
>> $ build/linux-x86_64-server-release/images/jdk/bin/java -Xcomp -XX:CompileCommand=quiet -XX:CompileCommand=blackhole,java/lang/Object.toString
>> OpenJDK 64-Bit Server VM warning: Blackhole compile option is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions
>> 
>> $ build/linux-x86_64-server-release/images/jdk/bin/java -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=blackhole,java/lang/Object.toString
>> OpenJDK 64-Bit Server VM warning: Blackhole compile option only works for methods with void type: java.lang.Object.toString()Ljava/lang/String;
>> 
>> New test verifies the locking/unlocking of the command.
>> 
>> Testing:
>>  - [x] ad-hoc `compiler/blackhole` test
>>  - [x] validation runs with JMH
>>  - [ ] runs in `tier1` (needs #1654 to be merged)
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert to check_predicate to match other should_* methods

src/hotspot/share/compiler/compilerOracle.cpp line 414:

> 412: bool CompilerOracle::should_blackhole(const methodHandle& method) {
> 413:   if (!check_predicate(CompileCommand::Blackhole, method)) {
> 414:     return false;

Review self-comment. In fact, I am not sure if this should be `check_predicate` (like other commands), or `has_option` (like other options). CompilerOracle refactoring in JDK-8256508 seem to have converged both to mean the same. I left `check_predicate` as in original, and it also matches other `should_*`, see the definitions just above.

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

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


More information about the hotspot-compiler-dev mailing list