7097679: Tiered: events with bad bci to Gotos reduced from Ifs
authoriveresov
Tue, 04 Oct 2011 10:07:07 -0700
changeset 10730 38dcf027574e
parent 10571 956e26fdfc4f
child 10731 ffe24d6f0575
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
hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Sep 30 13:48:17 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Tue Oct 04 10:07:07 2011 -0700
@@ -1165,11 +1165,11 @@
   Goto *x = new Goto(block_at(to_bci), to_bci <= from_bci);
   if (is_profiling()) {
     compilation()->set_would_profile(true);
-  }
-  if (profile_branches()) {
-    x->set_profiled_method(method());
     x->set_profiled_bci(bci());
-    x->set_should_profile(true);
+    if (profile_branches()) {
+      x->set_profiled_method(method());
+      x->set_should_profile(true);
+    }
   }
   append(x);
 }
@@ -1203,9 +1203,9 @@
     Goto *goto_node = i->as_Goto();
     if (goto_node != NULL) {
       compilation()->set_would_profile(true);
+      goto_node->set_profiled_bci(bci());
       if (profile_branches()) {
         goto_node->set_profiled_method(method());
-        goto_node->set_profiled_bci(bci());
         goto_node->set_should_profile(true);
         // Find out which successor is used.
         if (goto_node->default_sux() == tsux) {
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Sep 30 13:48:17 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Oct 04 10:07:07 2011 -0700
@@ -2493,7 +2493,7 @@
 
     // increment backedge counter if needed
     CodeEmitInfo* info = state_for(x, state);
-    increment_backedge_counter(info, info->stack()->bci());
+    increment_backedge_counter(info, x->profiled_bci());
     CodeEmitInfo* safepoint_info = state_for(x, state);
     __ safepoint(safepoint_poll_register(), safepoint_info);
   }