707 } 708 } 709 710 if (make_not_entrant) { 711 nm->make_not_entrant(); 712 713 // Code cache state change is tracked in make_not_entrant() 714 if (PrintMethodFlushing && Verbose) { 715 tty->print_cr("### Nmethod %d/" PTR_FORMAT "made not-entrant: hotness counter %d/%d threshold %f", 716 nm->compile_id(), nm, nm->hotness_counter(), reset_val, threshold); 717 } 718 } 719 } 720 } 721 } 722 723 // Print out some state information about the current sweep and the 724 // state of the code cache if it's requested. 725 void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { 726 if (PrintMethodFlushing) { 727 stringStream s; 728 // Dump code cache state into a buffer before locking the tty, 729 // because log_state() will use locks causing lock conflicts. 730 CodeCache::log_state(&s); 731 732 ttyLocker ttyl; 733 tty->print("### sweeper: %s ", msg); 734 if (format != NULL) { 735 va_list ap; 736 va_start(ap, format); 737 tty->vprint(format, ap); 738 va_end(ap); 739 } 740 tty->print_cr("%s", s.as_string()); 741 } 742 743 if (LogCompilation && (xtty != NULL)) { 744 stringStream s; 745 // Dump code cache state into a buffer before locking the tty, 746 // because log_state() will use locks causing lock conflicts. 747 CodeCache::log_state(&s); 748 749 ttyLocker ttyl; 750 xtty->begin_elem("sweeper state='%s' traversals='" INTX_FORMAT "' ", msg, (intx)traversal_count()); 751 if (format != NULL) { 752 va_list ap; 753 va_start(ap, format); 754 xtty->vprint(format, ap); 755 va_end(ap); 756 } 757 xtty->print("%s", s.as_string()); 758 xtty->stamp(); 759 xtty->end_elem(); 760 } 761 } 762 763 void NMethodSweeper::print() { | 707 } 708 } 709 710 if (make_not_entrant) { 711 nm->make_not_entrant(); 712 713 // Code cache state change is tracked in make_not_entrant() 714 if (PrintMethodFlushing && Verbose) { 715 tty->print_cr("### Nmethod %d/" PTR_FORMAT "made not-entrant: hotness counter %d/%d threshold %f", 716 nm->compile_id(), nm, nm->hotness_counter(), reset_val, threshold); 717 } 718 } 719 } 720 } 721 } 722 723 // Print out some state information about the current sweep and the 724 // state of the code cache if it's requested. 725 void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { 726 if (PrintMethodFlushing) { 727 ResourceMark rm; 728 stringStream s; 729 // Dump code cache state into a buffer before locking the tty, 730 // because log_state() will use locks causing lock conflicts. 731 CodeCache::log_state(&s); 732 733 ttyLocker ttyl; 734 tty->print("### sweeper: %s ", msg); 735 if (format != NULL) { 736 va_list ap; 737 va_start(ap, format); 738 tty->vprint(format, ap); 739 va_end(ap); 740 } 741 tty->print_cr("%s", s.as_string()); 742 } 743 744 if (LogCompilation && (xtty != NULL)) { 745 ResourceMark rm; 746 stringStream s; 747 // Dump code cache state into a buffer before locking the tty, 748 // because log_state() will use locks causing lock conflicts. 749 CodeCache::log_state(&s); 750 751 ttyLocker ttyl; 752 xtty->begin_elem("sweeper state='%s' traversals='" INTX_FORMAT "' ", msg, (intx)traversal_count()); 753 if (format != NULL) { 754 va_list ap; 755 va_start(ap, format); 756 xtty->vprint(format, ap); 757 va_end(ap); 758 } 759 xtty->print("%s", s.as_string()); 760 xtty->stamp(); 761 xtty->end_elem(); 762 } 763 } 764 765 void NMethodSweeper::print() { |