< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

3536   // there is an initialize need. Otherwise, skip and go to the slow path.
3537   if (UseTLAB || allow_shared_alloc) {
3538     // The object is initialized before the header.  If the object size is
3539     // zero, go directly to the header initialization.
3540     __ bind(initialize_object);
3541     __ sub(r3, r3, sizeof(oopDesc));
3542     __ cbz(r3, initialize_header);
3543 
3544     // Initialize object fields
3545     {
3546       __ add(r2, r0, sizeof(oopDesc));
3547       Label loop;
3548       __ bind(loop);
3549       __ str(zr, Address(__ post(r2, BytesPerLong)));
3550       __ sub(r3, r3, BytesPerLong);
3551       __ cbnz(r3, loop);
3552     }
3553 
3554     // initialize object header only.
3555     __ bind(initialize_header);
3556     __ mov(rscratch1, (intptr_t)markWord::prototype().value());
3557     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3558     __ store_klass_gap(r0, zr);  // zero klass gap for compressed oops
3559     __ store_klass(r0, r4);      // store klass last
3560 
3561     {
3562       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3563       // Trigger dtrace event for fastpath
3564       __ push(atos); // save the return value
3565       __ call_VM_leaf(
3566            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3567       __ pop(atos); // restore the return value
3568 
3569     }
3570     __ b(done);
3571   }
3572 
3573   // slow case
3574   __ bind(slow_case);
3575   __ get_constant_pool(c_rarg1);
3576   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);

3536   // there is an initialize need. Otherwise, skip and go to the slow path.
3537   if (UseTLAB || allow_shared_alloc) {
3538     // The object is initialized before the header.  If the object size is
3539     // zero, go directly to the header initialization.
3540     __ bind(initialize_object);
3541     __ sub(r3, r3, sizeof(oopDesc));
3542     __ cbz(r3, initialize_header);
3543 
3544     // Initialize object fields
3545     {
3546       __ add(r2, r0, sizeof(oopDesc));
3547       Label loop;
3548       __ bind(loop);
3549       __ str(zr, Address(__ post(r2, BytesPerLong)));
3550       __ sub(r3, r3, BytesPerLong);
3551       __ cbnz(r3, loop);
3552     }
3553 
3554     // initialize object header only.
3555     __ bind(initialize_header);
3556     __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3557     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3558     __ store_klass_gap(r0, zr);  // zero klass gap for compressed oops
3559     __ store_klass(r0, r4);      // store klass last
3560 
3561     {
3562       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3563       // Trigger dtrace event for fastpath
3564       __ push(atos); // save the return value
3565       __ call_VM_leaf(
3566            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3567       __ pop(atos); // restore the return value
3568 
3569     }
3570     __ b(done);
3571   }
3572 
3573   // slow case
3574   __ bind(slow_case);
3575   __ get_constant_pool(c_rarg1);
3576   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
< prev index next >