Request for reviews (S): 7143491: G1 C2 CTW: assert(p2x->outcnt() == 2) failed: expects 2 users: Xor and URShift nodes

Tom Rodriguez tom.rodriguez at oracle.com
Tue Feb 7 16:42:34 PST 2012


On Feb 7, 2012, at 4:25 PM, Vladimir Kozlov wrote:

> Tom Rodriguez wrote:
>> On Feb 7, 2012, at 3:05 PM, Vladimir Kozlov wrote:
>>> http://cr.openjdk.java.net/~kvn/7143491/webrev
>>> 
>>> 7143491: G1 C2 CTW: assert(p2x->outcnt() == 2) failed: expects 2 users: Xor and URShift nodes
>>> 
>>> Constant Propagation or other ideal graph transformation may stored oop value withi NULL oop. As result part of G1 post barrier code (under the value check for NULL) become dead and removed.
>>> 
>>> Adjust the assert and code in eliminate_card_mark() method for such case. I also added the value transformation before generating store's barriers since it could be transformed to NULL and as results barriers will not be needed.
>> Is it safe do this in general?  I know it will be fine it _gvn is a PhaseGVN but if it's a PhaseIterGVN then we could free val which could still be used in the caller.
> 
> My push failed. It seems, even in PhaseGVN we can't call transform() at that place. I replaced transform() call with explicit NULL type check and using NULL constant:
> 
> +   if (_gvn.type(val) == TypePtr::NULL_PTR)
> +     val = _gvn.makecon(TypePtr::NULL_PTR);
> 
> This way it does not affect passed val node.

That seems safer.  Looks good.

tom

> 
> Vladimir
> 
>> tom
>>> Verified with failed test.
>>> 
>>> Thanks,
>>> Vladimir



More information about the hotspot-compiler-dev mailing list