@@ -2375,7 +2375,7 @@
// need to do this the hard way until we can manage relocs
// for 32 bit constants
__ movoop(rscratch2, (jobject)con);
- __ encode_heap_oop_not_null(rscratch2);
+ if (con) __ encode_heap_oop_not_null(rscratch2);
if (index == -1) {
__ strw(rscratch2, Address(base, disp));
} else {
@@ -2621,7 +2621,7 @@
// need to do this the hard way until we can manage relocs
// for 32 bit constants
__ movoop(rscratch2, (jobject)con);
- __ encode_heap_oop_not_null(rscratch2);
+ if (con) __ encode_heap_oop_not_null(rscratch2);
}
MOV_VOLATILE(rscratch2, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp,
rscratch1, stlrw);
@@ -2634,8 +2634,9 @@
// need to do this the hard way until we can manage relocs
// for 32 bit constants
__ movoop(rscratch2, (jobject)con);
- __ encode_heap_oop_not_null(rscratch2);
- __ encode_klass_not_null(rscratch2);
+ // Either it is a heap oop or a klass pointer? It can't be both?
+ // __ encode_heap_oop_not_null(rscratch2);
+ if (con) __ encode_klass_not_null(rscratch2);
}
MOV_VOLATILE(rscratch2, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp,
rscratch1, stlrw);
@@ -1644,8 +1644,8 @@
void MacroAssembler::reinit_heapbase()
{
if (UseCompressedOops) {
- lea(rscratch1, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
- ldr(rheapbase, Address(rscratch1));
+ lea(rheapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
+ ldr(rheapbase, Address(rheapbase));
}
}
@@ -2078,73 +2078,46 @@
}
}
-void MacroAssembler::encode_klass_not_null(Register r) {
-#ifdef ASSERT
- verify_heapbase("MacroAssembler::encode_klass_not_null: heap base corrupted?");
-#endif
- if (Universe::narrow_klass_base() != NULL) {
- sub(r, r, rheapbase);
- }
- if (Universe::narrow_klass_shift() != 0) {
- assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
- lsr(r, r, LogKlassAlignmentInBytes);
- }
-}
-
-void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
-#ifdef ASSERT
- verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
-#endif
- if (dst != src) {
- mov(dst, src);
- }
- if (Universe::narrow_klass_base() != NULL) {
- sub(dst, dst, rheapbase);
- }
- if (Universe::narrow_klass_shift() != 0) {
- assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
- lsr(dst, dst, LogKlassAlignmentInBytes);
- }
-}
-
-void MacroAssembler::decode_klass_not_null(Register r) {
- // Note: it will change flags
- assert (UseCompressedClassPointers, "should only be used for compressed headers");
- // 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 (Universe::narrow_klass_shift() != 0) {
- assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
- if (Universe::narrow_klass_base() != NULL) {
- add(r, rheapbase, r, Assembler::LSL, LogKlassAlignmentInBytes);
- } else {
- add(r, zr, r, Assembler::LSL, LogKlassAlignmentInBytes);
- }
- } else {
- assert (Universe::narrow_klass_base() == NULL, "sanity");
- }
-}
-
-void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
- // Note: it will change flags
- assert (UseCompressedClassPointers, "should only be used for compressed headers");
- // 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 (Universe::narrow_klass_shift() != 0) {
- assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
- if (Universe::narrow_klass_base() != NULL) {
- add(dst, rheapbase, src, Assembler::LSL, LogKlassAlignmentInBytes);
- } else {
- add(dst, zr, src, Assembler::LSL, LogKlassAlignmentInBytes);
- }
- } else {
- assert (Universe::narrow_klass_base() == NULL, "sanity");
- if (dst != src) {
- mov(dst, src);
- }
- }
-}
+void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
+ Register rbase = dst;
+#ifdef ASSERT
+ verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
+#endif
+ if (dst == src) rbase = rheapbase;
+ mov(rbase, (uint64_t)Universe::narrow_klass_base());
+ sub(dst, src, rbase);
+ if (Universe::narrow_klass_shift() != 0) {
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ lsr(dst, dst, LogKlassAlignmentInBytes);
+ }
+ if (dst == src) reinit_heapbase();
+}
+
+void MacroAssembler::encode_klass_not_null(Register r) {
+ encode_klass_not_null(r, r);
+}
+
+void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
+ Register rbase = dst;
+ assert(Universe::narrow_klass_base() != NULL, "Base should be initialized");
+ assert (UseCompressedClassPointers, "should only be used for compressed headers");
+ // 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)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();
+}
+
+void MacroAssembler::decode_klass_not_null(Register r) {
+ decode_klass_not_null(r, r);
+}
// TODO
//
@@ -143,19 +143,6 @@
void NativeJump::insert(address code_pos, address entry) { Unimplemented(); }
void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
- // Patching to not_entrant can happen while activations of the method are
- // in use. The patching in that instance must happen only when certain
- // alignment restrictions are true. These guarantees check those
- // conditions.
- const int linesize = 64;
-
- // Must be wordSize aligned
- guarantee(((uintptr_t) verified_entry & (wordSize -1)) == 0,
- "illegal address for code patching 2");
- // First 5 bytes must be within the same cache line - 4827828
- guarantee((uintptr_t) verified_entry / linesize ==
- ((uintptr_t) verified_entry + 4) / linesize,
- "illegal address for code patching 3");
}
@@ -1471,13 +1471,10 @@
}
FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
} else {
-// ECN: FIXME - UseCompressedClassPointers is temporarily broken
-#ifndef AARCH64
// Turn on UseCompressedClassPointers too
if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
FLAG_SET_ERGO(bool, UseCompressedClassPointers, true);
}
-#endif
// Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
if (UseCompressedClassPointers) {
if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {