comparison src/share/vm/c1/c1_GraphBuilder.cpp @ 3997:940513efe83a

7097679: Tiered: events with bad bci to Gotos reduced from Ifs Summary: Save bci of instruction that produced Goto and use it to call back to runtime Reviewed-by: kvn, never
author iveresov
date Tue, 04 Oct 2011 10:07:07 -0700
parents aa67216400d3
children 973293defacd
comparison
equal deleted inserted replaced
3966:5d871c1ff17c 3997:940513efe83a
1163 1163
1164 void GraphBuilder::_goto(int from_bci, int to_bci) { 1164 void GraphBuilder::_goto(int from_bci, int to_bci) {
1165 Goto *x = new Goto(block_at(to_bci), to_bci <= from_bci); 1165 Goto *x = new Goto(block_at(to_bci), to_bci <= from_bci);
1166 if (is_profiling()) { 1166 if (is_profiling()) {
1167 compilation()->set_would_profile(true); 1167 compilation()->set_would_profile(true);
1168 }
1169 if (profile_branches()) {
1170 x->set_profiled_method(method());
1171 x->set_profiled_bci(bci()); 1168 x->set_profiled_bci(bci());
1172 x->set_should_profile(true); 1169 if (profile_branches()) {
1170 x->set_profiled_method(method());
1171 x->set_should_profile(true);
1172 }
1173 } 1173 }
1174 append(x); 1174 append(x);
1175 } 1175 }
1176 1176
1177 1177
1201 1201
1202 // Check if this If was reduced to Goto. 1202 // Check if this If was reduced to Goto.
1203 Goto *goto_node = i->as_Goto(); 1203 Goto *goto_node = i->as_Goto();
1204 if (goto_node != NULL) { 1204 if (goto_node != NULL) {
1205 compilation()->set_would_profile(true); 1205 compilation()->set_would_profile(true);
1206 goto_node->set_profiled_bci(bci());
1206 if (profile_branches()) { 1207 if (profile_branches()) {
1207 goto_node->set_profiled_method(method()); 1208 goto_node->set_profiled_method(method());
1208 goto_node->set_profiled_bci(bci());
1209 goto_node->set_should_profile(true); 1209 goto_node->set_should_profile(true);
1210 // Find out which successor is used. 1210 // Find out which successor is used.
1211 if (goto_node->default_sux() == tsux) { 1211 if (goto_node->default_sux() == tsux) {
1212 goto_node->set_direction(Goto::taken); 1212 goto_node->set_direction(Goto::taken);
1213 } else if (goto_node->default_sux() == fsux) { 1213 } else if (goto_node->default_sux() == fsux) {