equal
deleted
inserted
replaced
2229 // node. For CFG nodes, the _nodes array starts out and remains |
2229 // node. For CFG nodes, the _nodes array starts out and remains |
2230 // holding the associated IdealLoopTree pointer. For DATA nodes, the |
2230 // holding the associated IdealLoopTree pointer. For DATA nodes, the |
2231 // _nodes array holds the earliest legal controlling CFG node. |
2231 // _nodes array holds the earliest legal controlling CFG node. |
2232 |
2232 |
2233 // Allocate stack with enough space to avoid frequent realloc |
2233 // Allocate stack with enough space to avoid frequent realloc |
2234 int stack_size = (C->unique() >> 1) + 16; // (unique>>1)+16 from Java2D stats |
2234 int stack_size = (C->live_nodes() >> 1) + 16; // (live_nodes>>1)+16 from Java2D stats |
2235 Node_Stack nstack( a, stack_size ); |
2235 Node_Stack nstack( a, stack_size ); |
2236 |
2236 |
2237 visited.Clear(); |
2237 visited.Clear(); |
2238 Node_List worklist(a); |
2238 Node_List worklist(a); |
2239 // Don't need C->root() on worklist since |
2239 // Don't need C->root() on worklist since |
2689 if (_dom_depth[i] > 0 && _idom[i] != NULL) { |
2689 if (_dom_depth[i] > 0 && _idom[i] != NULL) { |
2690 _dom_depth[i] = no_depth_marker; |
2690 _dom_depth[i] = no_depth_marker; |
2691 } |
2691 } |
2692 } |
2692 } |
2693 if (_dom_stk == NULL) { |
2693 if (_dom_stk == NULL) { |
2694 uint init_size = C->unique() / 100; // Guess that 1/100 is a reasonable initial size. |
2694 uint init_size = C->live_nodes() / 100; // Guess that 1/100 is a reasonable initial size. |
2695 if (init_size < 10) init_size = 10; |
2695 if (init_size < 10) init_size = 10; |
2696 _dom_stk = new GrowableArray<uint>(init_size); |
2696 _dom_stk = new GrowableArray<uint>(init_size); |
2697 } |
2697 } |
2698 // Compute new depth for each node. |
2698 // Compute new depth for each node. |
2699 for (i = 0; i < _idom_size; i++) { |
2699 for (i = 0; i < _idom_size; i++) { |
2779 // I need to inspect loop header pre-order numbers to properly nest my |
2779 // I need to inspect loop header pre-order numbers to properly nest my |
2780 // loops. This means I need to sort my childrens' loops by pre-order. |
2780 // loops. This means I need to sort my childrens' loops by pre-order. |
2781 // The sort is of size number-of-control-children, which generally limits |
2781 // The sort is of size number-of-control-children, which generally limits |
2782 // it to size 2 (i.e., I just choose between my 2 target loops). |
2782 // it to size 2 (i.e., I just choose between my 2 target loops). |
2783 void PhaseIdealLoop::build_loop_tree() { |
2783 void PhaseIdealLoop::build_loop_tree() { |
2784 // Allocate stack of size C->unique()/2 to avoid frequent realloc |
2784 // Allocate stack of size C->live_nodes()/2 to avoid frequent realloc |
2785 GrowableArray <Node *> bltstack(C->unique() >> 1); |
2785 GrowableArray <Node *> bltstack(C->live_nodes() >> 1); |
2786 Node *n = C->root(); |
2786 Node *n = C->root(); |
2787 bltstack.push(n); |
2787 bltstack.push(n); |
2788 int pre_order = 1; |
2788 int pre_order = 1; |
2789 int stack_size; |
2789 int stack_size; |
2790 |
2790 |
3670 #ifndef PRODUCT |
3670 #ifndef PRODUCT |
3671 //------------------------------dump------------------------------------------- |
3671 //------------------------------dump------------------------------------------- |
3672 void PhaseIdealLoop::dump( ) const { |
3672 void PhaseIdealLoop::dump( ) const { |
3673 ResourceMark rm; |
3673 ResourceMark rm; |
3674 Arena* arena = Thread::current()->resource_area(); |
3674 Arena* arena = Thread::current()->resource_area(); |
3675 Node_Stack stack(arena, C->unique() >> 2); |
3675 Node_Stack stack(arena, C->live_nodes() >> 2); |
3676 Node_List rpo_list; |
3676 Node_List rpo_list; |
3677 VectorSet visited(arena); |
3677 VectorSet visited(arena); |
3678 visited.set(C->top()->_idx); |
3678 visited.set(C->top()->_idx); |
3679 rpo( C->root(), stack, visited, rpo_list ); |
3679 rpo( C->root(), stack, visited, rpo_list ); |
3680 // Dump root loop indexed by last element in PO order |
3680 // Dump root loop indexed by last element in PO order |