2192 // reference stores need a store barrier. |
2192 // reference stores need a store barrier. |
2193 // (They don't if CAS fails, but it isn't worth checking.) |
2193 // (They don't if CAS fails, but it isn't worth checking.) |
2194 pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT); |
2194 pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT); |
2195 #ifdef _LP64 |
2195 #ifdef _LP64 |
2196 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
2196 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
|
2197 Node *newval_enc = _gvn.transform(new (C, 2) EncodePNode(newval, newval->bottom_type()->make_narrowoop())); |
|
2198 Node *oldval_enc = _gvn.transform(new (C, 2) EncodePNode(oldval, oldval->bottom_type()->make_narrowoop())); |
2197 cas = _gvn.transform(new (C, 5) CompareAndSwapNNode(control(), mem, adr, |
2199 cas = _gvn.transform(new (C, 5) CompareAndSwapNNode(control(), mem, adr, |
2198 EncodePNode::encode(&_gvn, newval), |
2200 newval_enc, oldval_enc)); |
2199 EncodePNode::encode(&_gvn, oldval))); |
|
2200 } else |
2201 } else |
2201 #endif |
2202 #endif |
2202 { |
2203 { |
2203 cas = _gvn.transform(new (C, 5) CompareAndSwapPNode(control(), mem, adr, newval, oldval)); |
2204 cas = _gvn.transform(new (C, 5) CompareAndSwapPNode(control(), mem, adr, newval, oldval)); |
2204 } |
2205 } |
2205 post_barrier(control(), cas, base, adr, alias_idx, newval, T_OBJECT, true); |
2206 post_barrier(control(), cas, base, adr, alias_idx, newval, T_OBJECT, true); |
2206 break; |
2207 break; |
2207 default: |
2208 default: |
2208 ShouldNotReachHere(); |
2209 ShouldNotReachHere(); |
2209 break; |
2210 break; |