Mercurial > hg > graal-compiler
diff src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 360:5d254928c888
Merge
author | ysr |
---|---|
date | Wed, 27 Aug 2008 11:20:46 -0700 |
parents | 1ee8caae33af |
children | f8199438385b |
line wrap: on
line diff
--- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Aug 27 10:56:33 2008 -0700 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Aug 27 11:20:46 2008 -0700 @@ -1152,18 +1152,26 @@ // Destroy no registers! // void gen_write_ref_array_pre_barrier(Register addr, Register count) { -#if 0 // G1 - only - assert_different_registers(addr, c_rarg1); - assert_different_registers(count, c_rarg0); BarrierSet* bs = Universe::heap()->barrier_set(); switch (bs->kind()) { case BarrierSet::G1SATBCT: case BarrierSet::G1SATBCTLogging: { __ pushaq(); // push registers - __ movq(c_rarg0, addr); - __ movq(c_rarg1, count); - __ call(RuntimeAddress(BarrierSet::static_write_ref_array_pre)); + if (count == c_rarg0) { + if (addr == c_rarg1) { + // exactly backwards!! + __ xchgq(c_rarg1, c_rarg0); + } else { + __ movq(c_rarg1, count); + __ movq(c_rarg0, addr); + } + + } else { + __ movq(c_rarg0, addr); + __ movq(c_rarg1, count); + } + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre))); __ popaq(); } break; @@ -1171,11 +1179,10 @@ case BarrierSet::CardTableExtension: case BarrierSet::ModRef: break; - default : + default: ShouldNotReachHere(); } -#endif // 0 G1 - only } // @@ -1192,7 +1199,6 @@ assert_different_registers(start, end, scratch); BarrierSet* bs = Universe::heap()->barrier_set(); switch (bs->kind()) { -#if 0 // G1 - only case BarrierSet::G1SATBCT: case BarrierSet::G1SATBCTLogging: @@ -1205,11 +1211,10 @@ __ shrq(scratch, LogBytesPerWord); __ movq(c_rarg0, start); __ movq(c_rarg1, scratch); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); __ popaq(); } break; -#endif // 0 G1 - only case BarrierSet::CardTableModRef: case BarrierSet::CardTableExtension: { @@ -1238,8 +1243,12 @@ __ decrementq(count); __ jcc(Assembler::greaterEqual, L_loop); } - } - } + break; + default: + ShouldNotReachHere(); + + } + } // Copy big chunks forward //