< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page

4067   //    Try to allocate in the TLAB.
4068   //    If fails, go to the slow path.
4069   //    Initialize the allocation.
4070   //    Exit.
4071   //
4072   //  Go to slow path.
4073 
4074   const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
4075 
4076   if (UseTLAB) {
4077     NOT_LP64(__ get_thread(thread);)
4078     __ tlab_allocate(thread, rax, rdx, 0, rcx, rbx, slow_case);
4079     if (ZeroTLAB) {
4080       // the fields have been already cleared
4081       __ jmp(initialize_header);
4082     }
4083 
4084     // The object is initialized before the header.  If the object size is
4085     // zero, go directly to the header initialization.
4086     if (UseCompactObjectHeaders) {
4087       assert(is_aligned(oopDesc::base_offset_in_bytes(), BytesPerLong), "oop base offset must be 8-byte-aligned");
4088       __ decrement(rdx, oopDesc::base_offset_in_bytes());
4089     } else {
4090       __ decrement(rdx, sizeof(oopDesc));
4091     }
4092     __ jcc(Assembler::zero, initialize_header);
4093 
4094     // Initialize topmost object field, divide rdx by 8, check if odd and
4095     // test if zero.
4096     __ xorl(rcx, rcx);    // use zero reg to clear memory (shorter code)
4097     __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
4098 
4099     // rdx must have been multiple of 8
4100 #ifdef ASSERT
4101     // make sure rdx was multiple of 8
4102     Label L;
4103     // Ignore partial flag stall after shrl() since it is debug VM
4104     __ jcc(Assembler::carryClear, L);
4105     __ stop("object size is not multiple of 2 - adjust this code");
4106     __ bind(L);
4107     // rdx must be > 0, no extra check needed here
4108 #endif

4067   //    Try to allocate in the TLAB.
4068   //    If fails, go to the slow path.
4069   //    Initialize the allocation.
4070   //    Exit.
4071   //
4072   //  Go to slow path.
4073 
4074   const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
4075 
4076   if (UseTLAB) {
4077     NOT_LP64(__ get_thread(thread);)
4078     __ tlab_allocate(thread, rax, rdx, 0, rcx, rbx, slow_case);
4079     if (ZeroTLAB) {
4080       // the fields have been already cleared
4081       __ jmp(initialize_header);
4082     }
4083 
4084     // The object is initialized before the header.  If the object size is
4085     // zero, go directly to the header initialization.
4086     if (UseCompactObjectHeaders) {
4087       __ decrement(rdx, align_up(oopDesc::base_offset_in_bytes(), BytesPerLong));

4088     } else {
4089       __ decrement(rdx, sizeof(oopDesc));
4090     }
4091     __ jcc(Assembler::zero, initialize_header);
4092 
4093     // Initialize topmost object field, divide rdx by 8, check if odd and
4094     // test if zero.
4095     __ xorl(rcx, rcx);    // use zero reg to clear memory (shorter code)
4096     __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd
4097 
4098     // rdx must have been multiple of 8
4099 #ifdef ASSERT
4100     // make sure rdx was multiple of 8
4101     Label L;
4102     // Ignore partial flag stall after shrl() since it is debug VM
4103     __ jcc(Assembler::carryClear, L);
4104     __ stop("object size is not multiple of 2 - adjust this code");
4105     __ bind(L);
4106     // rdx must be > 0, no extra check needed here
4107 #endif
< prev index next >