3467 } |
3467 } |
3468 #endif // ASSERT |
3468 #endif // ASSERT |
3469 add(top, t1, top); // t1 is tlab_size |
3469 add(top, t1, top); // t1 is tlab_size |
3470 sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); |
3470 sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); |
3471 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); |
3471 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); |
|
3472 |
|
3473 if (ZeroTLAB) { |
|
3474 // This is a fast TLAB refill, therefore the GC is not notified of it. |
|
3475 // So compiled code must fill the new TLAB with zeroes. |
|
3476 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t2); |
|
3477 zero_memory(t2, t1); |
|
3478 } |
3472 verify_tlab(); |
3479 verify_tlab(); |
3473 ba(retry); |
3480 ba(retry); |
3474 delayed()->nop(); |
3481 delayed()->nop(); |
|
3482 } |
|
3483 |
|
3484 void MacroAssembler::zero_memory(Register base, Register index) { |
|
3485 assert_different_registers(base, index); |
|
3486 Label loop; |
|
3487 bind(loop); |
|
3488 subcc(index, HeapWordSize, index); |
|
3489 brx(Assembler::greaterEqual, true, Assembler::pt, loop); |
|
3490 delayed()->st_ptr(G0, base, index); |
3475 } |
3491 } |
3476 |
3492 |
3477 void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, |
3493 void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, |
3478 Register t1, Register t2) { |
3494 Register t1, Register t2) { |
3479 // Bump total bytes allocated by this thread |
3495 // Bump total bytes allocated by this thread |