RFR: 8259316: [REDO] C1/C2 compiler support for blackholes
Aleksey Shipilev
shade at openjdk.java.net
Wed Mar 31 15:47:27 UTC 2021
On Fri, 19 Mar 2021 09:47:15 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
>> This reworks the compiler support for blackholes. The key difference against the last version (#1203) is that blackholes are only acceptable as empty static methods, which both simplifies the implementation and eliminates a few compatibility questions.
>
> src/hotspot/share/ci/ciMethod.cpp line 160:
>
>> 158:
>> 159: if (CompilerOracle::should_blackhole(h_m)) {
>> 160: h_m->set_intrinsic_id(vmIntrinsics::_blackhole);
>
> Wouldn't it be better to do this in `Method::init_intrinsic_id` so that JVMCI will also see the method as an intrinsic? Either that or a similar bit of logic should be added to `JVMCIRuntime::compile_method`.
The way C1 and C2 see this as synthetic intrinsic is modeled after `vmIntrinsics::_compiledLambdaForm`. Unfortunately, `Method::init_intrinsic_id` does not have access to `CompilerOracle` (which is solvable), and current placement in `ciMethod` constructor guarantees the method is resolved. I wonder if JVMCI would benefit from the direct `shouldBlackholeMethod`, like it already has `shouldInlineMethod`?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2024
More information about the hotspot-dev
mailing list