1.1 --- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp Wed Jun 04 13:51:09 2008 -0700 1.2 +++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp Thu Jun 05 15:57:56 2008 -0700 1.3 @@ -1110,30 +1110,31 @@ 1.4 // The input registers are overwritten. 1.5 // 1.6 void gen_write_ref_array_pre_barrier(Register addr, Register count) { 1.7 -#if 0 // G1 only 1.8 BarrierSet* bs = Universe::heap()->barrier_set(); 1.9 if (bs->has_write_ref_pre_barrier()) { 1.10 assert(bs->has_write_ref_array_pre_opt(), 1.11 "Else unsupported barrier set."); 1.12 1.13 - assert(addr->is_global() && count->is_global(), 1.14 - "If not, then we have to fix this code to handle more " 1.15 - "general cases."); 1.16 - // Get some new fresh output registers. 1.17 __ save_frame(0); 1.18 // Save the necessary global regs... will be used after. 1.19 - __ mov(addr, L0); 1.20 - __ mov(count, L1); 1.21 - 1.22 - __ mov(addr, O0); 1.23 + if (addr->is_global()) { 1.24 + __ mov(addr, L0); 1.25 + } 1.26 + if (count->is_global()) { 1.27 + __ mov(count, L1); 1.28 + } 1.29 + __ mov(addr->after_save(), O0); 1.30 // Get the count into O1 1.31 __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre)); 1.32 - __ delayed()->mov(count, O1); 1.33 - __ mov(L0, addr); 1.34 - __ mov(L1, count); 1.35 + __ delayed()->mov(count->after_save(), O1); 1.36 + if (addr->is_global()) { 1.37 + __ mov(L0, addr); 1.38 + } 1.39 + if (count->is_global()) { 1.40 + __ mov(L1, count); 1.41 + } 1.42 __ restore(); 1.43 } 1.44 -#endif // 0 1.45 } 1.46 // 1.47 // Generate post-write barrier for array. 1.48 @@ -1150,22 +1151,17 @@ 1.49 BarrierSet* bs = Universe::heap()->barrier_set(); 1.50 1.51 switch (bs->kind()) { 1.52 -#if 0 // G1 - only 1.53 case BarrierSet::G1SATBCT: 1.54 case BarrierSet::G1SATBCTLogging: 1.55 { 1.56 - assert(addr->is_global() && count->is_global(), 1.57 - "If not, then we have to fix this code to handle more " 1.58 - "general cases."); 1.59 // Get some new fresh output registers. 1.60 __ save_frame(0); 1.61 - __ mov(addr, O0); 1.62 + __ mov(addr->after_save(), O0); 1.63 __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post)); 1.64 - __ delayed()->mov(count, O1); 1.65 + __ delayed()->mov(count->after_save(), O1); 1.66 __ restore(); 1.67 } 1.68 break; 1.69 -#endif // 0 G1 - only 1.70 case BarrierSet::CardTableModRef: 1.71 case BarrierSet::CardTableExtension: 1.72 { 1.73 @@ -2412,8 +2408,7 @@ 1.74 StubCodeMark mark(this, "StubRoutines", name); 1.75 address start = __ pc(); 1.76 1.77 - gen_write_ref_array_pre_barrier(G1, G5); 1.78 - 1.79 + gen_write_ref_array_pre_barrier(O1, O2); 1.80 1.81 #ifdef ASSERT 1.82 // We sometimes save a frame (see partial_subtype_check below).