< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page
rev 50637 : [mq]: JDK-8205336.patch
rev 50638 : [mq]: JDK-8205336-01.patch


3545   //  Go to slow path.
3546   const bool allow_shared_alloc =
3547     Universe::heap()->supports_inline_contig_alloc();
3548 
3549   if (UseTLAB) {
3550     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3551 
3552     if (ZeroTLAB) {
3553       // the fields have been already cleared
3554       __ b(initialize_header);
3555     } else {
3556       // initialize both the header and fields
3557       __ b(initialize_object);
3558     }
3559   } else {
3560     // Allocation in the shared Eden, if allowed.
3561     //
3562     // r3: instance size in bytes
3563     if (allow_shared_alloc) {
3564       __ eden_allocate(r0, r3, 0, r10, slow_case);
3565       __ incr_allocated_bytes(rthread, r3, 0, rscratch1);
3566     }
3567   }
3568 
3569   // If UseTLAB or allow_shared_alloc are true, the object is created above and
3570   // there is an initialize need. Otherwise, skip and go to the slow path.
3571   if (UseTLAB || allow_shared_alloc) {
3572     // The object is initialized before the header.  If the object size is
3573     // zero, go directly to the header initialization.
3574     __ bind(initialize_object);
3575     __ sub(r3, r3, sizeof(oopDesc));
3576     __ cbz(r3, initialize_header);
3577 
3578     // Initialize object fields
3579     {
3580       __ add(r2, r0, sizeof(oopDesc));
3581       Label loop;
3582       __ bind(loop);
3583       __ str(zr, Address(__ post(r2, BytesPerLong)));
3584       __ sub(r3, r3, BytesPerLong);
3585       __ cbnz(r3, loop);




3545   //  Go to slow path.
3546   const bool allow_shared_alloc =
3547     Universe::heap()->supports_inline_contig_alloc();
3548 
3549   if (UseTLAB) {
3550     __ tlab_allocate(r0, r3, 0, noreg, r1, slow_case);
3551 
3552     if (ZeroTLAB) {
3553       // the fields have been already cleared
3554       __ b(initialize_header);
3555     } else {
3556       // initialize both the header and fields
3557       __ b(initialize_object);
3558     }
3559   } else {
3560     // Allocation in the shared Eden, if allowed.
3561     //
3562     // r3: instance size in bytes
3563     if (allow_shared_alloc) {
3564       __ eden_allocate(r0, r3, 0, r10, slow_case);

3565     }
3566   }
3567 
3568   // If UseTLAB or allow_shared_alloc are true, the object is created above and
3569   // there is an initialize need. Otherwise, skip and go to the slow path.
3570   if (UseTLAB || allow_shared_alloc) {
3571     // The object is initialized before the header.  If the object size is
3572     // zero, go directly to the header initialization.
3573     __ bind(initialize_object);
3574     __ sub(r3, r3, sizeof(oopDesc));
3575     __ cbz(r3, initialize_header);
3576 
3577     // Initialize object fields
3578     {
3579       __ add(r2, r0, sizeof(oopDesc));
3580       Label loop;
3581       __ bind(loop);
3582       __ str(zr, Address(__ post(r2, BytesPerLong)));
3583       __ sub(r3, r3, BytesPerLong);
3584       __ cbnz(r3, loop);


< prev index next >