< prev index next >

src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

Print this page

144     cmpxchgptr(disp_hdr, hdr, rscratch1, rscratch2, done, &slow_case);
145   } else {
146     cmpxchgptr(disp_hdr, hdr, obj, rscratch2, done, &slow_case);
147   }
148   // done
149   bind(done);
150 }
151 
152 
153 // Defines obj, preserves var_size_in_bytes
154 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
155   if (UseTLAB) {
156     tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
157   } else {
158     eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
159   }
160 }
161 
162 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
163   assert_different_registers(obj, klass, len);
164   // This assumes that all prototype bits fit in an int32_t
165   mov(t1, (int32_t)(intptr_t)markWord::prototype().value());
166   str(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
167 
168   if (UseCompressedClassPointers) { // Take care not to kill klass
169     encode_klass_not_null(t1, klass);
170     strw(t1, Address(obj, oopDesc::klass_offset_in_bytes()));
171   } else {
172     str(klass, Address(obj, oopDesc::klass_offset_in_bytes()));
173   }
174 
175   if (len->is_valid()) {
176     strw(len, Address(obj, arrayOopDesc::length_offset_in_bytes()));
177   } else if (UseCompressedClassPointers) {
178     store_klass_gap(obj, zr);
179   }
180 }
181 
182 // preserves obj, destroys len_in_bytes
183 //
184 // Scratch registers: t1 = r10, t2 = r11
185 //

144     cmpxchgptr(disp_hdr, hdr, rscratch1, rscratch2, done, &slow_case);
145   } else {
146     cmpxchgptr(disp_hdr, hdr, obj, rscratch2, done, &slow_case);
147   }
148   // done
149   bind(done);
150 }
151 
152 
153 // Defines obj, preserves var_size_in_bytes
154 void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) {
155   if (UseTLAB) {
156     tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
157   } else {
158     eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
159   }
160 }
161 
162 void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
163   assert_different_registers(obj, klass, len);
164   ldr(t1, Address(klass, Klass::prototype_header_offset()));

165   str(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
166 
167   if (UseCompressedClassPointers) { // Take care not to kill klass
168     encode_klass_not_null(t1, klass);
169     strw(t1, Address(obj, oopDesc::klass_offset_in_bytes()));
170   } else {
171     str(klass, Address(obj, oopDesc::klass_offset_in_bytes()));
172   }
173 
174   if (len->is_valid()) {
175     strw(len, Address(obj, arrayOopDesc::length_offset_in_bytes()));
176   } else if (UseCompressedClassPointers) {
177     store_klass_gap(obj, zr);
178   }
179 }
180 
181 // preserves obj, destroys len_in_bytes
182 //
183 // Scratch registers: t1 = r10, t2 = r11
184 //
< prev index next >