24 */
25
26 #include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
27 #include "gc/shenandoah/mode/shenandoahMode.hpp"
28 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
29 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
30 #include "gc/shenandoah/shenandoahForwarding.hpp"
31 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
32 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
33 #include "gc/shenandoah/shenandoahRuntime.hpp"
34 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
35 #include "interpreter/interpreter.hpp"
36 #include "runtime/javaThread.hpp"
37 #include "runtime/sharedRuntime.hpp"
38 #include "utilities/macros.hpp"
39 #ifdef COMPILER1
40 #include "c1/c1_LIRAssembler.hpp"
41 #include "c1/c1_MacroAssembler.hpp"
42 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
43 #endif
44
45 #define __ masm->
46
47 static void save_machine_state(MacroAssembler* masm, bool handle_gpr, bool handle_fp) {
48 if (handle_gpr) {
49 __ push_IU_state();
50 }
51
52 if (handle_fp) {
53 // Some paths can be reached from the c2i adapter with live fp arguments in registers.
54 assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call");
55
56 const int xmm_size = wordSize * 2;
57 __ subptr(rsp, xmm_size * 8);
58 __ movdbl(Address(rsp, xmm_size * 0), xmm0);
59 __ movdbl(Address(rsp, xmm_size * 1), xmm1);
60 __ movdbl(Address(rsp, xmm_size * 2), xmm2);
61 __ movdbl(Address(rsp, xmm_size * 3), xmm3);
62 __ movdbl(Address(rsp, xmm_size * 4), xmm4);
63 __ movdbl(Address(rsp, xmm_size * 5), xmm5);
655 if (UseCompressedOops) {
656 __ lock();
657 __ cmpxchgl(newval, addr);
658 } else {
659 __ lock();
660 __ cmpxchgptr(newval, addr);
661 }
662 __ jcc(Assembler::equal, L_success);
663
664 // Step 2. CAS had failed. This may be a false negative.
665 //
666 // The trouble comes when we compare the to-space pointer with the from-space
667 // pointer to the same object. To resolve this, it will suffice to resolve
668 // the value from memory -- this will give both to-space pointers.
669 // If they mismatch, then it was a legitimate failure.
670 //
671 // Before reaching to resolve sequence, see if we can avoid the whole shebang
672 // with filters.
673
674 // Filter: when offending in-memory value is null, the failure is definitely legitimate
675 __ testptr(oldval, oldval);
676 __ jcc(Assembler::zero, L_failure);
677
678 // Filter: when heap is stable, the failure is definitely legitimate
679 const Register thread = r15_thread;
680 Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
681 __ testb(gc_state, ShenandoahHeap::HAS_FORWARDED);
682 __ jcc(Assembler::zero, L_failure);
683
684 if (UseCompressedOops) {
685 __ movl(tmp2, oldval);
686 __ decode_heap_oop(tmp2);
687 } else {
688 __ movptr(tmp2, oldval);
689 }
690
691 // Decode offending in-memory value.
692 // Test if-forwarded
693 __ testb(Address(tmp2, oopDesc::mark_offset_in_bytes()), markWord::marked_value);
694 __ jcc(Assembler::noParity, L_failure); // When odd number of bits, then not forwarded
695 __ jcc(Assembler::zero, L_failure); // When it is 00, then also not forwarded
757 // and promote the result. Note that we handle the flag from both the 1st and 2nd CAS.
758 // Otherwise, failure witness for CAE is in oldval on all paths, and we can return.
759
760 if (exchange) {
761 __ bind(L_failure);
762 __ bind(L_success);
763 } else {
764 assert(res != noreg, "need result register");
765
766 Label exit;
767 __ bind(L_failure);
768 __ xorptr(res, res);
769 __ jmpb(exit);
770
771 __ bind(L_success);
772 __ movptr(res, 1);
773 __ bind(exit);
774 }
775 }
776
777 #ifdef PRODUCT
778 #define BLOCK_COMMENT(str) /* nothing */
779 #else
780 #define BLOCK_COMMENT(str) __ block_comment(str)
781 #endif
782
783 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
784
785 #define TIMES_OOP (UseCompressedOops ? Address::times_4 : Address::times_8)
786
787 void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
788 Register addr, Register count,
789 Register tmp) {
790 assert(ShenandoahCardBarrier, "Should have been checked by caller");
791
792 Label L_loop, L_done;
793 const Register end = count;
794 assert_different_registers(addr, end);
795
796 // Zero count? Nothing to do.
|
24 */
25
26 #include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
27 #include "gc/shenandoah/mode/shenandoahMode.hpp"
28 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
29 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
30 #include "gc/shenandoah/shenandoahForwarding.hpp"
31 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
32 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
33 #include "gc/shenandoah/shenandoahRuntime.hpp"
34 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
35 #include "interpreter/interpreter.hpp"
36 #include "runtime/javaThread.hpp"
37 #include "runtime/sharedRuntime.hpp"
38 #include "utilities/macros.hpp"
39 #ifdef COMPILER1
40 #include "c1/c1_LIRAssembler.hpp"
41 #include "c1/c1_MacroAssembler.hpp"
42 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
43 #endif
44 #ifdef COMPILER2
45 #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
46 #endif
47
48 #define __ masm->
49
50 static void save_machine_state(MacroAssembler* masm, bool handle_gpr, bool handle_fp) {
51 if (handle_gpr) {
52 __ push_IU_state();
53 }
54
55 if (handle_fp) {
56 // Some paths can be reached from the c2i adapter with live fp arguments in registers.
57 assert(Argument::n_float_register_parameters_j == 8, "8 fp registers to save at java call");
58
59 const int xmm_size = wordSize * 2;
60 __ subptr(rsp, xmm_size * 8);
61 __ movdbl(Address(rsp, xmm_size * 0), xmm0);
62 __ movdbl(Address(rsp, xmm_size * 1), xmm1);
63 __ movdbl(Address(rsp, xmm_size * 2), xmm2);
64 __ movdbl(Address(rsp, xmm_size * 3), xmm3);
65 __ movdbl(Address(rsp, xmm_size * 4), xmm4);
66 __ movdbl(Address(rsp, xmm_size * 5), xmm5);
658 if (UseCompressedOops) {
659 __ lock();
660 __ cmpxchgl(newval, addr);
661 } else {
662 __ lock();
663 __ cmpxchgptr(newval, addr);
664 }
665 __ jcc(Assembler::equal, L_success);
666
667 // Step 2. CAS had failed. This may be a false negative.
668 //
669 // The trouble comes when we compare the to-space pointer with the from-space
670 // pointer to the same object. To resolve this, it will suffice to resolve
671 // the value from memory -- this will give both to-space pointers.
672 // If they mismatch, then it was a legitimate failure.
673 //
674 // Before reaching to resolve sequence, see if we can avoid the whole shebang
675 // with filters.
676
677 // Filter: when offending in-memory value is null, the failure is definitely legitimate
678 if (UseCompressedOops) {
679 __ testl(oldval, oldval);
680 } else {
681 __ testptr(oldval, oldval);
682 }
683 __ jcc(Assembler::zero, L_failure);
684
685 // Filter: when heap is stable, the failure is definitely legitimate
686 const Register thread = r15_thread;
687 Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
688 __ testb(gc_state, ShenandoahHeap::HAS_FORWARDED);
689 __ jcc(Assembler::zero, L_failure);
690
691 if (UseCompressedOops) {
692 __ movl(tmp2, oldval);
693 __ decode_heap_oop(tmp2);
694 } else {
695 __ movptr(tmp2, oldval);
696 }
697
698 // Decode offending in-memory value.
699 // Test if-forwarded
700 __ testb(Address(tmp2, oopDesc::mark_offset_in_bytes()), markWord::marked_value);
701 __ jcc(Assembler::noParity, L_failure); // When odd number of bits, then not forwarded
702 __ jcc(Assembler::zero, L_failure); // When it is 00, then also not forwarded
764 // and promote the result. Note that we handle the flag from both the 1st and 2nd CAS.
765 // Otherwise, failure witness for CAE is in oldval on all paths, and we can return.
766
767 if (exchange) {
768 __ bind(L_failure);
769 __ bind(L_success);
770 } else {
771 assert(res != noreg, "need result register");
772
773 Label exit;
774 __ bind(L_failure);
775 __ xorptr(res, res);
776 __ jmpb(exit);
777
778 __ bind(L_success);
779 __ movptr(res, 1);
780 __ bind(exit);
781 }
782 }
783
784 #ifdef COMPILER2
785 void ShenandoahBarrierSetAssembler::load_ref_barrier_c2(const MachNode* node, MacroAssembler* masm, Register obj, Register addr, Register tmp1, Register tmp2, Register tmp3, bool narrow) {
786 if (!ShenandoahLoadRefBarrierStubC2::needs_barrier(node)) {
787 return;
788 }
789 Assembler::InlineSkippedInstructionsCounter skip_counter(masm);
790
791 ShenandoahLoadRefBarrierStubC2* const stub = ShenandoahLoadRefBarrierStubC2::create(node, obj, addr, tmp1, tmp2, tmp3, narrow);
792 stub->dont_preserve(obj);
793
794 Address gc_state(r15_thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
795 int flags = ShenandoahHeap::HAS_FORWARDED;
796 bool is_strong = (node->barrier_data() & ShenandoahBarrierStrong) != 0;
797 if (!is_strong) {
798 flags |= ShenandoahHeap::WEAK_ROOTS;
799 }
800 __ testb(gc_state, flags);
801 __ jcc(Assembler::notZero, *stub->entry());
802 __ bind(*stub->continuation());
803 }
804
805 void ShenandoahBarrierSetAssembler::satb_barrier_c2(const MachNode* node, MacroAssembler* masm,
806 Register addr, Register preval, Register tmp) {
807 if (!ShenandoahSATBBarrierStubC2::needs_barrier(node)) {
808 return;
809 }
810 ShenandoahSATBBarrierStubC2* const stub = ShenandoahSATBBarrierStubC2::create(node, addr, preval, tmp);
811 Assembler::InlineSkippedInstructionsCounter skip_counter(masm);
812 Address gc_state(r15_thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
813 __ testb(gc_state, ShenandoahHeap::MARKING);
814 __ jcc(Assembler::notZero, *stub->entry());
815 __ bind(*stub->continuation());
816 }
817
818 void ShenandoahBarrierSetAssembler::card_barrier_c2(const MachNode* node, MacroAssembler* masm,
819 Register addr, Register addr_tmp, Register tmp) {
820 if (!ShenandoahCardBarrier ||
821 (node->barrier_data() & (ShenandoahBarrierCardMark | ShenandoahBarrierCardMarkNotNull)) == 0) {
822 return;
823 }
824 Assembler::InlineSkippedInstructionsCounter skip_counter(masm);
825 if (addr != noreg) {
826 __ mov(addr_tmp, addr);
827 }
828 __ shrptr(addr_tmp, CardTable::card_shift());
829
830 Address curr_ct_holder_addr(r15_thread, in_bytes(ShenandoahThreadLocalData::card_table_offset()));
831 __ movptr(tmp, curr_ct_holder_addr);
832 Address card_addr(tmp, addr_tmp, Address::times_1);
833
834 int dirty = CardTable::dirty_card_val();
835 if (UseCondCardMark) {
836 Label L_already_dirty;
837 __ cmpb(card_addr, dirty);
838 __ jccb(Assembler::equal, L_already_dirty);
839 __ movb(card_addr, dirty);
840 __ bind(L_already_dirty);
841 } else {
842 __ movb(card_addr, dirty);
843 }
844 }
845
846 void ShenandoahBarrierSetAssembler::cmpxchg_oop_c2(const MachNode* node, MacroAssembler* masm,
847 Register res, Address addr, Register oldval, Register newval, Register tmp1, Register tmp2,
848 bool exchange) {
849 assert(oldval == rax, "must be in rax for implicit use in cmpxchg");
850 assert_different_registers(oldval, tmp1, tmp2);
851 assert_different_registers(newval, tmp1, tmp2);
852
853 ShenandoahCASBarrierSlowStubC2* const slow_stub = ShenandoahCASBarrierSlowStubC2::create(node, addr, oldval, newval, res, tmp1, tmp2, exchange);
854 ShenandoahCASBarrierMidStubC2* const mid_stub = ShenandoahCASBarrierMidStubC2::create(node, slow_stub, oldval, res, tmp1, exchange);
855
856 Label L_success, L_failure;
857
858 // Remember oldval for retry logic below. It will be overwritten by the CAS.
859 if (ShenandoahCASBarrier) {
860 __ movptr(tmp2, oldval);
861 }
862
863 // Step 1. Fast-path.
864 //
865 // Try to CAS with given arguments. If successful, then we are done.
866 __ lock();
867 if (UseCompressedOops) {
868 __ cmpxchgl(newval, addr);
869 } else {
870 __ cmpxchgptr(newval, addr);
871 }
872
873 if (!ShenandoahCASBarrier) {
874 if (!exchange) {
875 assert(res != noreg, "need result register");
876 __ setcc(Assembler::equal, res);
877 }
878 return;
879 }
880
881 __ jcc(Assembler::notEqual, *mid_stub->entry());
882
883 // Slow-stub re-enters with condition flags according to CAS, we may need to
884 // set result accordingly.
885 __ bind(*slow_stub->continuation());
886
887 // Step 5. If we need a boolean result out of CAS, set the flag appropriately.
888 // and promote the result. Note that we handle the flag from both the 1st and 2nd CAS.
889 // Otherwise, failure witness for CAE is in oldval on all paths, and we can return.
890
891 if (!exchange) {
892 assert(res != noreg, "need result register");
893 __ setcc(Assembler::equal, res);
894 }
895
896 // Mid-stub re-enters with result set correctly.
897 __ bind(*mid_stub->continuation());
898 }
899
900 #undef __
901 #define __ masm.
902
903 void ShenandoahLoadRefBarrierStubC2::emit_code(MacroAssembler& masm) {
904 Assembler::InlineSkippedInstructionsCounter skip_counter(&masm);
905 __ bind(*entry());
906
907 Register obj = _obj;
908 if (_narrow) {
909 __ movl(_tmp1, _obj);
910 __ decode_heap_oop(_tmp1);
911 obj = _tmp1;
912 }
913
914 // Weak/phantom loads always need to go to runtime.
915 if ((_node->barrier_data() & ShenandoahBarrierStrong) != 0) {
916 __ movptr(_tmp2, obj);
917 __ shrptr(_tmp2, ShenandoahHeapRegion::region_size_bytes_shift_jint());
918 __ movptr(_tmp3, (intptr_t) ShenandoahHeap::in_cset_fast_test_addr());
919 __ movbool(_tmp2, Address(_tmp2, _tmp3, Address::times_1));
920 __ testbool(_tmp2);
921 __ jcc(Assembler::zero, *continuation());
922 }
923
924 {
925 SaveLiveRegisters save_registers(&masm, this);
926 if (c_rarg0 != obj) {
927 if (c_rarg0 == _addr) {
928 __ movptr(_tmp2, _addr);
929 _addr = _tmp2;
930 }
931 __ movptr(c_rarg0, obj);
932 }
933 __ movptr(c_rarg1, _addr);
934
935 address entry;
936 if (_narrow) {
937 if ((_node->barrier_data() & ShenandoahBarrierStrong) != 0) {
938 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong_narrow);
939 } else if ((_node->barrier_data() & ShenandoahBarrierWeak) != 0) {
940 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow);
941 } else if ((_node->barrier_data() & ShenandoahBarrierPhantom) != 0) {
942 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
943 }
944 } else {
945 if ((_node->barrier_data() & ShenandoahBarrierStrong) != 0) {
946 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong);
947 } else if ((_node->barrier_data() & ShenandoahBarrierWeak) != 0) {
948 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak);
949 } else if ((_node->barrier_data() & ShenandoahBarrierPhantom) != 0) {
950 entry = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom);
951 }
952 }
953 __ call(RuntimeAddress(entry), rax);
954 assert(!save_registers.contains(_obj), "must not save result register");
955 __ movptr(_obj, rax);
956 }
957 if (_narrow) {
958 __ encode_heap_oop(_obj);
959 }
960
961 __ jmp(*continuation());
962 }
963
964 void ShenandoahSATBBarrierStubC2::emit_code(MacroAssembler& masm) {
965 __ bind(*entry());
966 Address index(r15_thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()));
967 Address buffer(r15_thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()));
968
969 Label runtime;
970
971 // Do we need to load the previous value?
972 if (_addr != noreg) {
973 __ load_heap_oop(_preval, Address(_addr, 0), noreg, AS_RAW);
974 }
975 // Is the previous value null?
976 __ cmpptr(_preval, NULL_WORD);
977 __ jcc(Assembler::equal, *continuation());
978
979 // Can we store a value in the given thread's buffer?
980 // (The index field is typed as size_t.)
981 __ movptr(_tmp, index);
982 __ testptr(_tmp, _tmp);
983 __ jccb(Assembler::zero, runtime);
984 // The buffer is not full, store value into it.
985 __ subptr(_tmp, wordSize);
986 __ movptr(index, _tmp);
987 __ addptr(_tmp, buffer);
988 __ movptr(Address(_tmp, 0), _preval);
989
990 __ jmp(*continuation());
991
992 __ bind(runtime);
993 {
994 SaveLiveRegisters save_registers(&masm, this);
995 if (c_rarg0 != _preval) {
996 __ mov(c_rarg0, _preval);
997 }
998 // rax is a caller-saved, non-argument-passing register, so it does not
999 // interfere with c_rarg0 or c_rarg1. If it contained any live value before
1000 // entering this stub, it is saved at this point, and restored after the
1001 // call. If it did not contain any live value, it is free to be used. In
1002 // either case, it is safe to use it here as a call scratch register.
1003 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_barrier_pre_c2)), rax);
1004 }
1005 __ jmp(*continuation());
1006 }
1007
1008 void ShenandoahCASBarrierMidStubC2::emit_code(MacroAssembler& masm) {
1009 __ bind(*entry());
1010
1011 if (!_cae) {
1012 // Set result to false, in case that we fail the following tests.
1013 // Failing those tests means legitimate failures.
1014 // Otherwise, result will be set correctly after returning from
1015 // the slow-path.
1016 if (UseCompressedOops) {
1017 __ movl(_result, 0);
1018 } else {
1019 __ movptr(_result, 0);
1020 }
1021 }
1022 // Check if CAS result is null. If it is, then we must have a legitimate failure.
1023 // This makes loading the fwdptr in the slow-path simpler.
1024 if (UseCompressedOops) {
1025 __ testl(_expected, _expected);
1026 } else {
1027 __ testptr(_expected, _expected);
1028 }
1029 __ jcc(Assembler::equal, *continuation());
1030
1031 // Check if GC is in progress, otherwise we must have a legitimate failure.
1032 Address gc_state(r15_thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
1033 __ testb(gc_state, ShenandoahHeap::HAS_FORWARDED);
1034 __ jcc(Assembler::notZero, *_slow_stub->entry());
1035 __ jmp(*continuation());
1036 }
1037
1038 void ShenandoahCASBarrierSlowStubC2::emit_code(MacroAssembler& masm) {
1039 __ bind(*entry());
1040
1041 assert(_expected == rax, "expected must be rax");
1042
1043 // Step 2. CAS has failed because the value held at addr does not
1044 // match expected. This may be a false negative because the value fetched
1045 // from addr (now held in result) may be a from-space pointer to the
1046 // original copy of same object referenced by to-space pointer expected.
1047 //
1048 // To resolve this, it suffices to find the forward pointer associated
1049 // with fetched value. If this matches expected, retry CAS with new
1050 // parameters. If this mismatches, then we have a legitimate
1051 // failure, and we're done.
1052
1053 // overwrite tmp1 with from-space pointer fetched from memory
1054 __ movptr(_tmp1, _expected);
1055
1056 if (UseCompressedOops) {
1057 __ decode_heap_oop_not_null(_tmp1);
1058 }
1059
1060 // Load/decode forwarding pointer.
1061 __ movq(_tmp1, Address(_tmp1, oopDesc::mark_offset_in_bytes()));
1062 // Negate the mark-word. This allows us to test lowest 2 bits easily while preserving the upper bits.
1063 __ negq(_tmp1);
1064 __ testq(_tmp1, markWord::lock_mask_in_place);
1065 // Not forwarded, must have a legit CAS failure.
1066 __ jcc(Assembler::notEqual, *continuation());
1067 // Set the lowest two bits. This is equivalent to clearing the two bits after
1068 // the subsequent inversion.
1069 __ orq(_tmp1, markWord::marked_value);
1070 // And invert back to get the forwardee.
1071 __ negq(_tmp1);
1072
1073 if (UseCompressedOops) {
1074 __ encode_heap_oop_not_null(_tmp1); // encode for comparison
1075 }
1076
1077 // Now we have the forwarded offender in tmp1.
1078 // We preserved the original expected value in tmp2 in the fast-path.
1079 // Compare and if they don't match, we have legitimate failure
1080 __ cmpptr(_tmp1, _tmp2);
1081 __ jcc(Assembler::notEqual, *continuation());
1082
1083 // Fall through to step 3.
1084
1085 // Step 3. We've confirmed that the value originally held in memory
1086 // (now held in result) pointed to from-space version of original
1087 // expected value. Try the CAS again with the from-space expected
1088 // value. If it now succeeds, we're good.
1089 //
1090 // Note: expected holds encoded from-space pointer that matches to-space
1091 // object residing at tmp1.
1092 __ lock();
1093 if (UseCompressedOops) {
1094 __ cmpxchgl(_new_val, _addr);
1095 } else {
1096 __ cmpxchgptr(_new_val, _addr);
1097 }
1098
1099 // If fetched value did not equal the new expected, this could
1100 // still be a false negative because some other (GC) thread may have
1101 // newly overwritten the memory value with its to-space equivalent.
1102 __ jcc(Assembler::equal, *continuation());
1103
1104 // Step 4. Try to CAS again, but with the original to-space expected.
1105 // This should be very rare.
1106 __ movptr(_expected, _tmp2);
1107 __ lock();
1108 if (UseCompressedOops) {
1109 __ cmpxchgl(_new_val, _addr);
1110 } else {
1111 __ cmpxchgptr(_new_val, _addr);
1112 }
1113 // At this point, there can no longer be false negatives.
1114 __ jmp(*continuation());
1115 }
1116
1117 #undef __
1118 #define __ masm->
1119 #endif
1120
1121 #ifdef PRODUCT
1122 #define BLOCK_COMMENT(str) /* nothing */
1123 #else
1124 #define BLOCK_COMMENT(str) __ block_comment(str)
1125 #endif
1126
1127 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
1128
1129 #define TIMES_OOP (UseCompressedOops ? Address::times_4 : Address::times_8)
1130
1131 void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
1132 Register addr, Register count,
1133 Register tmp) {
1134 assert(ShenandoahCardBarrier, "Should have been checked by caller");
1135
1136 Label L_loop, L_done;
1137 const Register end = count;
1138 assert_different_registers(addr, end);
1139
1140 // Zero count? Nothing to do.
|