< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Print this page

        

@@ -34,11 +34,10 @@
 #include "gc/shared/barrierSetAssembler.hpp"
 #include "gc/shared/cardTableBarrierSet.hpp"
 #include "interpreter/interpreter.hpp"
 #include "compiler/disassembler.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.hpp"
 #include "nativeInst_aarch64.hpp"
 #include "oops/accessDecorators.hpp"
 #include "oops/compressedOops.inline.hpp"
 #include "oops/klass.inline.hpp"
 #include "runtime/biasedLocking.hpp"

@@ -811,22 +810,10 @@
 
   end_a_stub();
   return stub_start_addr;
 }
 
-void MacroAssembler::emit_static_call_stub() {
-  // CompiledDirectStaticCall::set_to_interpreted knows the
-  // exact layout of this stub.
-
-  isb();
-  mov_metadata(rmethod, (Metadata*)NULL);
-
-  // Jump to the entry point of the i2c stub.
-  movptr(rscratch1, 0);
-  br(rscratch1);
-}
-
 void MacroAssembler::c2bool(Register x) {
   // implements x == 0 ? 0 : 1
   // note: must only look at least-significant byte of x
   //       since C-style booleans are stored in one byte
   //       only! (was bug)

@@ -2130,11 +2117,11 @@
   assert (UseCompressedOops || UseCompressedClassPointers, "should be compressed");
   assert (Universe::heap() != NULL, "java heap should be initialized");
   if (CheckCompressedOops) {
     Label ok;
     push(1 << rscratch1->encoding(), sp); // cmpptr trashes rscratch1
-    cmpptr(rheapbase, ExternalAddress((address)CompressedOops::ptrs_base_addr()));
+    cmpptr(rheapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
     br(Assembler::EQ, ok);
     stop(msg);
     bind(ok);
     pop(1 << rscratch1->encoding(), sp);
   }

@@ -2263,13 +2250,13 @@
 
 void MacroAssembler::reinit_heapbase()
 {
   if (UseCompressedOops) {
     if (Universe::is_fully_initialized()) {
-      mov(rheapbase, CompressedOops::ptrs_base());
+      mov(rheapbase, Universe::narrow_ptrs_base());
     } else {
-      lea(rheapbase, ExternalAddress((address)CompressedOops::ptrs_base_addr()));
+      lea(rheapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
       ldr(rheapbase, Address(rheapbase));
     }
   }
 }
 

@@ -3708,15 +3695,15 @@
 }
 
 void MacroAssembler::cmp_klass(Register oop, Register trial_klass, Register tmp) {
   if (UseCompressedClassPointers) {
     ldrw(tmp, Address(oop, oopDesc::klass_offset_in_bytes()));
-    if (CompressedKlassPointers::base() == NULL) {
-      cmp(trial_klass, tmp, LSL, CompressedKlassPointers::shift());
+    if (Universe::narrow_klass_base() == NULL) {
+      cmp(trial_klass, tmp, LSL, Universe::narrow_klass_shift());
       return;
-    } else if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0
-               && CompressedKlassPointers::shift() == 0) {
+    } else if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0
+               && Universe::narrow_klass_shift() == 0) {
       // Only the bottom 32 bits matter
       cmpw(trial_klass, tmp);
       return;
     }
     decode_klass_not_null(tmp);

@@ -3753,13 +3740,13 @@
 void MacroAssembler::encode_heap_oop(Register d, Register s) {
 #ifdef ASSERT
   verify_heapbase("MacroAssembler::encode_heap_oop: heap base corrupted?");
 #endif
   verify_oop(s, "broken oop in encode_heap_oop");
-  if (CompressedOops::base() == NULL) {
-    if (CompressedOops::shift() != 0) {
-      assert (LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong");
+  if (Universe::narrow_oop_base() == NULL) {
+    if (Universe::narrow_oop_shift() != 0) {
+      assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
       lsr(d, s, LogMinObjAlignmentInBytes);
     } else {
       mov(d, s);
     }
   } else {

@@ -3786,15 +3773,15 @@
     stop("null oop passed to encode_heap_oop_not_null");
     bind(ok);
   }
 #endif
   verify_oop(r, "broken oop in encode_heap_oop_not_null");
-  if (CompressedOops::base() != NULL) {
+  if (Universe::narrow_oop_base() != NULL) {
     sub(r, r, rheapbase);
   }
-  if (CompressedOops::shift() != 0) {
-    assert (LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong");
+  if (Universe::narrow_oop_shift() != 0) {
+    assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
     lsr(r, r, LogMinObjAlignmentInBytes);
   }
 }
 
 void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) {

@@ -3808,16 +3795,16 @@
   }
 #endif
   verify_oop(src, "broken oop in encode_heap_oop_not_null2");
 
   Register data = src;
-  if (CompressedOops::base() != NULL) {
+  if (Universe::narrow_oop_base() != NULL) {
     sub(dst, src, rheapbase);
     data = dst;
   }
-  if (CompressedOops::shift() != 0) {
-    assert (LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong");
+  if (Universe::narrow_oop_shift() != 0) {
+    assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
     lsr(dst, data, LogMinObjAlignmentInBytes);
     data = dst;
   }
   if (data == src)
     mov(dst, src);

@@ -3825,13 +3812,13 @@
 
 void  MacroAssembler::decode_heap_oop(Register d, Register s) {
 #ifdef ASSERT
   verify_heapbase("MacroAssembler::decode_heap_oop: heap base corrupted?");
 #endif
-  if (CompressedOops::base() == NULL) {
-    if (CompressedOops::shift() != 0 || d != s) {
-      lsl(d, s, CompressedOops::shift());
+  if (Universe::narrow_oop_base() == NULL) {
+    if (Universe::narrow_oop_shift() != 0 || d != s) {
+      lsl(d, s, Universe::narrow_oop_shift());
     }
   } else {
     Label done;
     if (d != s)
       mov(d, s);

@@ -3846,80 +3833,80 @@
   assert (UseCompressedOops, "should only be used for compressed headers");
   assert (Universe::heap() != NULL, "java heap should be initialized");
   // Cannot assert, unverified entry point counts instructions (see .ad file)
   // vtableStubs also counts instructions in pd_code_size_limit.
   // Also do not verify_oop as this is called by verify_oop.
-  if (CompressedOops::shift() != 0) {
-    assert(LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong");
-    if (CompressedOops::base() != NULL) {
+  if (Universe::narrow_oop_shift() != 0) {
+    assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
+    if (Universe::narrow_oop_base() != NULL) {
       add(r, rheapbase, r, Assembler::LSL, LogMinObjAlignmentInBytes);
     } else {
       add(r, zr, r, Assembler::LSL, LogMinObjAlignmentInBytes);
     }
   } else {
-    assert (CompressedOops::base() == NULL, "sanity");
+    assert (Universe::narrow_oop_base() == NULL, "sanity");
   }
 }
 
 void  MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
   assert (UseCompressedOops, "should only be used for compressed headers");
   assert (Universe::heap() != NULL, "java heap should be initialized");
   // Cannot assert, unverified entry point counts instructions (see .ad file)
   // vtableStubs also counts instructions in pd_code_size_limit.
   // Also do not verify_oop as this is called by verify_oop.
-  if (CompressedOops::shift() != 0) {
-    assert(LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong");
-    if (CompressedOops::base() != NULL) {
+  if (Universe::narrow_oop_shift() != 0) {
+    assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
+    if (Universe::narrow_oop_base() != NULL) {
       add(dst, rheapbase, src, Assembler::LSL, LogMinObjAlignmentInBytes);
     } else {
       add(dst, zr, src, Assembler::LSL, LogMinObjAlignmentInBytes);
     }
   } else {
-    assert (CompressedOops::base() == NULL, "sanity");
+    assert (Universe::narrow_oop_base() == NULL, "sanity");
     if (dst != src) {
       mov(dst, src);
     }
   }
 }
 
 void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
-  if (CompressedKlassPointers::base() == NULL) {
-    if (CompressedKlassPointers::shift() != 0) {
-      assert (LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
+  if (Universe::narrow_klass_base() == NULL) {
+    if (Universe::narrow_klass_shift() != 0) {
+      assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
       lsr(dst, src, LogKlassAlignmentInBytes);
     } else {
       if (dst != src) mov(dst, src);
     }
     return;
   }
 
   if (use_XOR_for_compressed_class_base) {
-    if (CompressedKlassPointers::shift() != 0) {
-      eor(dst, src, (uint64_t)CompressedKlassPointers::base());
+    if (Universe::narrow_klass_shift() != 0) {
+      eor(dst, src, (uint64_t)Universe::narrow_klass_base());
       lsr(dst, dst, LogKlassAlignmentInBytes);
     } else {
-      eor(dst, src, (uint64_t)CompressedKlassPointers::base());
+      eor(dst, src, (uint64_t)Universe::narrow_klass_base());
     }
     return;
   }
 
-  if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0
-      && CompressedKlassPointers::shift() == 0) {
+  if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0
+      && Universe::narrow_klass_shift() == 0) {
     movw(dst, src);
     return;
   }
 
 #ifdef ASSERT
   verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
 #endif
 
   Register rbase = dst;
   if (dst == src) rbase = rheapbase;
-  mov(rbase, (uint64_t)CompressedKlassPointers::base());
+  mov(rbase, (uint64_t)Universe::narrow_klass_base());
   sub(dst, src, rbase);
-  if (CompressedKlassPointers::shift() != 0) {
-    assert (LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
+  if (Universe::narrow_klass_shift() != 0) {
+    assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
     lsr(dst, dst, LogKlassAlignmentInBytes);
   }
   if (dst == src) reinit_heapbase();
 }
 

@@ -3929,45 +3916,45 @@
 
 void  MacroAssembler::decode_klass_not_null(Register dst, Register src) {
   Register rbase = dst;
   assert (UseCompressedClassPointers, "should only be used for compressed headers");
 
-  if (CompressedKlassPointers::base() == NULL) {
-    if (CompressedKlassPointers::shift() != 0) {
-      assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
+  if (Universe::narrow_klass_base() == NULL) {
+    if (Universe::narrow_klass_shift() != 0) {
+      assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
       lsl(dst, src, LogKlassAlignmentInBytes);
     } else {
       if (dst != src) mov(dst, src);
     }
     return;
   }
 
   if (use_XOR_for_compressed_class_base) {
-    if (CompressedKlassPointers::shift() != 0) {
+    if (Universe::narrow_klass_shift() != 0) {
       lsl(dst, src, LogKlassAlignmentInBytes);
-      eor(dst, dst, (uint64_t)CompressedKlassPointers::base());
+      eor(dst, dst, (uint64_t)Universe::narrow_klass_base());
     } else {
-      eor(dst, src, (uint64_t)CompressedKlassPointers::base());
+      eor(dst, src, (uint64_t)Universe::narrow_klass_base());
     }
     return;
   }
 
-  if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0
-      && CompressedKlassPointers::shift() == 0) {
+  if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0
+      && Universe::narrow_klass_shift() == 0) {
     if (dst != src)
       movw(dst, src);
-    movk(dst, (uint64_t)CompressedKlassPointers::base() >> 32, 32);
+    movk(dst, (uint64_t)Universe::narrow_klass_base() >> 32, 32);
     return;
   }
 
   // Cannot assert, unverified entry point counts instructions (see .ad file)
   // vtableStubs also counts instructions in pd_code_size_limit.
   // Also do not verify_oop as this is called by verify_oop.
   if (dst == src) rbase = rheapbase;
-  mov(rbase, (uint64_t)CompressedKlassPointers::base());
-  if (CompressedKlassPointers::shift() != 0) {
-    assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
+  mov(rbase, (uint64_t)Universe::narrow_klass_base());
+  if (Universe::narrow_klass_shift() != 0) {
+    assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
     add(dst, rbase, src, Assembler::LSL, LogKlassAlignmentInBytes);
   } else {
     add(dst, rbase, src);
   }
   if (dst == src) reinit_heapbase();

@@ -4002,11 +3989,11 @@
   assert(! Universe::heap()->is_in_reserved(k), "should not be an oop");
 
   InstructionMark im(this);
   RelocationHolder rspec = metadata_Relocation::spec(index);
   code_section()->relocate(inst_mark(), rspec);
-  narrowKlass nk = CompressedKlassPointers::encode(k);
+  narrowKlass nk = Klass::encode_klass(k);
   movz(dst, (nk >> 16), 16);
   movk(dst, nk & 0xffff);
 }
 
 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
< prev index next >