< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

3639   // Allocate the instance:
3640   //  If TLAB is enabled:
3641   //    Try to allocate in the TLAB.
3642   //    If fails, go to the slow path.
3643   //    Initialize the allocation.
3644   //    Exit.
3645   //
3646   //  Go to slow path.
3647 
3648   if (UseTLAB) {
3649     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3650 
3651     if (ZeroTLAB) {
3652       // the fields have been already cleared
3653       __ b(initialize_header);
3654     }
3655 
3656     // The object is initialized before the header.  If the object size is
3657     // zero, go directly to the header initialization.
3658     int header_size = oopDesc::header_size() * HeapWordSize;
3659     assert(is_aligned(header_size, BytesPerLong), "oop header size must be 8-byte-aligned");
3660     __ sub(r3, r3, header_size);
3661     __ cbz(r3, initialize_header);
3662 
3663     // Initialize object fields
3664     {
3665       __ add(r2, r0, header_size);
3666       Label loop;
3667       __ bind(loop);
3668       __ str(zr, Address(__ post(r2, BytesPerLong)));
3669       __ sub(r3, r3, BytesPerLong);
3670       __ cbnz(r3, loop);
3671     }
3672 
3673     // initialize object header only.
3674     __ bind(initialize_header);
3675     if (UseCompactObjectHeaders) {
3676       __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3677       __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3678     } else {
3679       __ mov(rscratch1, (intptr_t)markWord::prototype().value());

3639   // Allocate the instance:
3640   //  If TLAB is enabled:
3641   //    Try to allocate in the TLAB.
3642   //    If fails, go to the slow path.
3643   //    Initialize the allocation.
3644   //    Exit.
3645   //
3646   //  Go to slow path.
3647 
3648   if (UseTLAB) {
3649     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3650 
3651     if (ZeroTLAB) {
3652       // the fields have been already cleared
3653       __ b(initialize_header);
3654     }
3655 
3656     // The object is initialized before the header.  If the object size is
3657     // zero, go directly to the header initialization.
3658     int header_size = oopDesc::header_size() * HeapWordSize;

3659     __ sub(r3, r3, header_size);
3660     __ cbz(r3, initialize_header);
3661 
3662     // Initialize object fields
3663     {
3664       __ add(r2, r0, header_size);
3665       Label loop;
3666       __ bind(loop);
3667       __ str(zr, Address(__ post(r2, BytesPerLong)));
3668       __ sub(r3, r3, BytesPerLong);
3669       __ cbnz(r3, loop);
3670     }
3671 
3672     // initialize object header only.
3673     __ bind(initialize_header);
3674     if (UseCompactObjectHeaders) {
3675       __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3676       __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3677     } else {
3678       __ mov(rscratch1, (intptr_t)markWord::prototype().value());
< prev index next >