src/share/vm/opto/compile.cpp

changeset 10015
eb7ce841ccec
parent 9931
fd44df5e3bc3
parent 9985
8712be1ae49a
equal deleted inserted replaced
9934:2251ba078bec 10015:eb7ce841ccec
1168 _macro_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); 1168 _macro_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL);
1169 _predicate_opaqs = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); 1169 _predicate_opaqs = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL);
1170 _expensive_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); 1170 _expensive_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL);
1171 _range_check_casts = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); 1171 _range_check_casts = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL);
1172 register_library_intrinsics(); 1172 register_library_intrinsics();
1173 #ifdef ASSERT
1174 _type_verify_symmetry = true;
1175 #endif
1173 } 1176 }
1174 1177
1175 //---------------------------init_start---------------------------------------- 1178 //---------------------------init_start----------------------------------------
1176 // Install the StartNode on this compile object. 1179 // Install the StartNode on this compile object.
1177 void Compile::init_start(StartNode* s) { 1180 void Compile::init_start(StartNode* s) {
2081 2084
2082 set_inlining_incrementally(false); 2085 set_inlining_incrementally(false);
2083 } 2086 }
2084 2087
2085 2088
2089 // Remove edges from "root" to each SafePoint at a backward branch.
2090 // They were inserted during parsing (see add_safepoint()) to make
2091 // infinite loops without calls or exceptions visible to root, i.e.,
2092 // useful.
2093 void Compile::remove_root_to_sfpts_edges() {
2094 Node *r = root();
2095 if (r != NULL) {
2096 for (uint i = r->req(); i < r->len(); ++i) {
2097 Node *n = r->in(i);
2098 if (n != NULL && n->is_SafePoint()) {
2099 r->rm_prec(i);
2100 --i;
2101 }
2102 }
2103 }
2104 }
2105
2086 //------------------------------Optimize--------------------------------------- 2106 //------------------------------Optimize---------------------------------------
2087 // Given a graph, optimize it. 2107 // Given a graph, optimize it.
2088 void Compile::Optimize() { 2108 void Compile::Optimize() {
2089 TracePhase t1("optimizer", &_t_optimizer, true); 2109 TracePhase t1("optimizer", &_t_optimizer, true);
2090 2110
2135 2155
2136 print_method(PHASE_INCREMENTAL_BOXING_INLINE, 2); 2156 print_method(PHASE_INCREMENTAL_BOXING_INLINE, 2);
2137 2157
2138 if (failing()) return; 2158 if (failing()) return;
2139 } 2159 }
2160
2161 // Now that all inlining is over, cut edge from root to loop
2162 // safepoints
2163 remove_root_to_sfpts_edges();
2140 2164
2141 // Remove the speculative part of types and clean up the graph from 2165 // Remove the speculative part of types and clean up the graph from
2142 // the extra CastPP nodes whose only purpose is to carry them. Do 2166 // the extra CastPP nodes whose only purpose is to carry them. Do
2143 // that early so that optimizations are not disrupted by the extra 2167 // that early so that optimizations are not disrupted by the extra
2144 // CastPP nodes. 2168 // CastPP nodes.
3018 if (use->is_Proj() && p != use && use->as_Proj()->_con == p->_con) { 3042 if (use->is_Proj() && p != use && use->as_Proj()->_con == p->_con) {
3019 proj = use; 3043 proj = use;
3020 break; 3044 break;
3021 } 3045 }
3022 } 3046 }
3023 assert(proj != NULL, "must be found"); 3047 assert(proj != NULL || p->_con == TypeFunc::I_O, "io may be dropped at an infinite loop");
3024 p->subsume_by(proj, this); 3048 if (proj != NULL) {
3049 p->subsume_by(proj, this);
3050 }
3025 } 3051 }
3026 } 3052 }
3027 break; 3053 break;
3028 } 3054 }
3029 3055

mercurial