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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Dec 1 16:28:47 UTC 2020


>> `Matcher::match_sfpt()` has call-specific logic for different shapes. Having a special case for Blackhole which turns `CallBlackhole` into `MachCallBlackhole` fits it well.
>>
>> Since every AD instruction has a dedicated class, you can get rid of some additional changes if you customize matching logic for blackhole.
> 
> Tried a few approaches, but they seem unsatisfactory. In `Matcher::match_sfpt`, we either need to check for blackhole-ness around `MachNode *m = match_tree(call);` to avoid going for (non-existent) match or recovering in case of expected mismatch of blackhole, or we need to either add the new case before `if( sfpt->is_Call() )` and do the entire thing by ourselves.
> 
> Seems easier to just accept simple match rules in `.ad`, to be honest. I don't think maintainability is improved by hacking in blackhole handling in `Matcher::match_sfpt`.

What exactly do you see useful for blackhole inside `if( 
sfpt->is_Call())` branch? Everything except setting `tf()` looks 
irrelevant and you can cleanly capture that in MachCallBlackhole 
factory/ctor.

And don't forget about ADLC changes. Those can also go away / migrate to 
MachCallBlackhole.

Best regards,
Vladimir Ivanov


More information about the hotspot-dev mailing list