Wed, 25 Oct 2017 17:43:22 +0800
[G1] gen_write_ref_array_{pre/post}_barrier is OK.
src/cpu/mips/vm/stubGenerator_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/stubGenerator_mips_64.cpp Wed Oct 25 17:02:26 2017 +0800 1.2 +++ b/src/cpu/mips/vm/stubGenerator_mips_64.cpp Wed Oct 25 17:43:22 2017 +0800 1.3 @@ -604,24 +604,27 @@ 1.4 switch (bs->kind()) { 1.5 case BarrierSet::G1SATBCT: 1.6 case BarrierSet::G1SATBCTLogging: 1.7 - // // With G1, don't generate the call if we statically know that the target in uninitialized 1.8 - // if (!dest_uninitialized) { 1.9 - // __ pusha(); // push registers 1.10 - // if (count == c_rarg0) { 1.11 - // if (addr == c_rarg1) { 1.12 - // // exactly backwards!! 1.13 - // __ xchgptr(c_rarg1, c_rarg0); 1.14 - // } else { 1.15 - // __ movptr(c_rarg1, count); 1.16 - // __ movptr(c_rarg0, addr); 1.17 - // } 1.18 - // } else { 1.19 - // __ movptr(c_rarg0, addr); 1.20 - // __ movptr(c_rarg1, count); 1.21 - // } 1.22 - // __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2); 1.23 - // __ popa(); 1.24 - // } 1.25 + // With G1, don't generate the call if we statically know that the target in uninitialized 1.26 + if (!dest_uninitialized) { 1.27 + __ pushad(); // push registers 1.28 + if (count == A0) { 1.29 + if (addr == A1) { 1.30 + // exactly backwards!! 1.31 + //__ xchgptr(c_rarg1, c_rarg0); 1.32 + __ move(AT, A0); 1.33 + __ move(A0, A1); 1.34 + __ move(A1, AT); 1.35 + } else { 1.36 + __ move(A1, count); 1.37 + __ move(A0, addr); 1.38 + } 1.39 + } else { 1.40 + __ move(A0, addr); 1.41 + __ move(A1, count); 1.42 + } 1.43 + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2); 1.44 + __ popad(); 1.45 + } 1.46 break; 1.47 case BarrierSet::CardTableModRef: 1.48 case BarrierSet::CardTableExtension: 1.49 @@ -649,20 +652,26 @@ 1.50 switch (bs->kind()) { 1.51 case BarrierSet::G1SATBCT: 1.52 case BarrierSet::G1SATBCTLogging: 1.53 - //{ 1.54 - // __ pusha(); // push registers (overkill) 1.55 - // if (c_rarg0 == count) { // On win64 c_rarg0 == rcx 1.56 - // assert_different_registers(c_rarg1, start); 1.57 - // __ mov(c_rarg1, count); 1.58 - // __ mov(c_rarg0, start); 1.59 - // } else { 1.60 - // assert_different_registers(c_rarg0, count); 1.61 - // __ mov(c_rarg0, start); 1.62 - // __ mov(c_rarg1, count); 1.63 - // } 1.64 - // __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2); 1.65 - // __ popa(); 1.66 - //} 1.67 + { 1.68 + __ pushad(); // push registers (overkill) 1.69 + if (count == A0) { 1.70 + if (start == A1) { 1.71 + // exactly backwards!! 1.72 + //__ xchgptr(c_rarg1, c_rarg0); 1.73 + __ move(AT, A0); 1.74 + __ move(A0, A1); 1.75 + __ move(A1, AT); 1.76 + } else { 1.77 + __ move(A1, count); 1.78 + __ move(A0, start); 1.79 + } 1.80 + } else { 1.81 + __ move(A0, start); 1.82 + __ move(A1, count); 1.83 + } 1.84 + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2); 1.85 + __ popad(); 1.86 + } 1.87 break; 1.88 case BarrierSet::CardTableModRef: 1.89 case BarrierSet::CardTableExtension: