1.1 --- a/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Wed Jun 04 13:51:09 2008 -0700 1.2 +++ b/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Thu Jun 05 15:57:56 2008 -0700 1.3 @@ -365,6 +365,10 @@ 1.4 __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info); 1.5 } 1.6 1.7 + if (obj_store) { 1.8 + // Needs GC write barriers. 1.9 + pre_barrier(LIR_OprFact::address(array_addr), false, NULL); 1.10 + } 1.11 __ move(value.result(), array_addr, null_check_info); 1.12 if (obj_store) { 1.13 // Is this precise? 1.14 @@ -663,6 +667,10 @@ 1.15 1.16 __ add(obj.result(), offset.result(), addr); 1.17 1.18 + if (type == objectType) { // Write-barrier needed for Object fields. 1.19 + pre_barrier(obj.result(), false, NULL); 1.20 + } 1.21 + 1.22 if (type == objectType) 1.23 __ cas_obj(addr, cmp.result(), val.result(), t1, t2); 1.24 else if (type == intType) 1.25 @@ -677,7 +685,11 @@ 1.26 LIR_Opr result = rlock_result(x); 1.27 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 1.28 if (type == objectType) { // Write-barrier needed for Object fields. 1.29 +#ifdef PRECISE_CARDMARK 1.30 + post_barrier(addr, val.result()); 1.31 +#else 1.32 post_barrier(obj.result(), val.result()); 1.33 +#endif // PRECISE_CARDMARK 1.34 } 1.35 } 1.36 1.37 @@ -1153,6 +1165,10 @@ 1.38 addr = new LIR_Address(base_op, index_op, type); 1.39 } 1.40 1.41 + if (is_obj) { 1.42 + pre_barrier(LIR_OprFact::address(addr), false, NULL); 1.43 + // _bs->c1_write_barrier_pre(this, LIR_OprFact::address(addr)); 1.44 + } 1.45 __ move(data, addr); 1.46 if (is_obj) { 1.47 // This address is precise