614 615 Ticks _latest_stage_start_counter; 616 617 void begin_method() { 618 #ifndef PRODUCT 619 if (_printer && _printer->should_print(1)) { 620 _printer->begin_method(); 621 } 622 #endif 623 C->_latest_stage_start_counter.stamp(); 624 } 625 626 bool should_print(int level = 1) { 627 #ifndef PRODUCT 628 return (_printer && _printer->should_print(level)); 629 #else 630 return false; 631 #endif 632 } 633 634 void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0) { 635 EventCompilerPhase event; 636 if (event.should_commit()) { 637 CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level); 638 } 639 640 #ifndef PRODUCT 641 if (should_print(level)) { 642 char output[1024]; 643 if (idx != 0) { 644 jio_snprintf(output, sizeof(output), "%s:%d", CompilerPhaseTypeHelper::to_string(cpt), idx); 645 } else { 646 jio_snprintf(output, sizeof(output), "%s", CompilerPhaseTypeHelper::to_string(cpt)); 647 } 648 _printer->print_method(output, level); 649 } 650 #endif 651 C->_latest_stage_start_counter.stamp(); 652 } 653 654 #ifndef PRODUCT 655 void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false); 656 void igv_print_method_to_network(const char* phase_name = "Debug"); 657 static IdealGraphPrinter* debug_file_printer() { return _debug_file_printer; } 658 static IdealGraphPrinter* debug_network_printer() { return _debug_network_printer; } 659 #endif 660 661 void end_method(int level = 1) { 662 EventCompilerPhase event; 663 if (event.should_commit()) { 664 CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, PHASE_END, C->_compile_id, level); 665 } 666 667 #ifndef PRODUCT 668 if (_printer && _printer->should_print(level)) { 669 _printer->end_method(); 670 } 671 #endif 672 } 673 674 int macro_count() const { return _macro_nodes->length(); } 675 int predicate_count() const { return _predicate_opaqs->length();} 676 int expensive_count() const { return _expensive_nodes->length(); } 677 Node* macro_node(int idx) const { return _macro_nodes->at(idx); } 678 Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);} 679 Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); } 680 ConnectionGraph* congraph() { return _congraph;} 681 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} 682 void add_macro_node(Node * n) { 683 //assert(n->is_macro(), "must be a macro node"); 684 assert(!_macro_nodes->contains(n), "duplicate entry in expand list"); 685 _macro_nodes->append(n); 686 } 687 void remove_macro_node(Node * n) { 688 // this function may be called twice for a node so check 689 // that the node is in the array before attempting to remove it 690 if (_macro_nodes->contains(n)) 691 _macro_nodes->remove(n); 692 // remove from _predicate_opaqs list also if it is there | 614 615 Ticks _latest_stage_start_counter; 616 617 void begin_method() { 618 #ifndef PRODUCT 619 if (_printer && _printer->should_print(1)) { 620 _printer->begin_method(); 621 } 622 #endif 623 C->_latest_stage_start_counter.stamp(); 624 } 625 626 bool should_print(int level = 1) { 627 #ifndef PRODUCT 628 return (_printer && _printer->should_print(level)); 629 #else 630 return false; 631 #endif 632 } 633 634 inline void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0); 635 636 #ifndef PRODUCT 637 void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false); 638 void igv_print_method_to_network(const char* phase_name = "Debug"); 639 static IdealGraphPrinter* debug_file_printer() { return _debug_file_printer; } 640 static IdealGraphPrinter* debug_network_printer() { return _debug_network_printer; } 641 #endif 642 643 inline void end_method(int level = 1); 644 645 int macro_count() const { return _macro_nodes->length(); } 646 int predicate_count() const { return _predicate_opaqs->length();} 647 int expensive_count() const { return _expensive_nodes->length(); } 648 Node* macro_node(int idx) const { return _macro_nodes->at(idx); } 649 Node* predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);} 650 Node* expensive_node(int idx) const { return _expensive_nodes->at(idx); } 651 ConnectionGraph* congraph() { return _congraph;} 652 void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} 653 void add_macro_node(Node * n) { 654 //assert(n->is_macro(), "must be a macro node"); 655 assert(!_macro_nodes->contains(n), "duplicate entry in expand list"); 656 _macro_nodes->append(n); 657 } 658 void remove_macro_node(Node * n) { 659 // this function may be called twice for a node so check 660 // that the node is in the array before attempting to remove it 661 if (_macro_nodes->contains(n)) 662 _macro_nodes->remove(n); 663 // remove from _predicate_opaqs list also if it is there |