< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Print this page

        

*** 34,44 **** #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" --- 34,43 ----
*** 811,832 **** 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) --- 810,819 ----
*** 2130,2140 **** 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())); br(Assembler::EQ, ok); stop(msg); bind(ok); pop(1 << rscratch1->encoding(), sp); } --- 2117,2127 ---- 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)Universe::narrow_ptrs_base_addr())); br(Assembler::EQ, ok); stop(msg); bind(ok); pop(1 << rscratch1->encoding(), sp); }
*** 2263,2275 **** void MacroAssembler::reinit_heapbase() { if (UseCompressedOops) { if (Universe::is_fully_initialized()) { ! mov(rheapbase, CompressedOops::ptrs_base()); } else { ! lea(rheapbase, ExternalAddress((address)CompressedOops::ptrs_base_addr())); ldr(rheapbase, Address(rheapbase)); } } } --- 2250,2262 ---- void MacroAssembler::reinit_heapbase() { if (UseCompressedOops) { if (Universe::is_fully_initialized()) { ! mov(rheapbase, Universe::narrow_ptrs_base()); } else { ! lea(rheapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr())); ldr(rheapbase, Address(rheapbase)); } } }
*** 3708,3722 **** } 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()); return; ! } else if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0 ! && CompressedKlassPointers::shift() == 0) { // Only the bottom 32 bits matter cmpw(trial_klass, tmp); return; } decode_klass_not_null(tmp); --- 3695,3709 ---- } void MacroAssembler::cmp_klass(Register oop, Register trial_klass, Register tmp) { if (UseCompressedClassPointers) { ldrw(tmp, Address(oop, oopDesc::klass_offset_in_bytes())); ! if (Universe::narrow_klass_base() == NULL) { ! cmp(trial_klass, tmp, LSL, Universe::narrow_klass_shift()); return; ! } 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,3765 **** 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"); lsr(d, s, LogMinObjAlignmentInBytes); } else { mov(d, s); } } else { --- 3740,3752 ---- 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 (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,3800 **** 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) { sub(r, r, rheapbase); } ! if (CompressedOops::shift() != 0) { ! assert (LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong"); lsr(r, r, LogMinObjAlignmentInBytes); } } void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) { --- 3773,3787 ---- 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 (Universe::narrow_oop_base() != NULL) { sub(r, r, rheapbase); } ! 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,3823 **** } #endif verify_oop(src, "broken oop in encode_heap_oop_not_null2"); Register data = src; ! if (CompressedOops::base() != NULL) { sub(dst, src, rheapbase); data = dst; } ! if (CompressedOops::shift() != 0) { ! assert (LogMinObjAlignmentInBytes == CompressedOops::shift(), "decode alg wrong"); lsr(dst, data, LogMinObjAlignmentInBytes); data = dst; } if (data == src) mov(dst, src); --- 3795,3810 ---- } #endif verify_oop(src, "broken oop in encode_heap_oop_not_null2"); Register data = src; ! if (Universe::narrow_oop_base() != NULL) { sub(dst, src, rheapbase); data = dst; } ! 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,3837 **** 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()); } } else { Label done; if (d != s) mov(d, s); --- 3812,3824 ---- void MacroAssembler::decode_heap_oop(Register d, Register s) { #ifdef ASSERT verify_heapbase("MacroAssembler::decode_heap_oop: heap base corrupted?"); #endif ! 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,3925 **** 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) { add(r, rheapbase, r, Assembler::LSL, LogMinObjAlignmentInBytes); } else { add(r, zr, r, Assembler::LSL, LogMinObjAlignmentInBytes); } } else { ! assert (CompressedOops::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) { add(dst, rheapbase, src, Assembler::LSL, LogMinObjAlignmentInBytes); } else { add(dst, zr, src, Assembler::LSL, LogMinObjAlignmentInBytes); } } else { ! assert (CompressedOops::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"); 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()); lsr(dst, dst, LogKlassAlignmentInBytes); } else { ! eor(dst, src, (uint64_t)CompressedKlassPointers::base()); } return; } ! if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0 ! && CompressedKlassPointers::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()); sub(dst, src, rbase); ! if (CompressedKlassPointers::shift() != 0) { ! assert (LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong"); lsr(dst, dst, LogKlassAlignmentInBytes); } if (dst == src) reinit_heapbase(); } --- 3833,3912 ---- 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 (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 (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 (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 (Universe::narrow_oop_base() == NULL, "sanity"); if (dst != src) { mov(dst, src); } } } void MacroAssembler::encode_klass_not_null(Register dst, Register src) { ! 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 (Universe::narrow_klass_shift() != 0) { ! eor(dst, src, (uint64_t)Universe::narrow_klass_base()); lsr(dst, dst, LogKlassAlignmentInBytes); } else { ! eor(dst, src, (uint64_t)Universe::narrow_klass_base()); } return; } ! 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)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(); }
*** 3929,3973 **** 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"); lsl(dst, src, LogKlassAlignmentInBytes); } else { if (dst != src) mov(dst, src); } return; } if (use_XOR_for_compressed_class_base) { ! if (CompressedKlassPointers::shift() != 0) { lsl(dst, src, LogKlassAlignmentInBytes); ! eor(dst, dst, (uint64_t)CompressedKlassPointers::base()); } else { ! eor(dst, src, (uint64_t)CompressedKlassPointers::base()); } return; } ! if (((uint64_t)CompressedKlassPointers::base() & 0xffffffff) == 0 ! && CompressedKlassPointers::shift() == 0) { if (dst != src) movw(dst, src); ! movk(dst, (uint64_t)CompressedKlassPointers::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"); add(dst, rbase, src, Assembler::LSL, LogKlassAlignmentInBytes); } else { add(dst, rbase, src); } if (dst == src) reinit_heapbase(); --- 3916,3960 ---- void MacroAssembler::decode_klass_not_null(Register dst, Register src) { Register rbase = dst; assert (UseCompressedClassPointers, "should only be used for compressed headers"); ! 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 (Universe::narrow_klass_shift() != 0) { lsl(dst, src, LogKlassAlignmentInBytes); ! eor(dst, dst, (uint64_t)Universe::narrow_klass_base()); } else { ! eor(dst, src, (uint64_t)Universe::narrow_klass_base()); } return; } ! if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0 ! && Universe::narrow_klass_shift() == 0) { if (dst != src) movw(dst, src); ! 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)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,4012 **** 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); movz(dst, (nk >> 16), 16); movk(dst, nk & 0xffff); } void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, --- 3989,3999 ---- 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 = 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 >