mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6696264: assert("narrow oop can never be zero") for GCBasher & ParNewGC
Decouple set_klass() with zeroing the gap when compressed. Reviewed-by: kvn, ysr, jrose
This commit is contained in:
parent
1f9e095ee3
commit
646ceb4a45
12 changed files with 67 additions and 20 deletions
|
@ -3421,13 +3421,15 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case
|
|||
set((intptr_t)markOopDesc::prototype()->copy_set_hash(0x2), t2);
|
||||
st_ptr(t2, top, oopDesc::mark_offset_in_bytes()); // set up the mark word
|
||||
// set klass to intArrayKlass
|
||||
set((intptr_t)Universe::intArrayKlassObj_addr(), t2);
|
||||
ld_ptr(t2, 0, t2);
|
||||
store_klass(t2, top);
|
||||
sub(t1, typeArrayOopDesc::header_size(T_INT), t1);
|
||||
add(t1, ThreadLocalAllocBuffer::alignment_reserve(), t1);
|
||||
sll_ptr(t1, log2_intptr(HeapWordSize/sizeof(jint)), t1);
|
||||
st(t1, top, arrayOopDesc::length_offset_in_bytes());
|
||||
set((intptr_t)Universe::intArrayKlassObj_addr(), t2);
|
||||
ld_ptr(t2, 0, t2);
|
||||
// store klass last. concurrent gcs assumes klass length is valid if
|
||||
// klass field is not null.
|
||||
store_klass(t2, top);
|
||||
verify_oop(top);
|
||||
|
||||
// refill the tlab with an eden allocation
|
||||
|
@ -3568,13 +3570,19 @@ void MacroAssembler::store_klass(Register klass, Register dst_oop) {
|
|||
if (UseCompressedOops) {
|
||||
assert(dst_oop != klass, "not enough registers");
|
||||
encode_heap_oop_not_null(klass);
|
||||
sllx(klass, BitsPerInt, klass);
|
||||
stx(klass, dst_oop, oopDesc::klass_offset_in_bytes());
|
||||
st(klass, dst_oop, oopDesc::klass_offset_in_bytes());
|
||||
} else {
|
||||
st_ptr(klass, dst_oop, oopDesc::klass_offset_in_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::store_klass_gap(Register s, Register d) {
|
||||
if (UseCompressedOops) {
|
||||
assert(s != d, "not enough registers");
|
||||
st(s, d, oopDesc::klass_gap_offset_in_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::load_heap_oop(const Address& s, Register d, int offset) {
|
||||
if (UseCompressedOops) {
|
||||
lduw(s, d, offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue