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