Mercurial > hg > truffle
comparison src/share/vm/opto/compile.cpp @ 7421:ad5dd04754ee
8005031: Some cleanup in c2 to prepare for incremental inlining support
Summary: collection of small changes to prepare for incremental inlining.
Reviewed-by: twisti, kvn
author | roland |
---|---|
date | Tue, 18 Dec 2012 14:55:25 +0100 |
parents | cd3d6a6b95d9 |
children | d092d1b31229 |
comparison
equal
deleted
inserted
replaced
7420:18d56ca3e901 | 7421:ad5dd04754ee |
---|---|
608 _dead_node_count(0), | 608 _dead_node_count(0), |
609 #ifndef PRODUCT | 609 #ifndef PRODUCT |
610 _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")), | 610 _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")), |
611 _printer(IdealGraphPrinter::printer()), | 611 _printer(IdealGraphPrinter::printer()), |
612 #endif | 612 #endif |
613 _congraph(NULL) { | 613 _congraph(NULL), |
614 _print_inlining_list(NULL), | |
615 _print_inlining(0) { | |
614 C = this; | 616 C = this; |
615 | 617 |
616 CompileWrapper cw(this); | 618 CompileWrapper cw(this); |
617 #ifndef PRODUCT | 619 #ifndef PRODUCT |
618 if (TimeCompiler2) { | 620 if (TimeCompiler2) { |
664 uint estimated_size = method()->code_size()*4+64; | 666 uint estimated_size = method()->code_size()*4+64; |
665 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size); | 667 estimated_size = (estimated_size < MINIMUM_NODE_HASH ? MINIMUM_NODE_HASH : estimated_size); |
666 PhaseGVN gvn(node_arena(), estimated_size); | 668 PhaseGVN gvn(node_arena(), estimated_size); |
667 set_initial_gvn(&gvn); | 669 set_initial_gvn(&gvn); |
668 | 670 |
671 if (PrintInlining) { | |
672 _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer()); | |
673 } | |
669 { // Scope for timing the parser | 674 { // Scope for timing the parser |
670 TracePhase t3("parse", &_t_parser, true); | 675 TracePhase t3("parse", &_t_parser, true); |
671 | 676 |
672 // Put top into the hash table ASAP. | 677 // Put top into the hash table ASAP. |
673 initial_gvn()->transform_no_reclaim(top()); | 678 initial_gvn()->transform_no_reclaim(top()); |
752 cg->do_late_inline(); | 757 cg->do_late_inline(); |
753 if (failing()) return; | 758 if (failing()) return; |
754 } | 759 } |
755 } | 760 } |
756 assert(_late_inlines.length() == 0, "should have been processed"); | 761 assert(_late_inlines.length() == 0, "should have been processed"); |
762 dump_inlining(); | |
757 | 763 |
758 print_method("Before RemoveUseless", 3); | 764 print_method("Before RemoveUseless", 3); |
759 | 765 |
760 // Remove clutter produced by parsing. | 766 // Remove clutter produced by parsing. |
761 if (!failing()) { | 767 if (!failing()) { |
897 _trace_opto_output(TraceOptoOutput), | 903 _trace_opto_output(TraceOptoOutput), |
898 _printer(NULL), | 904 _printer(NULL), |
899 #endif | 905 #endif |
900 _dead_node_list(comp_arena()), | 906 _dead_node_list(comp_arena()), |
901 _dead_node_count(0), | 907 _dead_node_count(0), |
902 _congraph(NULL) { | 908 _congraph(NULL), |
909 _print_inlining_list(NULL), | |
910 _print_inlining(0) { | |
903 C = this; | 911 C = this; |
904 | 912 |
905 #ifndef PRODUCT | 913 #ifndef PRODUCT |
906 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); | 914 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); |
907 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); | 915 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); |
3349 assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i))); | 3357 assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i))); |
3350 *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr); | 3358 *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr); |
3351 cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); | 3359 cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); |
3352 } | 3360 } |
3353 } | 3361 } |
3362 | |
3363 void Compile::dump_inlining() { | |
3364 if (PrintInlining) { | |
3365 for (int i = 0; i < _print_inlining_list->length(); i++) { | |
3366 tty->print(_print_inlining_list->at(i).ss()->as_string()); | |
3367 } | |
3368 } | |
3369 } |