< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

3612   // Allocate the instance:
3613   //  If TLAB is enabled:
3614   //    Try to allocate in the TLAB.
3615   //    If fails, go to the slow path.
3616   //    Initialize the allocation.
3617   //    Exit.
3618   //
3619   //  Go to slow path.
3620 
3621   if (UseTLAB) {
3622     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3623 
3624     if (ZeroTLAB) {
3625       // the fields have been already cleared
3626       __ b(initialize_header);
3627     }
3628 
3629     // The object is initialized before the header.  If the object size is
3630     // zero, go directly to the header initialization.
3631     int header_size = oopDesc::header_size() * HeapWordSize;
3632     assert(is_aligned(header_size, BytesPerLong), "oop header size must be 8-byte-aligned");
3633     __ sub(r3, r3, header_size);
3634     __ cbz(r3, initialize_header);
3635 
3636     // Initialize object fields
3637     {
3638       __ add(r2, r0, header_size);
3639       Label loop;
3640       __ bind(loop);
3641       __ str(zr, Address(__ post(r2, BytesPerLong)));
3642       __ sub(r3, r3, BytesPerLong);
3643       __ cbnz(r3, loop);
3644     }
3645 
3646     // initialize object header only.
3647     __ bind(initialize_header);
3648     if (UseCompactObjectHeaders) {
3649       __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3650       __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3651     } else {
3652       __ mov(rscratch1, (intptr_t)markWord::prototype().value());

3612   // Allocate the instance:
3613   //  If TLAB is enabled:
3614   //    Try to allocate in the TLAB.
3615   //    If fails, go to the slow path.
3616   //    Initialize the allocation.
3617   //    Exit.
3618   //
3619   //  Go to slow path.
3620 
3621   if (UseTLAB) {
3622     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3623 
3624     if (ZeroTLAB) {
3625       // the fields have been already cleared
3626       __ b(initialize_header);
3627     }
3628 
3629     // The object is initialized before the header.  If the object size is
3630     // zero, go directly to the header initialization.
3631     int header_size = oopDesc::header_size() * HeapWordSize;

3632     __ sub(r3, r3, header_size);
3633     __ cbz(r3, initialize_header);
3634 
3635     // Initialize object fields
3636     {
3637       __ add(r2, r0, header_size);
3638       Label loop;
3639       __ bind(loop);
3640       __ str(zr, Address(__ post(r2, BytesPerLong)));
3641       __ sub(r3, r3, BytesPerLong);
3642       __ cbnz(r3, loop);
3643     }
3644 
3645     // initialize object header only.
3646     __ bind(initialize_header);
3647     if (UseCompactObjectHeaders) {
3648       __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3649       __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3650     } else {
3651       __ mov(rscratch1, (intptr_t)markWord::prototype().value());
< prev index next >