RFR: 8252505: C1/C2 compiler support for blackholes [v11]

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Dec 2 18:26:15 UTC 2020


> Unfortunately, not. In JMH, `Blackhole` methods are instance methods (they have state), and that plays nicely with compatibility: when JIT fails to provide blackholing, it would naturally fall back to old behavior. I think null check for receiver is the fair behavior here, as subsequent optimization may expect receiver null-checked after the call. I have not seen null-checks in my `perfasm` runs with C1, though.

It will "consume" and keep it alive the receiver, but have you 
considered passing receiver explicitly as an argument?

If you want to keep instance method support, please, double-check that 
null check stays there for correctness.

Best regards,
Vladimir Ivanov


More information about the hotspot-dev mailing list