< prev index next >

src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp

Print this page
rev 14282 : Factor out keep-alive barrier from usual pre-barrier implementations.


 246       }
 247     }
 248   }
 249   void do_oop(narrowOop* p) { ShouldNotReachHere(); }
 250   bool value() const        { return _value;  }
 251 };
 252 
 253 void G1SATBCardTableModRefBS::write_ref_nmethod_pre(oop* dst, nmethod* nm) {
 254   oop obj = oopDesc::load_heap_oop(dst);
 255   if (obj != NULL) {
 256     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 257     HeapRegion* hr = g1h->heap_region_containing(obj);
 258     G1EnsureLastRefToRegion ensure_last_ref(g1h, hr, dst);
 259     nm->oops_do(&ensure_last_ref);
 260     if (ensure_last_ref.value()) {
 261       // Last reference to this region, remove the nmethod from the rset.
 262       hr->remove_strong_code_root(nm);
 263     }
 264   }
 265 }






 246       }
 247     }
 248   }
 249   void do_oop(narrowOop* p) { ShouldNotReachHere(); }
 250   bool value() const        { return _value;  }
 251 };
 252 
 253 void G1SATBCardTableModRefBS::write_ref_nmethod_pre(oop* dst, nmethod* nm) {
 254   oop obj = oopDesc::load_heap_oop(dst);
 255   if (obj != NULL) {
 256     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 257     HeapRegion* hr = g1h->heap_region_containing(obj);
 258     G1EnsureLastRefToRegion ensure_last_ref(g1h, hr, dst);
 259     nm->oops_do(&ensure_last_ref);
 260     if (ensure_last_ref.value()) {
 261       // Last reference to this region, remove the nmethod from the rset.
 262       hr->remove_strong_code_root(nm);
 263     }
 264   }
 265 }
 266 
 267 void G1SATBCardTableModRefBS::keep_alive_barrier(oop obj) {
 268   G1SATBCardTableModRefBS::enqueue(obj);
 269 }
< prev index next >