< prev index next >

src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp

Print this page

123   cmpxchgptr(hdr, Address(obj, hdr_offset));
124   // if the object header was not pointing to the displaced header,
125   // we do unlocking via runtime call
126   jcc(Assembler::notEqual, slow_case);
127   // done
128   bind(done);
129 }
130 
131 
132 // Defines obj, preserves var_size_in_bytes
133 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
134   if (UseTLAB) {
135     tlab_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
136   } else {
137     eden_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
138   }
139 }
140 
141 
142 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
143   assert_different_registers(obj, klass, len);
144   Register tmp_encode_klass = LP64_ONLY(rscratch1) NOT_LP64(noreg);
145   // This assumes that all prototype bits fit in an int32_t
146   movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markWord::prototype().value());

147 #ifdef _LP64
148   if (UseCompressedClassPointers) { // Take care not to kill klass
149     movptr(t1, klass);
150     encode_klass_not_null(t1, tmp_encode_klass);
151     movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
152   } else
153 #endif
154   {
155     movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
156   }
157 
158   if (len->is_valid()) {
159     movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
160   }
161 #ifdef _LP64
162   else if (UseCompressedClassPointers) {
163     xorptr(t1, t1);
164     store_klass_gap(obj, t1);
165   }
166 #endif

123   cmpxchgptr(hdr, Address(obj, hdr_offset));
124   // if the object header was not pointing to the displaced header,
125   // we do unlocking via runtime call
126   jcc(Assembler::notEqual, slow_case);
127   // done
128   bind(done);
129 }
130 
131 
132 // Defines obj, preserves var_size_in_bytes
133 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
134   if (UseTLAB) {
135     tlab_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
136   } else {
137     eden_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
138   }
139 }
140 
141 
142 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {

143   Register tmp_encode_klass = LP64_ONLY(rscratch1) NOT_LP64(noreg);
144   assert_different_registers(obj, klass, len, t1, t2);
145   movptr(t1, Address(klass, Klass::prototype_header_offset()));
146   movptr(Address(obj, oopDesc::mark_offset_in_bytes()), t1);
147 #ifdef _LP64
148   if (UseCompressedClassPointers) { // Take care not to kill klass
149     movptr(t1, klass);
150     encode_klass_not_null(t1, tmp_encode_klass);
151     movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
152   } else
153 #endif
154   {
155     movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
156   }
157 
158   if (len->is_valid()) {
159     movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
160   }
161 #ifdef _LP64
162   else if (UseCompressedClassPointers) {
163     xorptr(t1, t1);
164     store_klass_gap(obj, t1);
165   }
166 #endif
< prev index next >