RFR(S) 8077504: Unsafe load can loose control dependency and cause crash

Roland Westrelin roland.westrelin at oracle.com
Mon May 18 08:04:27 UTC 2015


>>> BTW, should we modify LoadNode::hash() to include _depends_only_on_test and prevent igvning?
>> 
>> If the graph already has a non-pinned LoadNode and we add a pinned LoadNode with the same inputs, it’s safe for GVN to replace the pinned LoadNode by the non-pinned LoadNode, otherwise it wouldn’t be safe to have a non pinned LoadNode with those inputs in the first place. If the graph already has a pinned LoadNode and we add a non pinned LoadNode with the same inputs, it’s safe for GVN to replace the non-pinned LoadNode by the pinned LoadNode. It’s also suboptimal but better than 2 LoadNodes?
> 
> Okay. Add comment to _depends_only_on_test field why we don't use it in hash().

I added the comment. Thanks for the review.
I had the change go through a performance run to be safe and I found no regression so I’m pushing this.

Roland.

> 
> Thanks,
> Vladimir
> 
>> 
>> I guess we could change LoadNode::hash() and then use LoadNode::Identity/Ideal to make sure the pinned LoadNode is always replaced by the non-pinned LoadNode in the scenarios above but that sounds like extra complexity for something that, as far as we know, never happens in practice.
>> 
>> Roland.
>> 
>> 
>>> 
>>> Thanks,
>>> Vladimir
>>> 
>>> On 4/24/15 1:03 AM, Roland Westrelin wrote:
>>>> 
>>>>> Vladimir suggested privately to set _depends_only_on_test to true in the constructor and then use an explicit call to a new a method set_depends_only_on_test() to set it to false in the rare cases where it’s needed. That feels better indeed. What do you think?
>>>> 
>>>> Actually, using a set_depends_only_on_test() method doesn’t work well. In LibraryCallKit::inline_unsafe_access() the node returned by make_load() may have been transformed already and we could call set_depends_only_on_test() on a node that doesn’t need to be pinned. The call to set_depends_only_on_test() would have to be in LoadNode::make(). I went with default parameters instead to keep the change small:
>>>> 
>>>> http://cr.openjdk.java.net/~roland/8077504/webrev.01/
>>>> 
>>>> Roland.
>>>> 
>> 



More information about the hotspot-compiler-dev mailing list