mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6709093: Compressed Oops: reduce size of compiled methods
Exclude UEP size from nmethod code size and use narrow klass oop to load prototype header. Reviewed-by: jrose, never
This commit is contained in:
parent
54eeffff83
commit
dbdeade3b7
6 changed files with 64 additions and 13 deletions
|
@ -5007,8 +5007,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re
|
|||
jcc(Assembler::notEqual, cas_label);
|
||||
// The bias pattern is present in the object's header. Need to check
|
||||
// whether the bias owner and the epoch are both still current.
|
||||
load_klass(tmp_reg, obj_reg);
|
||||
movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
|
||||
load_prototype_header(tmp_reg, obj_reg);
|
||||
orq(tmp_reg, r15_thread);
|
||||
xorq(tmp_reg, swap_reg);
|
||||
andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place));
|
||||
|
@ -5082,8 +5081,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re
|
|||
//
|
||||
// FIXME: due to a lack of registers we currently blow away the age
|
||||
// bits in this situation. Should attempt to preserve them.
|
||||
load_klass(tmp_reg, obj_reg);
|
||||
movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
|
||||
load_prototype_header(tmp_reg, obj_reg);
|
||||
orq(tmp_reg, r15_thread);
|
||||
if (os::is_MP()) {
|
||||
lock();
|
||||
|
@ -5113,8 +5111,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re
|
|||
//
|
||||
// FIXME: due to a lack of registers we currently blow away the age
|
||||
// bits in this situation. Should attempt to preserve them.
|
||||
load_klass(tmp_reg, obj_reg);
|
||||
movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
|
||||
load_prototype_header(tmp_reg, obj_reg);
|
||||
if (os::is_MP()) {
|
||||
lock();
|
||||
}
|
||||
|
@ -5158,6 +5155,16 @@ void MacroAssembler::load_klass(Register dst, Register src) {
|
|||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::load_prototype_header(Register dst, Register src) {
|
||||
if (UseCompressedOops) {
|
||||
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
|
||||
} else {
|
||||
movq(dst, Address(src, oopDesc::klass_offset_in_bytes()));
|
||||
movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::store_klass(Register dst, Register src) {
|
||||
if (UseCompressedOops) {
|
||||
encode_heap_oop_not_null(src);
|
||||
|
|
|
@ -1111,6 +1111,8 @@ class MacroAssembler : public Assembler {
|
|||
void store_klass(Register dst, Register src);
|
||||
void store_klass_gap(Register dst, Register src);
|
||||
|
||||
void load_prototype_header(Register dst, Register src);
|
||||
|
||||
void load_heap_oop(Register dst, Address src);
|
||||
void store_heap_oop(Address dst, Register src);
|
||||
void encode_heap_oop(Register r);
|
||||
|
|
|
@ -6149,7 +6149,7 @@ instruct loadNKlass(rRegN dst, memory mem)
|
|||
match(Set dst (LoadNKlass mem));
|
||||
|
||||
ins_cost(125); // XXX
|
||||
format %{ "movl $dst, $mem\t# compressed klass ptr\n\t" %}
|
||||
format %{ "movl $dst, $mem\t# compressed klass ptr" %}
|
||||
ins_encode %{
|
||||
Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp);
|
||||
Register dst = as_Register($dst$$reg);
|
||||
|
@ -7089,7 +7089,8 @@ instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
|
|||
%}
|
||||
|
||||
instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{
|
||||
predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull);
|
||||
predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull &&
|
||||
n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant);
|
||||
match(Set dst (DecodeN src));
|
||||
effect(KILL cr);
|
||||
format %{ "decode_heap_oop $dst,$src" %}
|
||||
|
@ -7105,7 +7106,8 @@ instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{
|
|||
%}
|
||||
|
||||
instruct decodeHeapOop_not_null(rRegP dst, rRegN src) %{
|
||||
predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull);
|
||||
predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull ||
|
||||
n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant);
|
||||
match(Set dst (DecodeN src));
|
||||
format %{ "decode_heap_oop_not_null $dst,$src" %}
|
||||
ins_encode %{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue