Mercurial > hg > truffle
comparison src/share/vm/opto/compile.cpp @ 17812:a7d4d4655766
Merge
author | kvn |
---|---|
date | Wed, 26 Mar 2014 18:21:05 -0700 |
parents | 62c54fcc0a35 |
children | 31e28ee4c9b4 |
comparison
equal
deleted
inserted
replaced
17789:6b207d038106 | 17812:a7d4d4655766 |
---|---|
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), |
866 // for the original deopt pc. | 870 // for the original deopt pc. |
867 | 871 |
868 _orig_pc_slot = fixed_slots(); | 872 _orig_pc_slot = fixed_slots(); |
869 int next_slot = _orig_pc_slot + (sizeof(address) / VMRegImpl::stack_slot_size); | 873 int next_slot = _orig_pc_slot + (sizeof(address) / VMRegImpl::stack_slot_size); |
870 set_fixed_slots(next_slot); | 874 set_fixed_slots(next_slot); |
875 | |
876 // Compute when to use implicit null checks. Used by matching trap based | |
877 // nodes and NullCheck optimization. | |
878 set_allowed_deopt_reasons(); | |
871 | 879 |
872 // Now generate code | 880 // Now generate code |
873 Code_Gen(); | 881 Code_Gen(); |
874 if (failing()) return; | 882 if (failing()) return; |
875 | 883 |
945 _node_bundling_base(NULL), | 953 _node_bundling_base(NULL), |
946 _java_calls(0), | 954 _java_calls(0), |
947 _inner_loops(0), | 955 _inner_loops(0), |
948 #ifndef PRODUCT | 956 #ifndef PRODUCT |
949 _trace_opto_output(TraceOptoOutput), | 957 _trace_opto_output(TraceOptoOutput), |
958 _in_dump_cnt(0), | |
950 _printer(NULL), | 959 _printer(NULL), |
951 #endif | 960 #endif |
952 _dead_node_list(comp_arena()), | 961 _dead_node_list(comp_arena()), |
953 _dead_node_count(0), | 962 _dead_node_count(0), |
954 _congraph(NULL), | 963 _congraph(NULL), |
956 _number_of_mh_late_inlines(0), | 965 _number_of_mh_late_inlines(0), |
957 _inlining_progress(false), | 966 _inlining_progress(false), |
958 _inlining_incrementally(false), | 967 _inlining_incrementally(false), |
959 _print_inlining_list(NULL), | 968 _print_inlining_list(NULL), |
960 _print_inlining_idx(0), | 969 _print_inlining_idx(0), |
961 _preserve_jvm_state(0) { | 970 _preserve_jvm_state(0), |
971 _allowed_reasons(0) { | |
962 C = this; | 972 C = this; |
963 | 973 |
964 #ifndef PRODUCT | 974 #ifndef PRODUCT |
965 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); | 975 TraceTime t1(NULL, &_t_totalCompilation, TimeCompiler, false); |
966 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); | 976 TraceTime t2(NULL, &_t_stubCompilation, TimeCompiler, false); |
2275 // Apply peephole optimizations | 2285 // Apply peephole optimizations |
2276 if( OptoPeephole ) { | 2286 if( OptoPeephole ) { |
2277 NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); ) | 2287 NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); ) |
2278 PhasePeephole peep( _regalloc, cfg); | 2288 PhasePeephole peep( _regalloc, cfg); |
2279 peep.do_transform(); | 2289 peep.do_transform(); |
2290 } | |
2291 | |
2292 // Do late expand if CPU requires this. | |
2293 if (Matcher::require_postalloc_expand) { | |
2294 NOT_PRODUCT(TracePhase t2c("postalloc_expand", &_t_postalloc_expand, true)); | |
2295 cfg.postalloc_expand(_regalloc); | |
2280 } | 2296 } |
2281 | 2297 |
2282 // Convert Nodes to instruction bits in a buffer | 2298 // Convert Nodes to instruction bits in a buffer |
2283 { | 2299 { |
2284 // %%%% workspace merge brought two timers together for one job | 2300 // %%%% workspace merge brought two timers together for one job |
3335 // The coast is clear. | 3351 // The coast is clear. |
3336 return false; | 3352 return false; |
3337 } | 3353 } |
3338 } | 3354 } |
3339 | 3355 |
3356 // Compute when not to trap. Used by matching trap based nodes and | |
3357 // NullCheck optimization. | |
3358 void Compile::set_allowed_deopt_reasons() { | |
3359 _allowed_reasons = 0; | |
3360 if (is_method_compilation()) { | |
3361 for (int rs = (int)Deoptimization::Reason_none+1; rs < Compile::trapHistLength; rs++) { | |
3362 assert(rs < BitsPerInt, "recode bit map"); | |
3363 if (!too_many_traps((Deoptimization::DeoptReason) rs)) { | |
3364 _allowed_reasons |= nth_bit(rs); | |
3365 } | |
3366 } | |
3367 } | |
3368 } | |
3340 | 3369 |
3341 #ifndef PRODUCT | 3370 #ifndef PRODUCT |
3342 //------------------------------verify_graph_edges--------------------------- | 3371 //------------------------------verify_graph_edges--------------------------- |
3343 // Walk the Graph and verify that there is a one-to-one correspondence | 3372 // Walk the Graph and verify that there is a one-to-one correspondence |
3344 // between Use-Def edges and Def-Use edges in the graph. | 3373 // between Use-Def edges and Def-Use edges in the graph. |