584 #endif
585 // Note: we do not have program counters for these exception handlers yet
586 exception_info_list()->push(new ExceptionInfo(pco, exception_handlers));
587 }
588
589
590 void Compilation::notice_inlined_method(ciMethod* method) {
591 _env->notice_inlined_method(method);
592 }
593
594
595 void Compilation::bailout(const char* msg) {
596 assert(msg != NULL, "bailout message must exist");
597 if (!bailed_out()) {
598 // keep first bailout message
599 if (PrintCompilation || PrintBailouts) tty->print_cr("compilation bailout: %s", msg);
600 _bailout_msg = msg;
601 }
602 }
603
604
605 void Compilation::print_timers() {
606 // tty->print_cr(" Native methods : %6.3f s, Average : %2.3f", CompileBroker::_t_native_compilation.seconds(), CompileBroker::_t_native_compilation.seconds() / CompileBroker::_total_native_compile_count);
607 float total = timers[_t_setup].seconds() + timers[_t_buildIR].seconds() + timers[_t_emit_lir].seconds() + timers[_t_lir_schedule].seconds() + timers[_t_codeemit].seconds() + timers[_t_codeinstall].seconds();
608
609
610 tty->print_cr(" Detailed C1 Timings");
611 tty->print_cr(" Setup time: %6.3f s (%4.1f%%)", timers[_t_setup].seconds(), (timers[_t_setup].seconds() / total) * 100.0);
612 tty->print_cr(" Build IR: %6.3f s (%4.1f%%)", timers[_t_buildIR].seconds(), (timers[_t_buildIR].seconds() / total) * 100.0);
613 float t_optimizeIR = timers[_t_optimize_blocks].seconds() + timers[_t_optimize_null_checks].seconds();
614 tty->print_cr(" Optimize: %6.3f s (%4.1f%%)", t_optimizeIR, (t_optimizeIR / total) * 100.0);
615 tty->print_cr(" RCE: %6.3f s (%4.1f%%)", timers[_t_rangeCheckElimination].seconds(), (timers[_t_rangeCheckElimination].seconds() / total) * 100.0);
616 tty->print_cr(" Emit LIR: %6.3f s (%4.1f%%)", timers[_t_emit_lir].seconds(), (timers[_t_emit_lir].seconds() / total) * 100.0);
617 tty->print_cr(" LIR Gen: %6.3f s (%4.1f%%)", timers[_t_lirGeneration].seconds(), (timers[_t_lirGeneration].seconds() / total) * 100.0);
618 tty->print_cr(" Linear Scan: %6.3f s (%4.1f%%)", timers[_t_linearScan].seconds(), (timers[_t_linearScan].seconds() / total) * 100.0);
619 NOT_PRODUCT(LinearScan::print_timers(timers[_t_linearScan].seconds()));
620 tty->print_cr(" LIR Schedule: %6.3f s (%4.1f%%)", timers[_t_lir_schedule].seconds(), (timers[_t_lir_schedule].seconds() / total) * 100.0);
621 tty->print_cr(" Code Emission: %6.3f s (%4.1f%%)", timers[_t_codeemit].seconds(), (timers[_t_codeemit].seconds() / total) * 100.0);
622 tty->print_cr(" Code Installation: %6.3f s (%4.1f%%)", timers[_t_codeinstall].seconds(), (timers[_t_codeinstall].seconds() / total) * 100.0);
623 tty->print_cr(" Instruction Nodes: %6d nodes", totalInstructionNodes);
|
584 #endif
585 // Note: we do not have program counters for these exception handlers yet
586 exception_info_list()->push(new ExceptionInfo(pco, exception_handlers));
587 }
588
589
590 void Compilation::notice_inlined_method(ciMethod* method) {
591 _env->notice_inlined_method(method);
592 }
593
594
595 void Compilation::bailout(const char* msg) {
596 assert(msg != NULL, "bailout message must exist");
597 if (!bailed_out()) {
598 // keep first bailout message
599 if (PrintCompilation || PrintBailouts) tty->print_cr("compilation bailout: %s", msg);
600 _bailout_msg = msg;
601 }
602 }
603
604 ciKlass* Compilation::cha_exact_type(ciType* type) {
605 if (type != NULL && type->is_loaded() && type->is_instance_klass()) {
606 ciInstanceKlass* ik = type->as_instance_klass();
607 assert(ik->exact_klass() == NULL, "no cha for final klass");
608 if (DeoptC1 && UseCHA && !(ik->has_subklass() || ik->is_interface())) {
609 dependency_recorder()->assert_leaf_type(ik);
610 return ik;
611 }
612 }
613 return NULL;
614 }
615
616 void Compilation::print_timers() {
617 // tty->print_cr(" Native methods : %6.3f s, Average : %2.3f", CompileBroker::_t_native_compilation.seconds(), CompileBroker::_t_native_compilation.seconds() / CompileBroker::_total_native_compile_count);
618 float total = timers[_t_setup].seconds() + timers[_t_buildIR].seconds() + timers[_t_emit_lir].seconds() + timers[_t_lir_schedule].seconds() + timers[_t_codeemit].seconds() + timers[_t_codeinstall].seconds();
619
620
621 tty->print_cr(" Detailed C1 Timings");
622 tty->print_cr(" Setup time: %6.3f s (%4.1f%%)", timers[_t_setup].seconds(), (timers[_t_setup].seconds() / total) * 100.0);
623 tty->print_cr(" Build IR: %6.3f s (%4.1f%%)", timers[_t_buildIR].seconds(), (timers[_t_buildIR].seconds() / total) * 100.0);
624 float t_optimizeIR = timers[_t_optimize_blocks].seconds() + timers[_t_optimize_null_checks].seconds();
625 tty->print_cr(" Optimize: %6.3f s (%4.1f%%)", t_optimizeIR, (t_optimizeIR / total) * 100.0);
626 tty->print_cr(" RCE: %6.3f s (%4.1f%%)", timers[_t_rangeCheckElimination].seconds(), (timers[_t_rangeCheckElimination].seconds() / total) * 100.0);
627 tty->print_cr(" Emit LIR: %6.3f s (%4.1f%%)", timers[_t_emit_lir].seconds(), (timers[_t_emit_lir].seconds() / total) * 100.0);
628 tty->print_cr(" LIR Gen: %6.3f s (%4.1f%%)", timers[_t_lirGeneration].seconds(), (timers[_t_lirGeneration].seconds() / total) * 100.0);
629 tty->print_cr(" Linear Scan: %6.3f s (%4.1f%%)", timers[_t_linearScan].seconds(), (timers[_t_linearScan].seconds() / total) * 100.0);
630 NOT_PRODUCT(LinearScan::print_timers(timers[_t_linearScan].seconds()));
631 tty->print_cr(" LIR Schedule: %6.3f s (%4.1f%%)", timers[_t_lir_schedule].seconds(), (timers[_t_lir_schedule].seconds() / total) * 100.0);
632 tty->print_cr(" Code Emission: %6.3f s (%4.1f%%)", timers[_t_codeemit].seconds(), (timers[_t_codeemit].seconds() / total) * 100.0);
633 tty->print_cr(" Code Installation: %6.3f s (%4.1f%%)", timers[_t_codeinstall].seconds(), (timers[_t_codeinstall].seconds() / total) * 100.0);
634 tty->print_cr(" Instruction Nodes: %6d nodes", totalInstructionNodes);
|