5583 Register tsize = rsi; 5584 assert_different_registers(tsize, thread_reg, t1); 5585 push(tsize); 5586 movptr(tsize, Address(thread_reg, in_bytes(JavaThread::tlab_size_offset()))); 5587 shlptr(tsize, LogHeapWordSize); 5588 cmpptr(t1, tsize); 5589 jcc(Assembler::equal, ok); 5590 STOP("assert(t1 != tlab size)"); 5591 should_not_reach_here(); 5592 5593 bind(ok); 5594 pop(tsize); 5595 } 5596 #endif 5597 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_start_offset())), top); 5598 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_top_offset())), top); 5599 addptr(top, t1); 5600 subptr(top, (int32_t)ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); 5601 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); 5602 5603 if (ZeroTLAB) { 5604 // This is a fast TLAB refill, therefore the GC is not notified of it. 5605 // So compiled code must fill the new TLAB with zeroes. 5606 movptr(top, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); 5607 zero_memory(top, t1, 0, t2); 5608 } 5609 5610 verify_tlab(); 5611 jmp(retry); 5612 5613 return thread_reg; // for use by caller 5614 } 5615 5616 // Preserves the contents of address, destroys the contents length_in_bytes and temp. 5617 void MacroAssembler::zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp) { 5618 assert(address != length_in_bytes && address != temp && temp != length_in_bytes, "registers must be different"); 5619 assert((offset_in_bytes & (BytesPerWord - 1)) == 0, "offset must be a multiple of BytesPerWord"); 5620 Label done; 5621 5622 testptr(length_in_bytes, length_in_bytes); | 5583 Register tsize = rsi; 5584 assert_different_registers(tsize, thread_reg, t1); 5585 push(tsize); 5586 movptr(tsize, Address(thread_reg, in_bytes(JavaThread::tlab_size_offset()))); 5587 shlptr(tsize, LogHeapWordSize); 5588 cmpptr(t1, tsize); 5589 jcc(Assembler::equal, ok); 5590 STOP("assert(t1 != tlab size)"); 5591 should_not_reach_here(); 5592 5593 bind(ok); 5594 pop(tsize); 5595 } 5596 #endif 5597 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_start_offset())), top); 5598 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_top_offset())), top); 5599 addptr(top, t1); 5600 subptr(top, (int32_t)ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); 5601 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); 5602 5603 // Currently, if this happens, just set back the actual end to where it was. 5604 // We miss a chance to sample here but it is a TODO. 5605 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_actual_end_offset())), top); 5606 5607 if (ZeroTLAB) { 5608 // This is a fast TLAB refill, therefore the GC is not notified of it. 5609 // So compiled code must fill the new TLAB with zeroes. 5610 movptr(top, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); 5611 zero_memory(top, t1, 0, t2); 5612 } 5613 5614 verify_tlab(); 5615 jmp(retry); 5616 5617 return thread_reg; // for use by caller 5618 } 5619 5620 // Preserves the contents of address, destroys the contents length_in_bytes and temp. 5621 void MacroAssembler::zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp) { 5622 assert(address != length_in_bytes && address != temp && temp != length_in_bytes, "registers must be different"); 5623 assert((offset_in_bytes & (BytesPerWord - 1)) == 0, "offset must be a multiple of BytesPerWord"); 5624 Label done; 5625 5626 testptr(length_in_bytes, length_in_bytes); |