5005 andq(tmp_reg, markOopDesc::biased_lock_mask_in_place); |
5005 andq(tmp_reg, markOopDesc::biased_lock_mask_in_place); |
5006 cmpq(tmp_reg, markOopDesc::biased_lock_pattern); |
5006 cmpq(tmp_reg, markOopDesc::biased_lock_pattern); |
5007 jcc(Assembler::notEqual, cas_label); |
5007 jcc(Assembler::notEqual, cas_label); |
5008 // The bias pattern is present in the object's header. Need to check |
5008 // The bias pattern is present in the object's header. Need to check |
5009 // whether the bias owner and the epoch are both still current. |
5009 // whether the bias owner and the epoch are both still current. |
5010 load_klass(tmp_reg, obj_reg); |
5010 load_prototype_header(tmp_reg, obj_reg); |
5011 movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
|
5012 orq(tmp_reg, r15_thread); |
5011 orq(tmp_reg, r15_thread); |
5013 xorq(tmp_reg, swap_reg); |
5012 xorq(tmp_reg, swap_reg); |
5014 andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place)); |
5013 andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place)); |
5015 if (counters != NULL) { |
5014 if (counters != NULL) { |
5016 cond_inc32(Assembler::zero, |
5015 cond_inc32(Assembler::zero, |
5080 // bias in the current epoch. In other words, we allow transfer of |
5079 // bias in the current epoch. In other words, we allow transfer of |
5081 // the bias from one thread to another directly in this situation. |
5080 // the bias from one thread to another directly in this situation. |
5082 // |
5081 // |
5083 // FIXME: due to a lack of registers we currently blow away the age |
5082 // FIXME: due to a lack of registers we currently blow away the age |
5084 // bits in this situation. Should attempt to preserve them. |
5083 // bits in this situation. Should attempt to preserve them. |
5085 load_klass(tmp_reg, obj_reg); |
5084 load_prototype_header(tmp_reg, obj_reg); |
5086 movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
|
5087 orq(tmp_reg, r15_thread); |
5085 orq(tmp_reg, r15_thread); |
5088 if (os::is_MP()) { |
5086 if (os::is_MP()) { |
5089 lock(); |
5087 lock(); |
5090 } |
5088 } |
5091 cmpxchgq(tmp_reg, Address(obj_reg, 0)); |
5089 cmpxchgq(tmp_reg, Address(obj_reg, 0)); |
5111 // bias of this particular object, so it's okay to continue in the |
5109 // bias of this particular object, so it's okay to continue in the |
5112 // normal locking code. |
5110 // normal locking code. |
5113 // |
5111 // |
5114 // FIXME: due to a lack of registers we currently blow away the age |
5112 // FIXME: due to a lack of registers we currently blow away the age |
5115 // bits in this situation. Should attempt to preserve them. |
5113 // bits in this situation. Should attempt to preserve them. |
5116 load_klass(tmp_reg, obj_reg); |
5114 load_prototype_header(tmp_reg, obj_reg); |
5117 movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
|
5118 if (os::is_MP()) { |
5115 if (os::is_MP()) { |
5119 lock(); |
5116 lock(); |
5120 } |
5117 } |
5121 cmpxchgq(tmp_reg, Address(obj_reg, 0)); |
5118 cmpxchgq(tmp_reg, Address(obj_reg, 0)); |
5122 // Fall through to the normal CAS-based lock, because no matter what |
5119 // Fall through to the normal CAS-based lock, because no matter what |
5153 if (UseCompressedOops) { |
5150 if (UseCompressedOops) { |
5154 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
5151 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
5155 decode_heap_oop_not_null(dst); |
5152 decode_heap_oop_not_null(dst); |
5156 } else { |
5153 } else { |
5157 movq(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
5154 movq(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
|
5155 } |
|
5156 } |
|
5157 |
|
5158 void MacroAssembler::load_prototype_header(Register dst, Register src) { |
|
5159 if (UseCompressedOops) { |
|
5160 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
|
5161 movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
|
5162 } else { |
|
5163 movq(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
|
5164 movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
5158 } |
5165 } |
5159 } |
5166 } |
5160 |
5167 |
5161 void MacroAssembler::store_klass(Register dst, Register src) { |
5168 void MacroAssembler::store_klass(Register dst, Register src) { |
5162 if (UseCompressedOops) { |
5169 if (UseCompressedOops) { |