639 } 640 return find_non_split_ctrl(n); 641 } 642 Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag ); 643 644 // Helper function for directing control inputs away from CFG split 645 // points. 646 Node *find_non_split_ctrl( Node *ctrl ) const { 647 if (ctrl != NULL) { 648 if (ctrl->is_MultiBranch()) { 649 ctrl = ctrl->in(0); 650 } 651 assert(ctrl->is_CFG(), "CFG"); 652 } 653 return ctrl; 654 } 655 656 bool cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop); 657 658 public: 659 bool has_node( Node* n ) const { 660 guarantee(n != NULL, "No Node."); 661 return _nodes[n->_idx] != NULL; 662 } 663 // check if transform created new nodes that need _ctrl recorded 664 Node *get_late_ctrl( Node *n, Node *early ); 665 Node *get_early_ctrl( Node *n ); 666 Node *get_early_ctrl_for_expensive(Node *n, Node* earliest); 667 void set_early_ctrl( Node *n ); 668 void set_subtree_ctrl( Node *root ); 669 void set_ctrl( Node *n, Node *ctrl ) { 670 assert( !has_node(n) || has_ctrl(n), "" ); 671 assert( ctrl->in(0), "cannot set dead control node" ); 672 assert( ctrl == find_non_split_ctrl(ctrl), "must set legal crtl" ); 673 _nodes.map( n->_idx, (Node*)((intptr_t)ctrl + 1) ); 674 } 675 // Set control and update loop membership 676 void set_ctrl_and_loop(Node* n, Node* ctrl) { 677 IdealLoopTree* old_loop = get_loop(get_ctrl(n)); 678 IdealLoopTree* new_loop = get_loop(ctrl); | 639 } 640 return find_non_split_ctrl(n); 641 } 642 Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag ); 643 644 // Helper function for directing control inputs away from CFG split 645 // points. 646 Node *find_non_split_ctrl( Node *ctrl ) const { 647 if (ctrl != NULL) { 648 if (ctrl->is_MultiBranch()) { 649 ctrl = ctrl->in(0); 650 } 651 assert(ctrl->is_CFG(), "CFG"); 652 } 653 return ctrl; 654 } 655 656 bool cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop); 657 658 public: 659 660 static bool is_canonical_main_loop_entry(CountedLoopNode* cl); 661 662 bool has_node( Node* n ) const { 663 guarantee(n != NULL, "No Node."); 664 return _nodes[n->_idx] != NULL; 665 } 666 // check if transform created new nodes that need _ctrl recorded 667 Node *get_late_ctrl( Node *n, Node *early ); 668 Node *get_early_ctrl( Node *n ); 669 Node *get_early_ctrl_for_expensive(Node *n, Node* earliest); 670 void set_early_ctrl( Node *n ); 671 void set_subtree_ctrl( Node *root ); 672 void set_ctrl( Node *n, Node *ctrl ) { 673 assert( !has_node(n) || has_ctrl(n), "" ); 674 assert( ctrl->in(0), "cannot set dead control node" ); 675 assert( ctrl == find_non_split_ctrl(ctrl), "must set legal crtl" ); 676 _nodes.map( n->_idx, (Node*)((intptr_t)ctrl + 1) ); 677 } 678 // Set control and update loop membership 679 void set_ctrl_and_loop(Node* n, Node* ctrl) { 680 IdealLoopTree* old_loop = get_loop(get_ctrl(n)); 681 IdealLoopTree* new_loop = get_loop(ctrl); |