mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8086053: Address inconsistencies regarding ZeroTLAB
Add zero-initialization to C1 for fast TLAB refills; strenghten C2 conditions for skipping zero-initialization. Reviewed-by: kvn, thartmann
This commit is contained in:
parent
5be1924e89
commit
dfa6539a6a
18 changed files with 215 additions and 128 deletions
|
@ -3459,11 +3459,27 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case
|
|||
add(top, t1, top); // t1 is tlab_size
|
||||
sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top);
|
||||
st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset()));
|
||||
|
||||
if (ZeroTLAB) {
|
||||
// This is a fast TLAB refill, therefore the GC is not notified of it.
|
||||
// So compiled code must fill the new TLAB with zeroes.
|
||||
ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t2);
|
||||
zero_memory(t2, t1);
|
||||
}
|
||||
verify_tlab();
|
||||
ba(retry);
|
||||
delayed()->nop();
|
||||
}
|
||||
|
||||
void MacroAssembler::zero_memory(Register base, Register index) {
|
||||
assert_different_registers(base, index);
|
||||
Label loop;
|
||||
bind(loop);
|
||||
subcc(index, HeapWordSize, index);
|
||||
brx(Assembler::greaterEqual, true, Assembler::pt, loop);
|
||||
delayed()->st_ptr(G0, base, index);
|
||||
}
|
||||
|
||||
void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes,
|
||||
Register t1, Register t2) {
|
||||
// Bump total bytes allocated by this thread
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue