< prev index next >

src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp

Print this page

 208     Node* n = worklist.pop();
 209     if (visited.test_set(n->_idx)) {
 210       continue;
 211     }
 212 
 213     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
 214       Node* out = n->fast_out(i);
 215       switch (out->Opcode()) {
 216         case Op_Phi:
 217         case Op_EncodeP:
 218         case Op_DecodeN:
 219         case Op_CastPP:
 220         case Op_CheckCastPP:
 221         case Op_AddP: {
 222           // Transitive node, check if any other outs are doing anything troublesome.
 223           worklist.push(out);
 224           break;
 225         }
 226 
 227         case Op_LoadRange: {
 228           // Array length is the same in all copies.
 229           break;








 230         }
 231 
 232         case Op_LoadKlass: {
 233           // Klass is the same in all copies.
 234           // We would have liked to assert -UCOH, but there are legitimate klass
 235           // loads from native Klass* instances, which are also safe under +UCOH.
 236           break;
 237         }
 238 
 239         case Op_LoadNKlass: {
 240           // Similar to above, but LoadNKlass is only safe without +UCOH.
 241           // With +UCOH, it loads from mark word, which clashes with forwarding pointers.
 242           if (!UseCompactObjectHeaders) {
 243             break;
 244           }
 245           return false;
 246         }
 247 
 248         case Op_CmpN: {
 249           if (out->in(1) == n &&

 208     Node* n = worklist.pop();
 209     if (visited.test_set(n->_idx)) {
 210       continue;
 211     }
 212 
 213     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
 214       Node* out = n->fast_out(i);
 215       switch (out->Opcode()) {
 216         case Op_Phi:
 217         case Op_EncodeP:
 218         case Op_DecodeN:
 219         case Op_CastPP:
 220         case Op_CheckCastPP:
 221         case Op_AddP: {
 222           // Transitive node, check if any other outs are doing anything troublesome.
 223           worklist.push(out);
 224           break;
 225         }
 226 
 227         case Op_LoadRange: {
 228           // Array length is normally the same in all copies, so it can be read
 229           // from a from-space copy without a barrier. With +UCOH, however, the
 230           // array length lives in the mark word, which is overwritten by the
 231           // forwarding pointer during evacuation, so reading it from a from-space
 232           // copy would yield garbage. Keep the barrier in that case.
 233           // Mirrors Op_LoadNKlass below.
 234           if (!UseCompactObjectHeaders) {
 235             break;
 236           }
 237           return false;
 238         }
 239 
 240         case Op_LoadKlass: {
 241           // Klass is the same in all copies.
 242           // We would have liked to assert -UCOH, but there are legitimate klass
 243           // loads from native Klass* instances, which are also safe under +UCOH.
 244           break;
 245         }
 246 
 247         case Op_LoadNKlass: {
 248           // Similar to above, but LoadNKlass is only safe without +UCOH.
 249           // With +UCOH, it loads from mark word, which clashes with forwarding pointers.
 250           if (!UseCompactObjectHeaders) {
 251             break;
 252           }
 253           return false;
 254         }
 255 
 256         case Op_CmpN: {
 257           if (out->in(1) == n &&
< prev index next >