--- old/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2016-01-06 15:09:35.041768253 -0800 +++ new/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2016-01-06 15:09:34.885768259 -0800 @@ -1,5 +1,5 @@ /* - * 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 @@ -3412,10 +3412,20 @@ // 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); + 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); + } - // increment waste limit to prevent getting stuck on this slow path - delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2); st_ptr(t2, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); if (TLABStats) { // increment number of slow_allocations