< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

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


3996   //    Try to allocate in eden.
3997   //    If fails due to heap end, go to slow path.
3998   //
3999   //  If TLAB is enabled OR inline contiguous is enabled:
4000   //    Initialize the allocation.
4001   //    Exit.
4002   //
4003   //  Go to slow path.
4004 
4005   const bool allow_shared_alloc =
4006     Universe::heap()->supports_inline_contig_alloc();
4007 
4008   const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
4009 #ifndef _LP64
4010   if (UseTLAB || allow_shared_alloc) {
4011     __ get_thread(thread);
4012   }
4013 #endif // _LP64
4014 
4015   if (UseTLAB) {
4016     __ tlab_allocate(rax, rdx, 0, rcx, rbx, slow_case);
4017     if (ZeroTLAB) {
4018       // the fields have been already cleared
4019       __ jmp(initialize_header);
4020     } else {
4021       // initialize both the header and fields
4022       __ jmp(initialize_object);
4023     }
4024   } else {
4025     // Allocation in the shared Eden, if allowed.
4026     //
4027     // rdx: instance size in bytes
4028     if (allow_shared_alloc) {
4029       __ eden_allocate(rax, rdx, 0, rbx, slow_case);
4030       __ incr_allocated_bytes(thread, rdx, 0);
4031     }
4032   }
4033 
4034   // If UseTLAB or allow_shared_alloc are true, the object is created above and
4035   // there is an initialize need. Otherwise, skip and go to the slow path.
4036   if (UseTLAB || allow_shared_alloc) {
4037     // The object is initialized before the header.  If the object size is
4038     // zero, go directly to the header initialization.
4039     __ bind(initialize_object);
4040     __ decrement(rdx, sizeof(oopDesc));
4041     __ jcc(Assembler::zero, initialize_header);
4042 
4043     // Initialize topmost object field, divide rdx by 8, check if odd and
4044     // test if zero.
4045     __ xorl(rcx, rcx);    // use zero reg to clear memory (shorter code)
4046     __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
4047 
4048     // rdx must have been multiple of 8
4049 #ifdef ASSERT
4050     // make sure rdx was multiple of 8
4051     Label L;




3996   //    Try to allocate in eden.
3997   //    If fails due to heap end, go to slow path.
3998   //
3999   //  If TLAB is enabled OR inline contiguous is enabled:
4000   //    Initialize the allocation.
4001   //    Exit.
4002   //
4003   //  Go to slow path.
4004 
4005   const bool allow_shared_alloc =
4006     Universe::heap()->supports_inline_contig_alloc();
4007 
4008   const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
4009 #ifndef _LP64
4010   if (UseTLAB || allow_shared_alloc) {
4011     __ get_thread(thread);
4012   }
4013 #endif // _LP64
4014 
4015   if (UseTLAB) {
4016     __ tlab_allocate(thread, rax, rdx, 0, rcx, rbx, slow_case);
4017     if (ZeroTLAB) {
4018       // the fields have been already cleared
4019       __ jmp(initialize_header);
4020     } else {
4021       // initialize both the header and fields
4022       __ jmp(initialize_object);
4023     }
4024   } else {
4025     // Allocation in the shared Eden, if allowed.
4026     //
4027     // rdx: instance size in bytes
4028     __ eden_allocate(thread, rax, rdx, 0, rbx, slow_case);



4029   }
4030 
4031   // If UseTLAB or allow_shared_alloc are true, the object is created above and
4032   // there is an initialize need. Otherwise, skip and go to the slow path.
4033   if (UseTLAB || allow_shared_alloc) {
4034     // The object is initialized before the header.  If the object size is
4035     // zero, go directly to the header initialization.
4036     __ bind(initialize_object);
4037     __ decrement(rdx, sizeof(oopDesc));
4038     __ jcc(Assembler::zero, initialize_header);
4039 
4040     // Initialize topmost object field, divide rdx by 8, check if odd and
4041     // test if zero.
4042     __ xorl(rcx, rcx);    // use zero reg to clear memory (shorter code)
4043     __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
4044 
4045     // rdx must have been multiple of 8
4046 #ifdef ASSERT
4047     // make sure rdx was multiple of 8
4048     Label L;


< prev index next >