< prev index next >

src/cpu/aarch64/vm/macroAssembler_aarch64.cpp

Print this page




2859 }
2860 
2861 
2862 // split the store check operation so that other instructions can be scheduled inbetween
2863 void MacroAssembler::store_check_part_1(Register obj) {
2864   BarrierSet* bs = Universe::heap()->barrier_set();
2865   assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
2866   lsr(obj, obj, CardTableModRefBS::card_shift);
2867 }
2868 
2869 void MacroAssembler::store_check_part_2(Register obj) {
2870   BarrierSet* bs = Universe::heap()->barrier_set();
2871   assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
2872   CardTableModRefBS* ct = (CardTableModRefBS*)bs;
2873   assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
2874 
2875   // The calculation for byte_map_base is as follows:
2876   // byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift);
2877   // So this essentially converts an address to a displacement and
2878   // it will never need to be relocated.
2879 
2880   // FIXME: It's not likely that disp will fit into an offset so we
2881   // don't bother to check, but it could save an instruction.
2882   intptr_t disp = (intptr_t) ct->byte_map_base;
2883   mov(rscratch1, disp);
2884   strb(zr, Address(obj, rscratch1));


2885 }
2886 
2887 void MacroAssembler::load_klass(Register dst, Register src) {
2888   if (UseCompressedClassPointers) {
2889     ldrw(dst, Address(src, oopDesc::klass_offset_in_bytes()));
2890     decode_klass_not_null(dst);
2891   } else {
2892     ldr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
2893   }
2894 }
2895 
2896 void MacroAssembler::cmp_klass(Register oop, Register trial_klass, Register tmp) {
2897   if (UseCompressedClassPointers) {
2898     ldrw(tmp, Address(oop, oopDesc::klass_offset_in_bytes()));
2899     if (Universe::narrow_klass_base() == NULL) {
2900       cmp(trial_klass, tmp, LSL, Universe::narrow_klass_shift());
2901       return;
2902     } else if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0
2903                && Universe::narrow_klass_shift() == 0) {
2904       // Only the bottom 32 bits matter




2859 }
2860 
2861 
2862 // split the store check operation so that other instructions can be scheduled inbetween
2863 void MacroAssembler::store_check_part_1(Register obj) {
2864   BarrierSet* bs = Universe::heap()->barrier_set();
2865   assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
2866   lsr(obj, obj, CardTableModRefBS::card_shift);
2867 }
2868 
2869 void MacroAssembler::store_check_part_2(Register obj) {
2870   BarrierSet* bs = Universe::heap()->barrier_set();
2871   assert(bs->kind() == BarrierSet::CardTableModRef, "Wrong barrier set kind");
2872   CardTableModRefBS* ct = (CardTableModRefBS*)bs;
2873   assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
2874 
2875   // The calculation for byte_map_base is as follows:
2876   // byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift);
2877   // So this essentially converts an address to a displacement and
2878   // it will never need to be relocated.



2879   intptr_t disp = (intptr_t) ct->byte_map_base;
2880   mov(rscratch1, disp);
2881   add(rscratch1, rscratch1, obj);
2882   mov(obj, zr);
2883   stlrb(obj, rscratch1);
2884 }
2885 
2886 void MacroAssembler::load_klass(Register dst, Register src) {
2887   if (UseCompressedClassPointers) {
2888     ldrw(dst, Address(src, oopDesc::klass_offset_in_bytes()));
2889     decode_klass_not_null(dst);
2890   } else {
2891     ldr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
2892   }
2893 }
2894 
2895 void MacroAssembler::cmp_klass(Register oop, Register trial_klass, Register tmp) {
2896   if (UseCompressedClassPointers) {
2897     ldrw(tmp, Address(oop, oopDesc::klass_offset_in_bytes()));
2898     if (Universe::narrow_klass_base() == NULL) {
2899       cmp(trial_klass, tmp, LSL, Universe::narrow_klass_shift());
2900       return;
2901     } else if (((uint64_t)Universe::narrow_klass_base() & 0xffffffff) == 0
2902                && Universe::narrow_klass_shift() == 0) {
2903       // Only the bottom 32 bits matter


< prev index next >