766
767 // methods in the compile queue need to be marked as used on the stack
768 // so that they don't get reclaimed by Redefine Classes
769 void CompileQueue::mark_on_stack() {
770 CompileTask* task = _first;
771 while (task != NULL) {
772 task->mark_on_stack();
773 task = task->next();
774 }
775 }
776
777
778 CompileQueue* CompileBroker::compile_queue(int comp_level) {
779 if (is_c2_compile(comp_level)) return _c2_compile_queue;
780 if (is_c1_compile(comp_level)) return _c1_compile_queue;
781 return NULL;
782 }
783
784
785 void CompileBroker::print_compile_queues(outputStream* st) {
786 _c1_compile_queue->print(st);
787 _c2_compile_queue->print(st);
788 }
789
790
791 void CompileQueue::print(outputStream* st) {
792 assert_locked_or_safepoint(lock());
793 st->print_cr("Contents of %s", name());
794 st->print_cr("----------------------------");
795 CompileTask* task = _first;
796 if (task == NULL) {
797 st->print_cr("Empty");;
798 } else {
799 while (task != NULL) {
800 task->print_compilation(st, NULL, true, true);
801 task = task->next();
802 }
803 }
804 st->print_cr("----------------------------");
805 }
806
807 void CompileQueue::print_tty() {
808 ttyLocker ttyl;
809 print(tty);
810 }
811
812 CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
813
814 _current_method[0] = '\0';
815 _compile_type = CompileBroker::no_compile;
816
817 if (UsePerfData) {
|
766
767 // methods in the compile queue need to be marked as used on the stack
768 // so that they don't get reclaimed by Redefine Classes
769 void CompileQueue::mark_on_stack() {
770 CompileTask* task = _first;
771 while (task != NULL) {
772 task->mark_on_stack();
773 task = task->next();
774 }
775 }
776
777
778 CompileQueue* CompileBroker::compile_queue(int comp_level) {
779 if (is_c2_compile(comp_level)) return _c2_compile_queue;
780 if (is_c1_compile(comp_level)) return _c1_compile_queue;
781 return NULL;
782 }
783
784
785 void CompileBroker::print_compile_queues(outputStream* st) {
786 if (_c1_compile_queue != NULL) {
787 _c1_compile_queue->print_with_lock(st);
788 }
789 if (_c2_compile_queue != NULL) {
790 _c2_compile_queue->print_with_lock(st);
791 }
792 }
793
794 void CompileQueue::print_with_lock(outputStream* st) {
795 MutexLocker locker(lock());
796 print(st);
797 }
798
799 void CompileQueue::print(outputStream* st) {
800 assert(lock()->owned_by_self(), "must own lock");
801 st->print_cr("Contents of %s", name());
802 st->print_cr("----------------------------");
803 CompileTask* task = _first;
804 if (task == NULL) {
805 st->print_cr("Empty");
806 } else {
807 while (task != NULL) {
808 task->print_compilation(st, NULL, true, true);
809 task = task->next();
810 }
811 }
812 st->print_cr("----------------------------");
813 }
814
815 void CompileQueue::print_tty() {
816 ttyLocker ttyl;
817 print(tty);
818 }
819
820 CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
821
822 _current_method[0] = '\0';
823 _compile_type = CompileBroker::no_compile;
824
825 if (UsePerfData) {
|