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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Dec 3 12:44:40 UTC 2020



On 03.12.2020 15:36, Aleksey Shipilev wrote:
> On 12/3/20 12:46 PM, Vladimir Ivanov wrote:
>>> Actually, I don't think we need to ignore receiver in current code. It
>>> is a left-over from my experiments that were only taking care of
>>> primitive arguments. Since current code is much more simple, we can just
>>> blackhole everything. Done in new commits.
>>
>> Does it make more sense now to further limit the intrinsic to static
>> methods only?
> 
> AFAIU, current intrinsics look back at the original Java method shape. 
> So if we limit intrinsics to static methods, it would require 
> API-breaking changes in JMH (i.e. users who do explicit 
> Blackhole.consume calls), which I hope to avoid. Let's handle instance 
> methods.

You could introduce helper static methods and call them from 
Blackhole.consume(). That way you will avoid any API-level changes.

(That's how intrinsics are usually shaped: there's a Java wrapper 
exposed to users which does input validation and then calls into 
intrinsified method which is shaped in such a way to simplify JVM life 
as much as possible).

Best regards,
Vladimir Ivanov


More information about the hotspot-dev mailing list