702 // Input:
703 // start - starting address
704 // count - element count
705 void gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
706 assert_different_registers(start, count);
707 BarrierSet* bs = Universe::heap()->barrier_set();
708 switch (bs->kind()) {
709 case BarrierSet::G1SATBCT:
710 case BarrierSet::G1SATBCTLogging:
711 // With G1, don't generate the call if we statically know that the target in uninitialized
712 if (!uninitialized_target) {
713 __ pusha(); // push registers
714 __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
715 start, count);
716 __ popa();
717 }
718 break;
719 case BarrierSet::CardTableModRef:
720 case BarrierSet::CardTableExtension:
721 case BarrierSet::ModRef:
722 break;
723 default :
724 ShouldNotReachHere();
725
726 }
727 }
728
729
730 //
731 // Generate a post-barrier for an array store
732 //
733 // start - starting address
734 // count - element count
735 //
736 // The two input registers are overwritten.
737 //
738 void gen_write_ref_array_post_barrier(Register start, Register count) {
739 BarrierSet* bs = Universe::heap()->barrier_set();
740 assert_different_registers(start, count);
741 switch (bs->kind()) {
755 CardTableModRefBS* ct = (CardTableModRefBS*)bs;
756 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
757
758 Label L_loop;
759 const Register end = count; // elements count; end == start+count-1
760 assert_different_registers(start, end);
761
762 __ lea(end, Address(start, count, Address::times_ptr, -wordSize));
763 __ shrptr(start, CardTableModRefBS::card_shift);
764 __ shrptr(end, CardTableModRefBS::card_shift);
765 __ subptr(end, start); // end --> count
766 __ BIND(L_loop);
767 intptr_t disp = (intptr_t) ct->byte_map_base;
768 Address cardtable(start, count, Address::times_1, disp);
769 __ movb(cardtable, 0);
770 __ decrement(count);
771 __ jcc(Assembler::greaterEqual, L_loop);
772 }
773 break;
774 case BarrierSet::ModRef:
775 break;
776 default :
777 ShouldNotReachHere();
778
779 }
780 }
781
782
783 // Copy 64 bytes chunks
784 //
785 // Inputs:
786 // from - source array address
787 // to_from - destination array address - from
788 // qword_count - 8-bytes element count, negative
789 //
790 void xmm_copy_forward(Register from, Register to_from, Register qword_count) {
791 assert( UseSSE >= 2, "supported cpu only" );
792 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit;
793 // Copy 64-byte chunks
794 __ jmpb(L_copy_64_bytes);
|
702 // Input:
703 // start - starting address
704 // count - element count
705 void gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
706 assert_different_registers(start, count);
707 BarrierSet* bs = Universe::heap()->barrier_set();
708 switch (bs->kind()) {
709 case BarrierSet::G1SATBCT:
710 case BarrierSet::G1SATBCTLogging:
711 // With G1, don't generate the call if we statically know that the target in uninitialized
712 if (!uninitialized_target) {
713 __ pusha(); // push registers
714 __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
715 start, count);
716 __ popa();
717 }
718 break;
719 case BarrierSet::CardTableModRef:
720 case BarrierSet::CardTableExtension:
721 case BarrierSet::ModRef:
722 case BarrierSet::Epsilon:
723 break;
724 default :
725 ShouldNotReachHere();
726
727 }
728 }
729
730
731 //
732 // Generate a post-barrier for an array store
733 //
734 // start - starting address
735 // count - element count
736 //
737 // The two input registers are overwritten.
738 //
739 void gen_write_ref_array_post_barrier(Register start, Register count) {
740 BarrierSet* bs = Universe::heap()->barrier_set();
741 assert_different_registers(start, count);
742 switch (bs->kind()) {
756 CardTableModRefBS* ct = (CardTableModRefBS*)bs;
757 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
758
759 Label L_loop;
760 const Register end = count; // elements count; end == start+count-1
761 assert_different_registers(start, end);
762
763 __ lea(end, Address(start, count, Address::times_ptr, -wordSize));
764 __ shrptr(start, CardTableModRefBS::card_shift);
765 __ shrptr(end, CardTableModRefBS::card_shift);
766 __ subptr(end, start); // end --> count
767 __ BIND(L_loop);
768 intptr_t disp = (intptr_t) ct->byte_map_base;
769 Address cardtable(start, count, Address::times_1, disp);
770 __ movb(cardtable, 0);
771 __ decrement(count);
772 __ jcc(Assembler::greaterEqual, L_loop);
773 }
774 break;
775 case BarrierSet::ModRef:
776 case BarrierSet::Epsilon:
777 break;
778 default :
779 ShouldNotReachHere();
780
781 }
782 }
783
784
785 // Copy 64 bytes chunks
786 //
787 // Inputs:
788 // from - source array address
789 // to_from - destination array address - from
790 // qword_count - 8-bytes element count, negative
791 //
792 void xmm_copy_forward(Register from, Register to_from, Register qword_count) {
793 assert( UseSSE >= 2, "supported cpu only" );
794 Label L_copy_64_bytes_loop, L_copy_64_bytes, L_copy_8_bytes, L_exit;
795 // Copy 64-byte chunks
796 __ jmpb(L_copy_64_bytes);
|