diff --git a/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 8567b1589b32129d326144389355b170dc5305c4..c72ebbb8b8a1c39b2a6b838d090d032f384a64c3 100644 --- a/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -2382,17 +2382,11 @@ void MacroAssembler::get_vm_result_2(Register metadata_result) { void MacroAssembler::encode_klass_not_null(Register dst, Register src) { if (src == noreg) src = dst; - if (Universe::narrow_klass_base() != NULL) { - // heapbased - assert(Universe::narrow_klass_shift() != 0, "sanity"); - sub(dst, src, R30); - srdi(dst, dst, Universe::narrow_klass_shift()); - } else if (Universe::narrow_klass_shift() != 0) { - // zerobased + assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); + load_const(R0, Universe::narrow_klass_base()); + sub(dst, src, R0); + if (Universe::narrow_klass_shift() != 0) { srdi(dst, src, Universe::narrow_klass_shift()); - } else if (src != dst) { - // unscaled - mr(dst, src); } } @@ -2407,18 +2401,14 @@ void MacroAssembler::store_klass(Register dst_oop, Register klass, Register ck) void MacroAssembler::decode_klass_not_null(Register dst, Register src) { if (src == noreg) src = dst; - if (Universe::narrow_klass_base() != NULL) { - // heapbased - assert(Universe::narrow_klass_shift() != 0, "sanity"); - sldi(dst, src, Universe::narrow_klass_shift()); - add(dst, dst, R30); - } else if (Universe::narrow_klass_shift() != 0) { - // zerobased - sldi(dst, src, Universe::narrow_klass_shift()); - } else if (src != dst) { - // unscaled - mr(dst, src); + Register shifted_src = src; + assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); + if (Universe::narrow_klass_shift() != 0) { + shifted_src = dst; + sldi(shifted_src, src, Universe::narrow_klass_shift()); } + load_const(R0, Universe::narrow_klass_base()); + add(dst, shifted_src, R0); } void MacroAssembler::load_klass(Register dst, Register src) { @@ -2441,7 +2431,13 @@ void MacroAssembler::load_klass_with_trap_null_check(Register dst, Register src) } void MacroAssembler::reinit_heapbase(Register d, Register tmp) { - if (UseCompressedOops || UseCompressedKlassPointers) { + if (Universe::heap() != NULL) { + if (Universe::narrow_oop_base() == NULL) { + Assembler::xorr(R30, R30, R30); + } else { + load_const(R30, Universe::narrow_ptrs_base(), tmp); + } + } else { load_const(R30, Universe::narrow_ptrs_base_addr(), tmp); ld(R30, 0, R30); } diff --git a/src/cpu/ppc/vm/relocInfo_ppc.cpp b/src/cpu/ppc/vm/relocInfo_ppc.cpp index b7c1798170534fb9ded55c8ab716ecd8a8d681be..4f365a46a0513f8f0161955d5eca6bca9e784da3 100644 --- a/src/cpu/ppc/vm/relocInfo_ppc.cpp +++ b/src/cpu/ppc/vm/relocInfo_ppc.cpp @@ -58,7 +58,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "how to encode else?"); narrowOop no = (type() == relocInfo::oop_type) ? - oopDesc::encode_heap_oop((oop)x) : oopDesc::encode_klass((Klass*)x); + oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x); nativeMovConstReg_at(addr())->set_narrow_oop(no, code()); } } else {