comparison src/share/vm/opto/compile.cpp @ 14456:abec000618bf

Merge
author kvn
date Tue, 28 Jan 2014 12:25:34 -0800
parents 183bd5c00828 41b780b43b74
children 45467c53f178
comparison
equal deleted inserted replaced
14269:2a8891e0a082 14456:abec000618bf
80 # include "adfiles/ad_zero.hpp" 80 # include "adfiles/ad_zero.hpp"
81 #endif 81 #endif
82 #ifdef TARGET_ARCH_MODEL_arm 82 #ifdef TARGET_ARCH_MODEL_arm
83 # include "adfiles/ad_arm.hpp" 83 # include "adfiles/ad_arm.hpp"
84 #endif 84 #endif
85 #ifdef TARGET_ARCH_MODEL_ppc 85 #ifdef TARGET_ARCH_MODEL_ppc_32
86 # include "adfiles/ad_ppc.hpp" 86 # include "adfiles/ad_ppc_32.hpp"
87 #endif
88 #ifdef TARGET_ARCH_MODEL_ppc_64
89 # include "adfiles/ad_ppc_64.hpp"
87 #endif 90 #endif
88 91
89 92
90 // -------------------- Compile::mach_constant_base_node ----------------------- 93 // -------------------- Compile::mach_constant_base_node -----------------------
91 // Constant table base node singleton. 94 // Constant table base node singleton.
643 _in_scratch_emit_size(false), 646 _in_scratch_emit_size(false),
644 _dead_node_list(comp_arena()), 647 _dead_node_list(comp_arena()),
645 _dead_node_count(0), 648 _dead_node_count(0),
646 #ifndef PRODUCT 649 #ifndef PRODUCT
647 _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")), 650 _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")),
651 _in_dump_cnt(0),
648 _printer(IdealGraphPrinter::printer()), 652 _printer(IdealGraphPrinter::printer()),
649 #endif 653 #endif
650 _congraph(NULL), 654 _congraph(NULL),
651 _replay_inline_data(NULL), 655 _replay_inline_data(NULL),
652 _late_inlines(comp_arena(), 2, 0, NULL), 656 _late_inlines(comp_arena(), 2, 0, NULL),
868 // for the original deopt pc. 872 // for the original deopt pc.
869 873
870 _orig_pc_slot = fixed_slots(); 874 _orig_pc_slot = fixed_slots();
871 int next_slot = _orig_pc_slot + (sizeof(address) / VMRegImpl::stack_slot_size); 875 int next_slot = _orig_pc_slot + (sizeof(address) / VMRegImpl::stack_slot_size);
872 set_fixed_slots(next_slot); 876 set_fixed_slots(next_slot);
877
878 // Compute when to use implicit null checks. Used by matching trap based
879 // nodes and NullCheck optimization.
880 set_allowed_deopt_reasons();
873 881
874 // Now generate code 882 // Now generate code
875 Code_Gen(); 883 Code_Gen();
876 if (failing()) return; 884 if (failing()) return;
877 885
946 _node_bundling_base(NULL), 954 _node_bundling_base(NULL),
947 _java_calls(0), 955 _java_calls(0),
948 _inner_loops(0), 956 _inner_loops(0),
949 #ifndef PRODUCT 957 #ifndef PRODUCT
950 _trace_opto_output(TraceOptoOutput), 958 _trace_opto_output(TraceOptoOutput),
959 _in_dump_cnt(0),
951 _printer(NULL), 960 _printer(NULL),
952 #endif 961 #endif
953 _dead_node_list(comp_arena()), 962 _dead_node_list(comp_arena()),
954 _dead_node_count(0), 963 _dead_node_count(0),
955 _congraph(NULL), 964 _congraph(NULL),
957 _number_of_mh_late_inlines(0), 966 _number_of_mh_late_inlines(0),
958 _inlining_progress(false), 967 _inlining_progress(false),
959 _inlining_incrementally(false), 968 _inlining_incrementally(false),
960 _print_inlining_list(NULL), 969 _print_inlining_list(NULL),
961 _print_inlining_idx(0), 970 _print_inlining_idx(0),
962 _preserve_jvm_state(0) { 971 _preserve_jvm_state(0),
972 _allowed_reasons(0) {
963 C = this; 973 C = this;
964 974
965 #ifndef PRODUCT 975 #ifndef PRODUCT
966 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); 976 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false);
967 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); 977 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false);
2260 // Apply peephole optimizations 2270 // Apply peephole optimizations
2261 if( OptoPeephole ) { 2271 if( OptoPeephole ) {
2262 NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); ) 2272 NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); )
2263 PhasePeephole peep( _regalloc, cfg); 2273 PhasePeephole peep( _regalloc, cfg);
2264 peep.do_transform(); 2274 peep.do_transform();
2275 }
2276
2277 // Do late expand if CPU requires this.
2278 if (Matcher::require_postalloc_expand) {
2279 NOT_PRODUCT(TracePhase t2c("postalloc_expand", &_t_postalloc_expand, true));
2280 cfg.postalloc_expand(_regalloc);
2265 } 2281 }
2266 2282
2267 // Convert Nodes to instruction bits in a buffer 2283 // Convert Nodes to instruction bits in a buffer
2268 { 2284 {
2269 // %%%% workspace merge brought two timers together for one job 2285 // %%%% workspace merge brought two timers together for one job
3353 // The coast is clear. 3369 // The coast is clear.
3354 return false; 3370 return false;
3355 } 3371 }
3356 } 3372 }
3357 3373
3374 // Compute when not to trap. Used by matching trap based nodes and
3375 // NullCheck optimization.
3376 void Compile::set_allowed_deopt_reasons() {
3377 _allowed_reasons = 0;
3378 if (is_method_compilation()) {
3379 for (int rs = (int)Deoptimization::Reason_none+1; rs < Compile::trapHistLength; rs++) {
3380 assert(rs < BitsPerInt, "recode bit map");
3381 if (!too_many_traps((Deoptimization::DeoptReason) rs)) {
3382 _allowed_reasons |= nth_bit(rs);
3383 }
3384 }
3385 }
3386 }
3358 3387
3359 #ifndef PRODUCT 3388 #ifndef PRODUCT
3360 //------------------------------verify_graph_edges--------------------------- 3389 //------------------------------verify_graph_edges---------------------------
3361 // Walk the Graph and verify that there is a one-to-one correspondence 3390 // Walk the Graph and verify that there is a one-to-one correspondence
3362 // between Use-Def edges and Def-Use edges in the graph. 3391 // between Use-Def edges and Def-Use edges in the graph.