Re: 回复:[Patch] 8210853: C2 doesn't skip post barrier for new allocated objects

Tobias Hartmann tobias.hartmann at oracle.com
Mon Sep 24 13:34:28 UTC 2018


Hi Kevin,

On 24.09.2018 08:06, Kuai Wei wrote:
>   Thanks for your suggestion. I think your point is the region node may have new path in later parse
> phase, so we can not make sure the region node will be optimized.

Yes, my point is that a new path to the region might be added after your optimization and that path
might contain stores to the newly allocated object.

>   It's a good question and I checked it. Now I think it may not cause trouble. In post barrier
> reduce, the oop store use allocation node as base pointer. The data graph guarantee control of
> allocation node should dominate control of store. If allocation node is in pred of region node and
> there's a new path into region, the graph is bad because we can reach store without allocation.

Yes but the new path might be a backedge from a loop that is dominated by the allocation.

> If allocation node is in a domination ancestor, the graph shape is a little complicated, so we can not
> reach control of allocation by skipping one region.

Right, that's basically the implicit assumption of your patch. I'm not sure if it always holds. But
I think you should at least use RegionNode::is_copy().

Let's see what other reviewers think.

>   The better solution is we can know the region node is created in exit_map and we will not change
> it in later. Is there any way to know it in compile time?

The region node is created in Parse::build_exits(). I don't think there is a way to keep track of this.

Thanks,
Tobias


More information about the hotspot-compiler-dev mailing list