1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Fri Jul 10 16:01:20 2009 -0700 1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue Jul 14 15:40:39 2009 -0700 1.3 @@ -1207,9 +1207,9 @@ 1.4 __ pusha(); // push registers (overkill) 1.5 // must compute element count unless barrier set interface is changed (other platforms supply count) 1.6 assert_different_registers(start, end, scratch); 1.7 - __ lea(scratch, Address(end, wordSize)); 1.8 - __ subptr(scratch, start); 1.9 - __ shrptr(scratch, LogBytesPerWord); 1.10 + __ lea(scratch, Address(end, BytesPerHeapOop)); 1.11 + __ subptr(scratch, start); // subtract start to get #bytes 1.12 + __ shrptr(scratch, LogBytesPerHeapOop); // convert to element count 1.13 __ mov(c_rarg0, start); 1.14 __ mov(c_rarg1, scratch); 1.15 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); 1.16 @@ -1225,6 +1225,7 @@ 1.17 Label L_loop; 1.18 1.19 __ shrptr(start, CardTableModRefBS::card_shift); 1.20 + __ addptr(end, BytesPerHeapOop); 1.21 __ shrptr(end, CardTableModRefBS::card_shift); 1.22 __ subptr(end, start); // number of bytes to copy 1.23 1.24 @@ -2251,6 +2252,7 @@ 1.25 // and report their number to the caller. 1.26 assert_different_registers(rax, r14_length, count, to, end_to, rcx); 1.27 __ lea(end_to, to_element_addr); 1.28 + __ addptr(end_to, -heapOopSize); // make an inclusive end pointer 1.29 gen_write_ref_array_post_barrier(to, end_to, rscratch1); 1.30 __ movptr(rax, r14_length); // original oops 1.31 __ addptr(rax, count); // K = (original - remaining) oops 1.32 @@ -2259,7 +2261,7 @@ 1.33 1.34 // Come here on success only. 1.35 __ BIND(L_do_card_marks); 1.36 - __ addptr(end_to, -wordSize); // make an inclusive end pointer 1.37 + __ addptr(end_to, -heapOopSize); // make an inclusive end pointer 1.38 gen_write_ref_array_post_barrier(to, end_to, rscratch1); 1.39 __ xorptr(rax, rax); // return 0 on success 1.40