hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
changeset 24008 da7059252295
parent 22505 4523090c9674
child 24328 bddefb356fba
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp	Fri Apr 11 00:35:28 2014 +0400
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp	Thu Apr 10 23:15:13 2014 -0700
@@ -630,11 +630,20 @@
   }
 
  protected:
+  // Insert a nop if the previous is cbcond
+  void insert_nop_after_cbcond() {
+    if (UseCBCond && cbcond_before()) {
+      nop();
+    }
+  }
   // Delay slot helpers
   // cti is called when emitting control-transfer instruction,
   // BEFORE doing the emitting.
   // Only effective when assertion-checking is enabled.
   void cti() {
+    // A cbcond instruction immediately followed by a CTI
+    // instruction introduces pipeline stalls, we need to avoid that.
+    no_cbcond_before();
 #ifdef CHECK_DELAY
     assert_not_delayed("cti should not be in delay slot");
 #endif
@@ -658,7 +667,6 @@
   void no_cbcond_before() {
     assert(offset() == 0 || !cbcond_before(), "cbcond should not follow an other cbcond");
   }
-
 public:
 
   bool use_cbcond(Label& L) {