hotspot/src/share/vm/opto/compile.cpp
changeset 10252 0981ce1c3eef
parent 10012 31d52b0abd0b
child 10266 2ea344c79e33
--- a/hotspot/src/share/vm/opto/compile.cpp	Thu Jul 21 08:38:25 2011 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Thu Jul 21 11:25:07 2011 -0700
@@ -517,7 +517,17 @@
   buf.stubs()->initialize_shared_locs( &locs_buf[lsize * 2], lsize);
 
   // Do the emission.
+
+  Label fakeL; // Fake label for branch instructions.
+  bool is_branch = n->is_Branch() && n->as_Mach()->ideal_Opcode() != Op_Jump;
+  if (is_branch) {
+    MacroAssembler masm(&buf);
+    masm.bind(fakeL);
+    n->as_Mach()->label_set(&fakeL, 0);
+  }
   n->emit(buf, this->regalloc());
+  if (is_branch) // Clear the reference to fake label.
+    n->as_Mach()->label_set(NULL, 0);
 
   // End scratch_emit_size section.
   set_in_scratch_emit_size(false);