513
514 // methods in the compile queue need to be marked as used on the stack
515 // so that they don't get reclaimed by Redefine Classes
516 void CompileQueue::mark_on_stack() {
517 CompileTask* task = _first;
518 while (task != NULL) {
519 task->mark_on_stack();
520 task = task->next();
521 }
522 }
523
524
525 CompileQueue* CompileBroker::compile_queue(int comp_level) {
526 if (is_c2_compile(comp_level)) return _c2_compile_queue;
527 if (is_c1_compile(comp_level)) return _c1_compile_queue;
528 return NULL;
529 }
530
531 void CompileBroker::print_compile_queues(outputStream* st) {
532 st->print_cr("Current compiles: ");
533 MutexLocker locker(MethodCompileQueue_lock);
534
535 char buf[2000];
536 int buflen = sizeof(buf);
537 Threads::print_threads_compiling(st, buf, buflen);
538
539 st->cr();
540 if (_c1_compile_queue != NULL) {
541 _c1_compile_queue->print(st);
542 }
543 if (_c2_compile_queue != NULL) {
544 _c2_compile_queue->print(st);
545 }
546 }
547
548 void CompileQueue::print(outputStream* st) {
549 assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
550 st->print_cr("%s:", name());
551 CompileTask* task = _first;
552 if (task == NULL) {
553 st->print_cr("Empty");
554 } else {
555 while (task != NULL) {
556 task->print(st, NULL, true, true);
557 task = task->next();
558 }
559 }
560 st->cr();
561 }
562
563 void CompileQueue::print_tty() {
564 ttyLocker ttyl;
565 print(tty);
566 }
567
568 CompilerCounters::CompilerCounters() {
569 _current_method[0] = '\0';
|
513
514 // methods in the compile queue need to be marked as used on the stack
515 // so that they don't get reclaimed by Redefine Classes
516 void CompileQueue::mark_on_stack() {
517 CompileTask* task = _first;
518 while (task != NULL) {
519 task->mark_on_stack();
520 task = task->next();
521 }
522 }
523
524
525 CompileQueue* CompileBroker::compile_queue(int comp_level) {
526 if (is_c2_compile(comp_level)) return _c2_compile_queue;
527 if (is_c1_compile(comp_level)) return _c1_compile_queue;
528 return NULL;
529 }
530
531 void CompileBroker::print_compile_queues(outputStream* st) {
532 st->print_cr("Current compiles: ");
533
534 char buf[2000];
535 int buflen = sizeof(buf);
536 Threads::print_threads_compiling(st, buf, buflen);
537
538 st->cr();
539 if (_c1_compile_queue != NULL) {
540 _c1_compile_queue->print(st);
541 }
542 if (_c2_compile_queue != NULL) {
543 _c2_compile_queue->print(st);
544 }
545 }
546
547 void CompileQueue::print(outputStream* st) {
548 assert_locked_or_safepoint(MethodCompileQueue_lock);
549 st->print_cr("%s:", name());
550 CompileTask* task = _first;
551 if (task == NULL) {
552 st->print_cr("Empty");
553 } else {
554 while (task != NULL) {
555 task->print(st, NULL, true, true);
556 task = task->next();
557 }
558 }
559 st->cr();
560 }
561
562 void CompileQueue::print_tty() {
563 ttyLocker ttyl;
564 print(tty);
565 }
566
567 CompilerCounters::CompilerCounters() {
568 _current_method[0] = '\0';
|