diff -r 1ecb986334cb -r 9010e596f391 src/hotspot/cpu/arm/macroAssembler_arm.cpp --- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp Fri Feb 16 11:22:53 2018 -0800 +++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp Fri Feb 16 14:23:30 2018 -0800 @@ -1316,98 +1316,6 @@ str(obj_end, Address(Rthread, JavaThread::tlab_top_offset())); } -void MacroAssembler::tlab_refill(Register top, Register tmp1, Register tmp2, - Register tmp3, Register tmp4, - Label& try_eden, Label& slow_case) { - if (!Universe::heap()->supports_inline_contig_alloc()) { - b(slow_case); - return; - } - - InlinedAddress intArrayKlass_addr((address)Universe::intArrayKlassObj_addr()); - Label discard_tlab, do_refill; - ldr(top, Address(Rthread, JavaThread::tlab_top_offset())); - ldr(tmp1, Address(Rthread, JavaThread::tlab_end_offset())); - ldr(tmp2, Address(Rthread, JavaThread::tlab_refill_waste_limit_offset())); - - // Calculate amount of free space - sub(tmp1, tmp1, top); - // Retain tlab and allocate in shared space - // if the amount of free space in tlab is too large to discard - cmp(tmp2, AsmOperand(tmp1, lsr, LogHeapWordSize)); - b(discard_tlab, ge); - - // Increment waste limit to prevent getting stuck on this slow path - mov_slow(tmp3, ThreadLocalAllocBuffer::refill_waste_limit_increment()); - add(tmp2, tmp2, tmp3); - str(tmp2, Address(Rthread, JavaThread::tlab_refill_waste_limit_offset())); - if (TLABStats) { - ldr_u32(tmp2, Address(Rthread, JavaThread::tlab_slow_allocations_offset())); - add_32(tmp2, tmp2, 1); - str_32(tmp2, Address(Rthread, JavaThread::tlab_slow_allocations_offset())); - } - b(try_eden); - bind_literal(intArrayKlass_addr); - - bind(discard_tlab); - if (TLABStats) { - ldr_u32(tmp2, Address(Rthread, JavaThread::tlab_number_of_refills_offset())); - ldr_u32(tmp3, Address(Rthread, JavaThread::tlab_fast_refill_waste_offset())); - add_32(tmp2, tmp2, 1); - add_32(tmp3, tmp3, AsmOperand(tmp1, lsr, LogHeapWordSize)); - str_32(tmp2, Address(Rthread, JavaThread::tlab_number_of_refills_offset())); - str_32(tmp3, Address(Rthread, JavaThread::tlab_fast_refill_waste_offset())); - } - // If tlab is currently allocated (top or end != null) - // then fill [top, end + alignment_reserve) with array object - cbz(top, do_refill); - - // Set up the mark word - mov_slow(tmp2, (intptr_t)markOopDesc::prototype()->copy_set_hash(0x2)); - str(tmp2, Address(top, oopDesc::mark_offset_in_bytes())); - // Set klass to intArrayKlass and the length to the remaining space - ldr_literal(tmp2, intArrayKlass_addr); - add(tmp1, tmp1, ThreadLocalAllocBuffer::alignment_reserve_in_bytes() - - typeArrayOopDesc::header_size(T_INT) * HeapWordSize); - Register klass = tmp2; - ldr(klass, Address(tmp2)); - logical_shift_right(tmp1, tmp1, LogBytesPerInt); // divide by sizeof(jint) - str_32(tmp1, Address(top, arrayOopDesc::length_offset_in_bytes())); - store_klass(klass, top); // blows klass: - klass = noreg; - - ldr(tmp1, Address(Rthread, JavaThread::tlab_start_offset())); - sub(tmp1, top, tmp1); // size of tlab's allocated portion - incr_allocated_bytes(tmp1, tmp2); - - bind(do_refill); - // Refill the tlab with an eden allocation - ldr(tmp1, Address(Rthread, JavaThread::tlab_size_offset())); - logical_shift_left(tmp4, tmp1, LogHeapWordSize); - eden_allocate(top, tmp1, tmp2, tmp3, tmp4, slow_case); - str(top, Address(Rthread, JavaThread::tlab_start_offset())); - str(top, Address(Rthread, JavaThread::tlab_top_offset())); - -#ifdef ASSERT - // Verify that tmp1 contains tlab_end - ldr(tmp2, Address(Rthread, JavaThread::tlab_size_offset())); - add(tmp2, top, AsmOperand(tmp2, lsl, LogHeapWordSize)); - cmp(tmp1, tmp2); - breakpoint(ne); -#endif - - sub(tmp1, tmp1, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); - str(tmp1, Address(Rthread, JavaThread::tlab_end_offset())); - - if (ZeroTLAB) { - // clobbers start and tmp - // top must be preserved! - add(tmp1, tmp1, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); - ldr(tmp2, Address(Rthread, JavaThread::tlab_start_offset())); - zero_memory(tmp2, tmp1, tmp3); - } -} - // Fills memory regions [start..end] with zeroes. Clobbers `start` and `tmp` registers. void MacroAssembler::zero_memory(Register start, Register end, Register tmp) { Label loop;