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