Skip to content

Commit

Permalink
Simplify LIR_Assembler::emit_load_klass()
Browse files Browse the repository at this point in the history
  • Loading branch information
rkennke committed Sep 19, 2024
1 parent 9ad2e62 commit b25a4b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
12 changes: 1 addition & 11 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2518,17 +2518,7 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
add_debug_info_for_null_check_here(info);
}

if (UseCompressedClassPointers) {
if (UseCompactObjectHeaders) {
__ ldr(result, Address(obj, oopDesc::mark_offset_in_bytes()));
__ lsr(result, result, markWord::klass_shift);
} else {
__ ldrw(result, Address (obj, oopDesc::klass_offset_in_bytes()));
}
__ decode_klass_not_null(result);
} else {
__ ldr(result, Address (obj, oopDesc::klass_offset_in_bytes()));
}
__ load_klass(result, obj);
}

void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
Expand Down
18 changes: 1 addition & 17 deletions src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3503,23 +3503,7 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
add_debug_info_for_null_check_here(info);
}

#ifdef _LP64
if (UseCompactObjectHeaders) {
Register tmp = rscratch1;
assert_different_registers(tmp, obj);
assert_different_registers(tmp, result);

__ movq(result, Address(obj, oopDesc::mark_offset_in_bytes()));
__ shrq(result, markWord::klass_shift);
__ decode_klass_not_null(result, tmp);
} else if (UseCompressedClassPointers) {
__ movl(result, Address(obj, oopDesc::klass_offset_in_bytes()));
__ decode_klass_not_null(result, rscratch1);
} else
#endif
{
__ movptr(result, Address(obj, oopDesc::klass_offset_in_bytes()));
}
__ load_klass(result, obj, rscratch1);
}

void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
Expand Down

0 comments on commit b25a4b6

Please sign in to comment.