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