comparison src/cpu/sparc/vm/templateTable_sparc.cpp @ 10102:f2e682ef3156

8012335: G1: Fix bug with compressed oops in template interpreter on x86 and sparc. Summary: In do_oop_store the uncompressed value of the oop being stored needs to be preserved and passed to g1_write_barrier_post. This is necessary for the heap region cross check to work correctly. Reviewed-by: coleenp, johnc Contributed-by: Martin Doerr <martin.doerr@sap.com>
author johnc
date Wed, 17 Apr 2013 10:57:02 -0700
parents f16e75e0cf11
children 9500809ceead
comparison
equal deleted inserted replaced
10101:df254344edf1 10102:f2e682ef3156
61 // Load and record the previous value. 61 // Load and record the previous value.
62 __ g1_write_barrier_pre(base, index, offset, 62 __ g1_write_barrier_pre(base, index, offset,
63 noreg /* pre_val */, 63 noreg /* pre_val */,
64 tmp, true /*preserve_o_regs*/); 64 tmp, true /*preserve_o_regs*/);
65 65
66 // G1 barrier needs uncompressed oop for region cross check.
67 Register new_val = val;
68 if (UseCompressedOops && val != G0) {
69 new_val = tmp;
70 __ mov(val, new_val);
71 }
72
66 if (index == noreg ) { 73 if (index == noreg ) {
67 assert(Assembler::is_simm13(offset), "fix this code"); 74 assert(Assembler::is_simm13(offset), "fix this code");
68 __ store_heap_oop(val, base, offset); 75 __ store_heap_oop(val, base, offset);
69 } else { 76 } else {
70 __ store_heap_oop(val, base, index); 77 __ store_heap_oop(val, base, index);
77 __ add(base, offset, base); 84 __ add(base, offset, base);
78 } else { 85 } else {
79 __ add(base, index, base); 86 __ add(base, index, base);
80 } 87 }
81 } 88 }
82 __ g1_write_barrier_post(base, val, tmp); 89 __ g1_write_barrier_post(base, new_val, tmp);
83 } 90 }
84 } 91 }
85 break; 92 break;
86 #endif // INCLUDE_ALL_GCS 93 #endif // INCLUDE_ALL_GCS
87 case BarrierSet::CardTableModRef: 94 case BarrierSet::CardTableModRef: