Request for reviews (M): 7059047: EA: can't find initializing store with several CheckCastPP
vladimir.kozlov at oracle.com
Tue Nov 1 13:59:18 PDT 2011
Thank you, Tom
Tom Rodriguez wrote:
> I'm not sure I follow the distinction that's being made with ControlEscape, or ArgEscape for that matter. They seem to be about what optimizations we can do on an object more than whether they are escaping or not, which makes the naming confusing. Or am I misunderstand what's happening? Is this how they would be translated?
> NoEscape == ScalarReplaceable
> ControlEscape == NonEscaping
> ArgEscape == LocallyEscaping
> GlobalEscape == GlobalEcaping
Your translation is correct. Yes, the states define optimizations we can do with
> Would be it be possible to come up with more descriptive names for these states?
How about your translation names?
> Why is has_non_escaping_obj assigned to twice?
> // mark all nodes reachable from ArgEscape nodes
> ! has_non_escaping_obj = propagate_escape_state(&cg_worklist, &worklist, PointsToNode::ArgEscape);
> ! // mark all nodes reachable from ControlEscape nodes
> ! has_non_escaping_obj = propagate_escape_state(&cg_worklist, &worklist, PointsToNode::ControlEscape);
> Should the second one be |=?
You are right. My bad.
> Do we eliminate locking on ControlEscape objects?
Yes, the same as ArgEscape.
I will add code for 7105605 to fold CmpP for NoEscape and ControlEscape objects.
I don't think it will be safe to do for ArgEscape.
An other optimization I am thinking for ControlEscape objects is eliminating
loads from it as we do for ScalarReplaceable objects.
> On Nov 1, 2011, at 11:41 AM, Vladimir Kozlov wrote:
>> 7059047: EA: can't find initializing store with several CheckCastPP
>> Added new escape state: ControlEscape. Use it instead of ArgEscape and (NoEscape && !_scalar_replaceable) in cases where not escaped objects can't be scalar replaced because of flow-insensitive analysis limitations. It is preparation for 7105605 changes.
>> Split adjust_escape_state() method into two. New find_init_values() method is used to find fields initializing values for not escaped allocations. It is called before deferred edges are removed since it affects results. adjust_escape_state() now is called after all deferred edges are removed to get correct results.
>> Factored out escape state propagation code into new method propagate_escape_state().
>> Removed methods is_scalar_replaceable() and hidden_alias() which are not used and corresponding fields in PointsToNode (which will reduce used memory).
>> Tested with CTW, jtreg, NSK, refworkload.
More information about the hotspot-compiler-dev