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