< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page

2288   for (uint i = 0; i < num_regions(); i++) {
2289     assert(_liveness_cache[worker_id][i] == 0, "liveness cache should be empty");
2290   }
2291 #endif
2292   return _liveness_cache[worker_id];
2293 }
2294 
2295 void ShenandoahHeap::flush_liveness_cache(uint worker_id) {
2296   assert(worker_id < _max_workers, "sanity");
2297   assert(_liveness_cache != NULL, "sanity");
2298   ShenandoahLiveData* ld = _liveness_cache[worker_id];
2299   for (uint i = 0; i < num_regions(); i++) {
2300     ShenandoahLiveData live = ld[i];
2301     if (live > 0) {
2302       ShenandoahHeapRegion* r = get_region(i);
2303       r->increase_live_data_gc_words(live);
2304       ld[i] = 0;
2305     }
2306   }
2307 }








2288   for (uint i = 0; i < num_regions(); i++) {
2289     assert(_liveness_cache[worker_id][i] == 0, "liveness cache should be empty");
2290   }
2291 #endif
2292   return _liveness_cache[worker_id];
2293 }
2294 
2295 void ShenandoahHeap::flush_liveness_cache(uint worker_id) {
2296   assert(worker_id < _max_workers, "sanity");
2297   assert(_liveness_cache != NULL, "sanity");
2298   ShenandoahLiveData* ld = _liveness_cache[worker_id];
2299   for (uint i = 0; i < num_regions(); i++) {
2300     ShenandoahLiveData live = ld[i];
2301     if (live > 0) {
2302       ShenandoahHeapRegion* r = get_region(i);
2303       r->increase_live_data_gc_words(live);
2304       ld[i] = 0;
2305     }
2306   }
2307 }
2308 
2309 bool ShenandoahHeap::requires_barriers(oop obj) const {
2310   ShenandoahHeapRegion* region = heap_region_containing(obj);
2311   bool requires_concmark_barriers = is_concurrent_mark_in_progress() && !marking_context()->allocated_after_mark_start(obj);
2312   bool requires_loadref_barriers = has_forwarded_objects() && cast_from_oop<HeapWord*>(obj) < heap_region_containing(obj)->get_update_watermark();
2313   return requires_concmark_barriers || requires_loadref_barriers;
2314 }
< prev index next >