src/cpu/s390/vm/c1_Runtime1_s390.cpp

Print this page




 753         __ bind(return_min_jlong);
 754         __ mov64(rax, UCONST64(0x8000000000000000));
 755         __ jmp(do_return);
 756 
 757         __ bind(return0);
 758         __ fpop();
 759         __ xorptr(rax, rax);
 760 
 761         __ bind(do_return);
 762         __ addptr(rsp, 32);
 763         LP64_ONLY(__ pop(rdx);)
 764         __ pop(rcx);
 765         __ pop(rsi);
 766         __ ret(0);
 767       }
 768       break;
 769 #endif // TODO
 770 
 771 #if INCLUDE_ALL_GCS
 772     case g1_pre_barrier_slow_id:

 773       { // Z_R1_scratch: previous value of memory
 774 
 775         BarrierSet* bs = Universe::heap()->barrier_set();
 776         if (bs->kind() != BarrierSet::G1SATBCTLogging) {
 777           __ should_not_reach_here(FILE_AND_LINE);
 778           break;
 779         }
 780 

 781         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);



 782 
 783         Register pre_val = Z_R1_scratch;
 784         Register tmp  = Z_R6; // Must be non-volatile because it is used to save pre_val.
 785         Register tmp2 = Z_R7;
 786 
 787         Label refill, restart;



 788         int satb_q_index_byte_offset =
 789           in_bytes(JavaThread::satb_mark_queue_offset() +
 790                    SATBMarkQueue::byte_offset_of_index());
 791         int satb_q_buf_byte_offset =
 792           in_bytes(JavaThread::satb_mark_queue_offset() +
 793                    SATBMarkQueue::byte_offset_of_buf());
 794 
 795         // Save tmp registers (see assertion in G1PreBarrierStub::emit_code()).
 796         __ z_stg(tmp,  0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 797         __ z_stg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 798 











 799         __ bind(restart);
 800         // Load the index into the SATB buffer. SATBMarkQueue::_index is a
 801         // size_t so ld_ptr is appropriate.
 802         __ z_ltg(tmp, satb_q_index_byte_offset, Z_R0, Z_thread);
 803 
 804         // index == 0?
 805         __ z_brz(refill);
 806 
 807         __ z_lg(tmp2, satb_q_buf_byte_offset, Z_thread);
 808         __ add2reg(tmp, -oopSize);
 809 
 810         __ z_stg(pre_val, 0, tmp, tmp2); // [_buf + index] := <address_of_card>
 811         __ z_stg(tmp, satb_q_index_byte_offset, Z_thread);
 812 

 813         // Restore tmp registers (see assertion in G1PreBarrierStub::emit_code()).
 814         __ z_lg(tmp,  0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 815         __ z_lg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 816         __ z_br(Z_R14);
 817 
 818         __ bind(refill);
 819         save_volatile_registers(sasm);
 820         __ z_lgr(tmp, pre_val); // save pre_val
 821         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread),
 822                         Z_thread);
 823         __ z_lgr(pre_val, tmp); // restore pre_val
 824         restore_volatile_registers(sasm);
 825         __ z_bru(restart);
 826       }
 827       break;
 828 
 829     case g1_post_barrier_slow_id:
 830       { // Z_R1_scratch: oop address, address of updated memory slot
 831         BarrierSet* bs = Universe::heap()->barrier_set();
 832         if (bs->kind() != BarrierSet::G1SATBCTLogging) {




 753         __ bind(return_min_jlong);
 754         __ mov64(rax, UCONST64(0x8000000000000000));
 755         __ jmp(do_return);
 756 
 757         __ bind(return0);
 758         __ fpop();
 759         __ xorptr(rax, rax);
 760 
 761         __ bind(do_return);
 762         __ addptr(rsp, 32);
 763         LP64_ONLY(__ pop(rdx);)
 764         __ pop(rcx);
 765         __ pop(rsi);
 766         __ ret(0);
 767       }
 768       break;
 769 #endif // TODO
 770 
 771 #if INCLUDE_ALL_GCS
 772     case g1_pre_barrier_slow_id:
 773     case g1_pre_barrier_slow_with_recheck_id:
 774       { // Z_R1_scratch: previous value of memory
 775 
 776         BarrierSet* bs = Universe::heap()->barrier_set();
 777         if (bs->kind() != BarrierSet::G1SATBCTLogging) {
 778           __ should_not_reach_here(FILE_AND_LINE);
 779           break;
 780         }
 781 
 782         if (id == g1_pre_barrier_slow_id) {
 783           __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
 784         } else {
 785           __ set_info("g1_pre_barrier_slow_with_recheck_id", dont_gc_arguments);
 786         }
 787 
 788         Register pre_val = Z_R1_scratch;
 789         Register tmp  = Z_R6; // Must be non-volatile because it is used to save pre_val.
 790         Register tmp2 = Z_R7;
 791 
 792         Label refill, restart, marking_not_active;
 793         int satb_q_active_byte_offset =
 794           in_bytes(JavaThread::satb_mark_queue_offset() +
 795                    SATBMarkQueue::byte_offset_of_active());
 796         int satb_q_index_byte_offset =
 797           in_bytes(JavaThread::satb_mark_queue_offset() +
 798                    SATBMarkQueue::byte_offset_of_index());
 799         int satb_q_buf_byte_offset =
 800           in_bytes(JavaThread::satb_mark_queue_offset() +
 801                    SATBMarkQueue::byte_offset_of_buf());
 802 
 803         // Save tmp registers (see assertion in G1PreBarrierStub::emit_code()).
 804         __ z_stg(tmp,  0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 805         __ z_stg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 806 
 807         if (id == g1_pre_barrier_slow_with_recheck_id) {
 808           // Is marking still active?
 809           if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
 810             __ load_and_test_int(tmp, Address(Z_thread, satb_q_active_byte_offset));
 811           } else {
 812             guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
 813             __ load_and_test_byte(tmp, Address(Z_thread, satb_q_active_byte_offset`));
 814           }
 815           __ z_bre(marking_not_active); // Activity indicator is zero, so there is no marking going on currently.
 816         }
 817 
 818         __ bind(restart);
 819         // Load the index into the SATB buffer. SATBMarkQueue::_index is a
 820         // size_t so ld_ptr is appropriate.
 821         __ z_ltg(tmp, satb_q_index_byte_offset, Z_R0, Z_thread);
 822 
 823         // index == 0?
 824         __ z_brz(refill);
 825 
 826         __ z_lg(tmp2, satb_q_buf_byte_offset, Z_thread);
 827         __ add2reg(tmp, -oopSize);
 828 
 829         __ z_stg(pre_val, 0, tmp, tmp2); // [_buf + index] := <address_of_card>
 830         __ z_stg(tmp, satb_q_index_byte_offset, Z_thread);
 831 
 832         __ bind(marking_not_active);
 833         // Restore tmp registers (see assertion in G1PreBarrierStub::emit_code()).
 834         __ z_lg(tmp,  0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 835         __ z_lg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
 836         __ z_br(Z_R14);
 837 
 838         __ bind(refill);
 839         save_volatile_registers(sasm);
 840         __ z_lgr(tmp, pre_val); // save pre_val
 841         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread),
 842                         Z_thread);
 843         __ z_lgr(pre_val, tmp); // restore pre_val
 844         restore_volatile_registers(sasm);
 845         __ z_bru(restart);
 846       }
 847       break;
 848 
 849     case g1_post_barrier_slow_id:
 850       { // Z_R1_scratch: oop address, address of updated memory slot
 851         BarrierSet* bs = Universe::heap()->barrier_set();
 852         if (bs->kind() != BarrierSet::G1SATBCTLogging) {