Request for reviews (XL): 7147744: CTW: assert(false) failed: infinite EA connection graph build

Vladimir Kozlov vladimir.kozlov at
Mon Mar 5 16:03:52 PST 2012

Rearranged code in escape.cpp to move compute_escape() and related methods to 
the beginning of file. Moved parts of code in compute_escape() into separate 
methods: complete_connection_graph(), verify_connection_graph(), 
optimize_ideal_graph(). Split build_connection_graph() into 2 methods: 
add_node_to_connection_graph() and add_final_edges().

Replaced next patterns:
     uint ecnt = use->edge_count();
     for (uint j = 0; j < ecnt; j++) {
       PointsToNode* e = use->edge(j);

with simple iterators (EdgeIterator, UseIterator, BaseIterator):

     for (EdgeIterator i(use); i.has_next(); {
       PointsToNode* e = i.get();


Tom Rodriguez wrote:
> On Mar 2, 2012, at 2:42 PM, Vladimir Kozlov wrote:
>> Thank you, Tom
>> Tom Rodriguez wrote:
>>> Are you preparing a new webrev for this issue?
>> No. Last update I have is based on Christian's comments and it is mostly the same as original:
>> And I waited your comments to do final version.
>>> I don't have anything too concrete to say.  It looks ok and I think the structure seems a big nicer.  compute_escape desperately needs to be broken into multiple functions, particularly the verify code.  It's very hard to see the core structure.
>> I do want it to be easy to understand so I will try to break it to several functions.
> The big comments describing the different steps are helpful but they are so far apart it's hard to hold onto the whole structure.
> Part of the problem is that writing C2 code is somewhat verbose.  These patterns for instance:
>       uint ucnt = base->use_count();
>       for (uint j = 0; j < ucnt; j++) {
>         PointsToNode* arycp = base->use(j);
> might be done more compactly with an iterator similar to SimpleDUIterator.  I've often though it would be useful to have an iterator with a predicate built in so you could say things like:
>   for (SimpleDUIterator<is_ArrayCopy> i(n); i.has_next(); {
>     ..
>   }
> to concisely visit particular node types.
> tom
>> I may also rearrange it since I don't like that main method compute_escape() is somewhere in the middle of the source file.
>>> build_connection_graph feels like it should be broken into two functions or at least that final switch should.  All the if (first_iteration) tests make it hard to follow since the else side if almost always empty.
>> OK. I will look on it.
>>> There are a lot of odd empty lines that just seems to spread the code out instead of separating logical things.  I'm not a huge fan of vertical white space.  Anyway, nothing above is something that needs to be fixed for this bug fix.
>> I will try to clean up some.
>> Thanks,
>> Vladimir
>>> tom
>>> On Feb 29, 2012, at 12:58 PM, Vladimir Kozlov wrote:
>>>> I rerun tests again and see difference because of 7146442 fix and not these changes. I have to look again on code in find_init_values() and may be do loads/stores domination checks.
>>>> Thanks,
>>>> Vladimir
>>>> Vladimir Kozlov wrote:
>>>>> Yes, I verified with refworkload benchmarks and EA tests I have. I compared PrintEliminateAllocations and PrintEliminateLocks output.
>>>>> Thanks,
>>>>> Vladimir
>>>>> Tom Rodriguez wrote:
>>>>>> I'm looking at it but it's pretty much a complete rewrite so it's hard to review.  At a certain level it's going to mostly be a rubber stamp.  Did you verify that it produces the same results as the old algorithm?
>>>>>> tom
>>>>>> On Feb 28, 2012, at 2:01 PM, Vladimir Kozlov wrote:
>>>>>>> Please, I need a review for this.
>>>>>>> Thanks,
>>>>>>> Vladimir
>>>>>>> Vladimir Kozlov wrote:
>>>>>>>> 7147744: CTW: assert(false) failed: infinite EA connection graph build
>>>>>>>> I rewrote Connection graph construction code in EA to reduce time spent there. In the bug's test time reduced by 100 (from about 50 to .5 sec on Nahalem-EX machine).
>>>>>>>> Connection graph now has specialized classes for nodes and additional use edges to put on worklist only uses of node which added new point edge. Field node has also bases edges. Edges never removed only added.
>>>>>>>> Instead of looking for Field's bases from the start create simple base edge to LocalVar during initial graph construction in build_connection_graph(). Late do several iteration to push all known JavaObject nodes references through graph. This phase has limits on number and time. Also on each iteration check if there are non globally escaped objects and bail out from code if not.
>>>>>>>> Added additional Arraycopy node to connect source and destination objects.
>>>>>>>> I removed uncast() calls so that all LocalVar nodes point to all related JavaObject nodes.
>>>>>>>> I combined record_for_escape_analysis() and build_connection_graph() into one method.
>>>>>>>> Added TracePhase around Connection graph build code to see how much time spent there.
>>>>>>>> This code need addition work since I still saw outlier (10 min in EA) in sje2010 on SPARC. But I will look on it after this one is done.
>>>>>>>> I added new GrowableArray method delete_at(i) to avoid shifting following elements which is done in remove_at(i) method.
>>>>>>>> Thanks,
>>>>>>>> Vladimir

More information about the hotspot-compiler-dev mailing list