< prev index next >

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

Print this page
rev 49264 : [mq]: event-only


3804 
3805     __ cmpdi(CCR1, Rscratch, InstanceKlass::fully_initialized);
3806     // Make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class.
3807     __ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0?
3808 
3809     __ crnand(CCR0, Assembler::equal, CCR1, Assembler::equal); // slow path bit set or not fully initialized?
3810     __ beq(CCR0, Lslow_case);
3811 
3812     // --------------------------------------------------------------------------
3813     // Fast case:
3814     // Allocate the instance.
3815     // 1) Try to allocate in the TLAB.
3816     // 2) If the above fails (or is not applicable), go to a slow case (creates a new TLAB, etc.).
3817 
3818     Register RoldTopValue = RallocatedObject; // Object will be allocated here if it fits.
3819     Register RnewTopValue = R6_ARG4;
3820     Register RendValue    = R7_ARG5;
3821 
3822     // Check if we can allocate in the TLAB.
3823     __ ld(RoldTopValue, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
3824     __ ld(RendValue,    in_bytes(JavaThread::tlab_end_offset()), R16_thread);
3825 
3826     __ add(RnewTopValue, Rinstance_size, RoldTopValue);
3827 
3828     // If there is enough space, we do not CAS and do not clear.
3829     __ cmpld(CCR0, RnewTopValue, RendValue);
3830     __ bgt(CCR0, Lslow_case);
3831 
3832     __ std(RnewTopValue, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
3833 
3834     if (!ZeroTLAB) {
3835       // --------------------------------------------------------------------------
3836       // Init1: Zero out newly allocated memory.
3837       // Initialize remaining object fields.
3838       Register Rbase = Rtags;
3839       __ addi(Rinstance_size, Rinstance_size, 7 - (int)sizeof(oopDesc));
3840       __ addi(Rbase, RallocatedObject, sizeof(oopDesc));
3841       __ srdi(Rinstance_size, Rinstance_size, 3);
3842 
3843       // Clear out object skipping header. Takes also care of the zero length case.
3844       __ clear_memory_doubleword(Rbase, Rinstance_size);




3804 
3805     __ cmpdi(CCR1, Rscratch, InstanceKlass::fully_initialized);
3806     // Make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class.
3807     __ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0?
3808 
3809     __ crnand(CCR0, Assembler::equal, CCR1, Assembler::equal); // slow path bit set or not fully initialized?
3810     __ beq(CCR0, Lslow_case);
3811 
3812     // --------------------------------------------------------------------------
3813     // Fast case:
3814     // Allocate the instance.
3815     // 1) Try to allocate in the TLAB.
3816     // 2) If the above fails (or is not applicable), go to a slow case (creates a new TLAB, etc.).
3817 
3818     Register RoldTopValue = RallocatedObject; // Object will be allocated here if it fits.
3819     Register RnewTopValue = R6_ARG4;
3820     Register RendValue    = R7_ARG5;
3821 
3822     // Check if we can allocate in the TLAB.
3823     __ ld(RoldTopValue, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
3824     __ ld(RendValue,    in_bytes(JavaThread::tlab_current_end_offset()), R16_thread);
3825 
3826     __ add(RnewTopValue, Rinstance_size, RoldTopValue);
3827 
3828     // If there is enough space, we do not CAS and do not clear.
3829     __ cmpld(CCR0, RnewTopValue, RendValue);
3830     __ bgt(CCR0, Lslow_case);
3831 
3832     __ std(RnewTopValue, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
3833 
3834     if (!ZeroTLAB) {
3835       // --------------------------------------------------------------------------
3836       // Init1: Zero out newly allocated memory.
3837       // Initialize remaining object fields.
3838       Register Rbase = Rtags;
3839       __ addi(Rinstance_size, Rinstance_size, 7 - (int)sizeof(oopDesc));
3840       __ addi(Rbase, RallocatedObject, sizeof(oopDesc));
3841       __ srdi(Rinstance_size, Rinstance_size, 3);
3842 
3843       // Clear out object skipping header. Takes also care of the zero length case.
3844       __ clear_memory_doubleword(Rbase, Rinstance_size);


< prev index next >