src/cpu/x86/vm/templateTable_x86_32.cpp

Print this page
rev 146 : [mq]: mixa.layout.patch


3023 
3024   __ get_cpool_and_tags(rcx, rax);
3025   // get instanceKlass
3026   __ movl(rcx, Address(rcx, rdx, Address::times_4, sizeof(constantPoolOopDesc)));
3027   __ pushl(rcx);  // save the contexts of klass for initializing the header
3028 
3029   // make sure the class we're about to instantiate has been resolved.
3030   // Note: slow_case does a pop of stack, which is why we loaded class/pushed above
3031   const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
3032   __ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
3033   __ jcc(Assembler::notEqual, slow_case);
3034 
3035   // make sure klass is initialized & doesn't have finalizer
3036   // make sure klass is fully initialized
3037   __ cmpl(Address(rcx, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), instanceKlass::fully_initialized);
3038   __ jcc(Assembler::notEqual, slow_case);
3039 
3040   // get instance_size in instanceKlass (scaled to a count of bytes)
3041   __ movl(rdx, Address(rcx, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc)));
3042   // test to see if it has a finalizer or is malformed in some way
3043   __ testl(rdx, Klass::_lh_instance_slow_path_bit);
3044   __ jcc(Assembler::notZero, slow_case);

3045 
3046   //
3047   // Allocate the instance
3048   // 1) Try to allocate in the TLAB
3049   // 2) if fail and the object is large allocate in the shared Eden
3050   // 3) if the above fails (or is not applicable), go to a slow case
3051   // (creates a new TLAB, etc.)
3052 
3053   const bool allow_shared_alloc =
3054     Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
3055 
3056   if (UseTLAB) {
3057     const Register thread = rcx;
3058 
3059     __ get_thread(thread);
3060     __ movl(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
3061     __ leal(rbx, Address(rax, rdx, Address::times_1));
3062     __ cmpl(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset())));
3063     __ jcc(Assembler::above, allow_shared_alloc ? allocate_shared : slow_case);
3064     __ movl(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx);




3023 
3024   __ get_cpool_and_tags(rcx, rax);
3025   // get instanceKlass
3026   __ movl(rcx, Address(rcx, rdx, Address::times_4, sizeof(constantPoolOopDesc)));
3027   __ pushl(rcx);  // save the contexts of klass for initializing the header
3028 
3029   // make sure the class we're about to instantiate has been resolved.
3030   // Note: slow_case does a pop of stack, which is why we loaded class/pushed above
3031   const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
3032   __ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
3033   __ jcc(Assembler::notEqual, slow_case);
3034 
3035   // make sure klass is initialized & doesn't have finalizer
3036   // make sure klass is fully initialized
3037   __ cmpl(Address(rcx, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), instanceKlass::fully_initialized);
3038   __ jcc(Assembler::notEqual, slow_case);
3039 
3040   // get instance_size in instanceKlass (scaled to a count of bytes)
3041   __ movl(rdx, Address(rcx, Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc)));
3042   // test to see if it has a finalizer or is malformed in some way
3043   __ testl(rdx, LayoutHelper::_slow_path_low_bit);
3044   __ jcc(Assembler::notZero, slow_case);
3045   __ andl(rdx, ~LayoutHelper::_size_low_mask);
3046 
3047   //
3048   // Allocate the instance
3049   // 1) Try to allocate in the TLAB
3050   // 2) if fail and the object is large allocate in the shared Eden
3051   // 3) if the above fails (or is not applicable), go to a slow case
3052   // (creates a new TLAB, etc.)
3053 
3054   const bool allow_shared_alloc =
3055     Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode;
3056 
3057   if (UseTLAB) {
3058     const Register thread = rcx;
3059 
3060     __ get_thread(thread);
3061     __ movl(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset())));
3062     __ leal(rbx, Address(rax, rdx, Address::times_1));
3063     __ cmpl(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset())));
3064     __ jcc(Assembler::above, allow_shared_alloc ? allocate_shared : slow_case);
3065     __ movl(Address(thread, in_bytes(JavaThread::tlab_top_offset())), rbx);