comparison src/share/vm/opto/compile.cpp @ 12295:1b64d46620a3

8022585: VM crashes when ran with -XX:+PrintInlining Summary: use adr_at() to access inline info structures in growableArray. Add ability to specify print inlining per method. Reviewed-by: twisti
author kvn
date Tue, 24 Sep 2013 16:08:00 -0700
parents 884ed7a10f09
children 4a2acfb16e97
comparison
equal deleted inserted replaced
12294:891687731b59 12295:1b64d46620a3
652 _late_inlines_pos(0), 652 _late_inlines_pos(0),
653 _number_of_mh_late_inlines(0), 653 _number_of_mh_late_inlines(0),
654 _inlining_progress(false), 654 _inlining_progress(false),
655 _inlining_incrementally(false), 655 _inlining_incrementally(false),
656 _print_inlining_list(NULL), 656 _print_inlining_list(NULL),
657 _print_inlining(0) { 657 _print_inlining_idx(0) {
658 C = this; 658 C = this;
659 659
660 CompileWrapper cw(this); 660 CompileWrapper cw(this);
661 #ifndef PRODUCT 661 #ifndef PRODUCT
662 if (TimeCompiler2) { 662 if (TimeCompiler2) {
677 } 677 }
678 } 678 }
679 set_print_assembly(print_opto_assembly); 679 set_print_assembly(print_opto_assembly);
680 set_parsed_irreducible_loop(false); 680 set_parsed_irreducible_loop(false);
681 #endif 681 #endif
682 set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining));
683 set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics"));
682 684
683 if (ProfileTraps) { 685 if (ProfileTraps) {
684 // Make sure the method being compiled gets its own MDO, 686 // Make sure the method being compiled gets its own MDO,
685 // so we can at least track the decompile_count(). 687 // so we can at least track the decompile_count().
686 method()->ensure_method_data(); 688 method()->ensure_method_data();
708 uint estimated_size = method()->code_size()*4+64; 710 uint estimated_size = method()->code_size()*4+64;
709 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size); 711 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size);
710 PhaseGVN gvn(node_arena(), estimated_size); 712 PhaseGVN gvn(node_arena(), estimated_size);
711 set_initial_gvn(&gvn); 713 set_initial_gvn(&gvn);
712 714
713 if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { 715 if (print_inlining() || print_intrinsics()) {
714 _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer()); 716 _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer());
715 } 717 }
716 { // Scope for timing the parser 718 { // Scope for timing the parser
717 TracePhase t3("parse", &_t_parser, true); 719 TracePhase t3("parse", &_t_parser, true);
718 720
935 _congraph(NULL), 937 _congraph(NULL),
936 _number_of_mh_late_inlines(0), 938 _number_of_mh_late_inlines(0),
937 _inlining_progress(false), 939 _inlining_progress(false),
938 _inlining_incrementally(false), 940 _inlining_incrementally(false),
939 _print_inlining_list(NULL), 941 _print_inlining_list(NULL),
940 _print_inlining(0) { 942 _print_inlining_idx(0) {
941 C = this; 943 C = this;
942 944
943 #ifndef PRODUCT 945 #ifndef PRODUCT
944 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); 946 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
945 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); 947 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
3609 cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); 3611 cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
3610 } 3612 }
3611 } 3613 }
3612 3614
3613 void Compile::dump_inlining() { 3615 void Compile::dump_inlining() {
3614 if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { 3616 if (print_inlining() || print_intrinsics()) {
3615 // Print inlining message for candidates that we couldn't inline 3617 // Print inlining message for candidates that we couldn't inline
3616 // for lack of space or non constant receiver 3618 // for lack of space or non constant receiver
3617 for (int i = 0; i < _late_inlines.length(); i++) { 3619 for (int i = 0; i < _late_inlines.length(); i++) {
3618 CallGenerator* cg = _late_inlines.at(i); 3620 CallGenerator* cg = _late_inlines.at(i);
3619 cg->print_inlining_late("live nodes > LiveNodeCountInliningCutoff"); 3621 cg->print_inlining_late("live nodes > LiveNodeCountInliningCutoff");
3633 if ( m == NULL ) continue; 3635 if ( m == NULL ) continue;
3634 useful.push(m); 3636 useful.push(m);
3635 } 3637 }
3636 } 3638 }
3637 for (int i = 0; i < _print_inlining_list->length(); i++) { 3639 for (int i = 0; i < _print_inlining_list->length(); i++) {
3638 tty->print(_print_inlining_list->at(i).ss()->as_string()); 3640 tty->print(_print_inlining_list->adr_at(i)->ss()->as_string());
3639 } 3641 }
3640 } 3642 }
3641 } 3643 }
3642 3644
3643 int Compile::cmp_expensive_nodes(Node* n1, Node* n2) { 3645 int Compile::cmp_expensive_nodes(Node* n1, Node* n2) {