RFR: JDK-8213381: Hook to allow GC to inject Node::Ideal() calls
vladimir.kozlov at oracle.com
Tue Nov 6 16:48:17 UTC 2018
On 11/6/18 8:17 AM, Erik Österlund wrote:
> Hi Roman,
> Looks good.
> On 2018-11-06 14:28, Roman Kennke wrote:
>> It now appears to me that for sake of consistency, we shall probably
>> provide a similar hook for Identity() (and we might actually have a use
>> for this in Shenandoah too). This is a bit more involved, because
>> Identity() seems to be called from a few places around the code. I made
>> the two PhaseGVN::apply_ideal(..) and PhaseGVN::apply_identity(..)
>> methods public for this reason. Other than that, same concept as
>> previous patch:
>>> Shenandoah injects a couple of reshapings into some implementations of
>>> Node::Ideal() (namely CallLeafNode::Ideal() and CmpPNode::Ideal()). I
>>> propose to provide a hook into BarrierSetC2 to better abstract this.
>>> This might be useful for other GCs too.
>>> The approach that I've chosen here is to call BSC2::ideal_node(..) from
>>> the places in phaseX.cpp where we also call Node::Ideal(..). I've
>>> introduced a helper method to do this: first call BSC2::ideal_node(..),
>>> if that returns NULL, call into the usual Node::Ideal(..).
>>> BarrierSetC2::ideal_node(..) must follow the same contract as
>>> Node::Ideal(..) of course.
>>> Testing: hotspot/jtreg:tier1 passes locally.
>>> Can I please get reviews?
More information about the hotspot-gc-dev