3886 //
3887 // If TLAB is enabled OR inline contiguous is enabled:
3888 // Initialize the allocation.
3889 // Exit.
3890 //
3891 // Go to slow path.
3892
3893 const bool allow_shared_alloc =
3894 Universe::heap()->supports_inline_contig_alloc();
3895
3896 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
3897 #ifndef _LP64
3898 if (UseTLAB || allow_shared_alloc) {
3899 __ get_thread(thread);
3900 }
3901 #endif // _LP64
3902
3903 if (UseTLAB) {
3904 __ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
3905 __ lea(rbx, Address(rax, rdx, Address::times_1));
3906 __ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset())));
3907 __ jcc(Assembler::above, slow_case);
3908 __ movptr(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx);
3909 if (ZeroTLAB) {
3910 // the fields have been already cleared
3911 __ jmp(initialize_header);
3912 } else {
3913 // initialize both the header and fields
3914 __ jmp(initialize_object);
3915 }
3916 } else {
3917 // Allocation in the shared Eden, if allowed.
3918 //
3919 // rdx: instance size in bytes
3920 if (allow_shared_alloc) {
3921 ExternalAddress heap_top((address)Universe::heap()->top_addr());
3922 ExternalAddress heap_end((address)Universe::heap()->end_addr());
3923
3924 Label retry;
3925 __ bind(retry);
3926 __ movptr(rax, heap_top);
|
3886 //
3887 // If TLAB is enabled OR inline contiguous is enabled:
3888 // Initialize the allocation.
3889 // Exit.
3890 //
3891 // Go to slow path.
3892
3893 const bool allow_shared_alloc =
3894 Universe::heap()->supports_inline_contig_alloc();
3895
3896 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
3897 #ifndef _LP64
3898 if (UseTLAB || allow_shared_alloc) {
3899 __ get_thread(thread);
3900 }
3901 #endif // _LP64
3902
3903 if (UseTLAB) {
3904 __ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
3905 __ lea(rbx, Address(rax, rdx, Address::times_1));
3906 __ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_current_end_offset())));
3907 __ jcc(Assembler::above, slow_case);
3908 __ movptr(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx);
3909 if (ZeroTLAB) {
3910 // the fields have been already cleared
3911 __ jmp(initialize_header);
3912 } else {
3913 // initialize both the header and fields
3914 __ jmp(initialize_object);
3915 }
3916 } else {
3917 // Allocation in the shared Eden, if allowed.
3918 //
3919 // rdx: instance size in bytes
3920 if (allow_shared_alloc) {
3921 ExternalAddress heap_top((address)Universe::heap()->top_addr());
3922 ExternalAddress heap_end((address)Universe::heap()->end_addr());
3923
3924 Label retry;
3925 __ bind(retry);
3926 __ movptr(rax, heap_top);
|