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