660 __ pop(rdx); // get saved rdx back
661 __ popf(); // get saved EFLAGS off stack -- will be ignored
662 __ pusha(); // push registers (eip = return address & msg are already pushed)
663 BLOCK_COMMENT("call MacroAssembler::debug");
664 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
665 __ popa();
666 __ ret(3 * wordSize); // pop arguments
667 return start;
668 }
669
670 //
671 // Generate pre-barrier for array stores
672 //
673 // Input:
674 // start - starting address
675 // count - element count
676 void gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
677 assert_different_registers(start, count);
678 BarrierSet* bs = Universe::heap()->barrier_set();
679 switch (bs->kind()) {
680 #if INCLUDE_ALL_GCS
681 case BarrierSet::G1SATBCTLogging:
682 // With G1, don't generate the call if we statically know that the target in uninitialized
683 if (!uninitialized_target) {
684 Register thread = rax;
685 Label filtered;
686 __ push(thread);
687 __ get_thread(thread);
688 Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
689 SATBMarkQueue::byte_offset_of_active()));
690 // Is marking active?
691 if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
692 __ cmpl(in_progress, 0);
693 } else {
694 assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
695 __ cmpb(in_progress, 0);
696 }
697 __ pop(thread);
698 __ jcc(Assembler::equal, filtered);
699
700 __ pusha(); // push registers
|
660 __ pop(rdx); // get saved rdx back
661 __ popf(); // get saved EFLAGS off stack -- will be ignored
662 __ pusha(); // push registers (eip = return address & msg are already pushed)
663 BLOCK_COMMENT("call MacroAssembler::debug");
664 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
665 __ popa();
666 __ ret(3 * wordSize); // pop arguments
667 return start;
668 }
669
670 //
671 // Generate pre-barrier for array stores
672 //
673 // Input:
674 // start - starting address
675 // count - element count
676 void gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
677 assert_different_registers(start, count);
678 BarrierSet* bs = Universe::heap()->barrier_set();
679 switch (bs->kind()) {
680 case BarrierSet::G1BarrierSet:
681 // With G1, don't generate the call if we statically know that the target in uninitialized
682 if (!uninitialized_target) {
683 Register thread = rax;
684 Label filtered;
685 __ push(thread);
686 __ get_thread(thread);
687 Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
688 SATBMarkQueue::byte_offset_of_active()));
689 // Is marking active?
690 if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
691 __ cmpl(in_progress, 0);
692 } else {
693 assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
694 __ cmpb(in_progress, 0);
695 }
696 __ pop(thread);
697 __ jcc(Assembler::equal, filtered);
698
699 __ pusha(); // push registers
|
710 break;
711 default :
712 ShouldNotReachHere();
713
714 }
715 }
716
717
718 //
719 // Generate a post-barrier for an array store
720 //
721 // start - starting address
722 // count - element count
723 //
724 // The two input registers are overwritten.
725 //
726 void gen_write_ref_array_post_barrier(Register start, Register count) {
727 BarrierSet* bs = Universe::heap()->barrier_set();
728 assert_different_registers(start, count);
729 switch (bs->kind()) {
730 #if INCLUDE_ALL_GCS
731 case BarrierSet::G1SATBCTLogging:
732 {
733 __ pusha(); // push registers
734 __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post),
735 start, count);
736 __ popa();
737 }
738 break;
739 #endif // INCLUDE_ALL_GCS
740
741 case BarrierSet::CardTableModRef:
742 {
743 CardTableModRefBS* ctbs = barrier_set_cast<CardTableModRefBS>(bs);
744 CardTable* ct = ctbs->card_table();
745 assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");
746
747 Label L_loop;
748 const Register end = count; // elements count; end == start+count-1
749 assert_different_registers(start, end);
750
|
709 break;
710 default :
711 ShouldNotReachHere();
712
713 }
714 }
715
716
717 //
718 // Generate a post-barrier for an array store
719 //
720 // start - starting address
721 // count - element count
722 //
723 // The two input registers are overwritten.
724 //
725 void gen_write_ref_array_post_barrier(Register start, Register count) {
726 BarrierSet* bs = Universe::heap()->barrier_set();
727 assert_different_registers(start, count);
728 switch (bs->kind()) {
729 case BarrierSet::G1BarrierSet:
730 {
731 __ pusha(); // push registers
732 __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post),
733 start, count);
734 __ popa();
735 }
736 break;
737 #endif // INCLUDE_ALL_GCS
738
739 case BarrierSet::CardTableModRef:
740 {
741 CardTableModRefBS* ctbs = barrier_set_cast<CardTableModRefBS>(bs);
742 CardTable* ct = ctbs->card_table();
743 assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");
744
745 Label L_loop;
746 const Register end = count; // elements count; end == start+count-1
747 assert_different_registers(start, end);
748
|