src/cpu/sparc/vm/sparc.ad
Print this page
rev 3688 : 7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by:
*** 555,567 ****
} else {
assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
int klass_load_size;
! if (UseCompressedOops && UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
! if (Universe::narrow_oop_base() == NULL)
klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass()
else
klass_load_size = 3*BytesPerInstWord;
} else {
klass_load_size = 1*BytesPerInstWord;
--- 555,567 ----
} else {
assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
int klass_load_size;
! if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
! if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass()
else
klass_load_size = 3*BytesPerInstWord;
} else {
klass_load_size = 1*BytesPerInstWord;
*** 1705,1719 ****
//=============================================================================
#ifndef PRODUCT
void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
st->print_cr("\nUEP:");
#ifdef _LP64
! if (UseCompressedOops) {
assert(Universe::heap() != NULL, "java heap should be initialized");
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
st->print_cr("\tSLL R_G5,3,R_G5");
! if (Universe::narrow_oop_base() != NULL)
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
} else {
st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check");
}
st->print_cr("\tCMP R_G5,R_G3" );
--- 1705,1719 ----
//=============================================================================
#ifndef PRODUCT
void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
st->print_cr("\nUEP:");
#ifdef _LP64
! if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
st->print_cr("\tSLL R_G5,3,R_G5");
! if (Universe::narrow_klass_base() != NULL)
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
} else {
st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check");
}
st->print_cr("\tCMP R_G5,R_G3" );
*** 1940,1949 ****
--- 1940,1955 ----
NOT_LP64(ShouldNotCallThis());
assert(UseCompressedOops, "only for compressed oops code");
return false;
}
+ bool Matcher::narrow_klass_use_complex_address() {
+ NOT_LP64(ShouldNotCallThis());
+ assert(UseCompressedKlassPointers, "only for compressed klass code");
+ return false;
+ }
+
// Is it better to copy float constants, or load them directly from memory?
// Intel can load a float constant from a direct address, requiring no
// extra registers. Most RISCs will have to materialize an address into a
// register first, so they would do better to copy the constant from stack.
const bool Matcher::rematerialize_float_constants = false;
*** 2600,2612 ****
// get receiver klass (receiver already checked for non-null)
// If we end up going thru a c2i adapter interpreter expects method in G5
int off = __ offset();
__ load_klass(O0, G3_scratch);
int klass_load_size;
! if (UseCompressedOops && UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
! if (Universe::narrow_oop_base() == NULL)
klass_load_size = 2*BytesPerInstWord;
else
klass_load_size = 3*BytesPerInstWord;
} else {
klass_load_size = 1*BytesPerInstWord;
--- 2606,2618 ----
// get receiver klass (receiver already checked for non-null)
// If we end up going thru a c2i adapter interpreter expects method in G5
int off = __ offset();
__ load_klass(O0, G3_scratch);
int klass_load_size;
! if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
! if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord;
else
klass_load_size = 3*BytesPerInstWord;
} else {
klass_load_size = 1*BytesPerInstWord;
*** 3608,3617 ****
--- 3614,3632 ----
op_cost(10);
format %{ %}
interface(CONST_INTER);
%}
+ operand immNKlass()
+ %{
+ match(ConNKlass);
+
+ op_cost(10);
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
// NULL Pointer Immediate
operand immN0()
%{
predicate(n->get_narrowcon() == 0);
match(ConN);
*** 6157,6166 ****
--- 6172,6192 ----
__ set_narrow_oop((jobject)$src$$constant, dst);
%}
ins_pipe(ialu_hi_lo_reg);
%}
+ instruct loadConNKlass(iRegN dst, immNKlass src) %{
+ match(Set dst src);
+ ins_cost(DEFAULT_COST * 3/2);
+ format %{ "SET $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register dst = $dst$$Register;
+ __ set_narrow_klass((Klass*)$src$$constant, dst);
+ %}
+ ins_pipe(ialu_hi_lo_reg);
+ %}
+
// Materialize long value (predicated by immL_cheap).
instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{
match(Set dst con);
effect(KILL tmp);
ins_cost(DEFAULT_COST * 3);
*** 6473,6482 ****
--- 6499,6527 ----
}
%}
ins_pipe(istore_mem_spORreg);
%}
+ instruct storeNKlass(memory dst, iRegN src) %{
+ match(Set dst (StoreNKlass dst src));
+ ins_cost(MEMORY_REF_COST);
+ size(4);
+
+ format %{ "STW $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register base = as_Register($dst$$base);
+ Register index = as_Register($dst$$index);
+ Register src = $src$$Register;
+ if (index != G0) {
+ __ stw(src, base, index);
+ } else {
+ __ stw(src, base, $dst$$disp);
+ }
+ %}
+ ins_pipe(istore_mem_spORreg);
+ %}
+
instruct storeN0(memory dst, immN0 src) %{
match(Set dst (StoreN dst src));
ins_cost(MEMORY_REF_COST);
size(4);
*** 6580,6589 ****
--- 6625,6651 ----
__ decode_heap_oop_not_null($src$$Register, $dst$$Register);
%}
ins_pipe(ialu_reg);
%}
+ instruct encodeKlass_not_null(iRegN dst, iRegP src) %{
+ match(Set dst (EncodePKlass src));
+ format %{ "encode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ encode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+ %}
+
+ instruct decodeKlass_not_null(iRegP dst, iRegN src) %{
+ match(Set dst (DecodeNKlass src));
+ format %{ "decode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ decode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+ %}
//----------MemBar Instructions-----------------------------------------------
// Memory barrier flavors
instruct membar_acquire() %{