< prev index next >

src/cpu/sparc/vm/macroAssembler_sparc.cpp

Print this page
rev 9785 : [mq]: webrev.00
rev 9786 : [mq]: webrev.010

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -3410,14 +3410,24 @@
   srl_ptr(t1, LogHeapWordSize, t1);
 
   // Retain tlab and allocate object in shared space if
   // the amount free in the tlab is too large to discard.
   cmp(t1, t2);
-  brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab);
 
-  // increment waste limit to prevent getting stuck on this slow path
+  brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab);
+  if (Assembler::is_simm13(ThreadLocalAllocBuffer::refill_waste_limit_increment())) {
   delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2);
+  } else {
+    delayed()->nop();
+    // set64 does not use the temp register if the given constant is 32 bit. So
+    // we can just use any register; using G0 results in ignoring of the upper 32 bit
+    // of that value.
+    set64(ThreadLocalAllocBuffer::refill_waste_limit_increment(), t3, G0);
+    // increment waste limit to prevent getting stuck on this slow path
+    add(t2, t3, t2);
+  }
+
   st_ptr(t2, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()));
   if (TLABStats) {
     // increment number of slow_allocations
     ld(G2_thread, in_bytes(JavaThread::tlab_slow_allocations_offset()), t2);
     add(t2, 1, t2);
< prev index next >