1315
1316 // Work through the oop stack to traverse heap.
1317 while (! oop_stack.is_empty()) {
1318 oop obj = oop_stack.pop();
1319 assert(oopDesc::is_oop(obj), "must be a valid oop");
1320 cl->do_object(obj);
1321 obj->oop_iterate(&oops);
1322 }
1323
1324 assert(oop_stack.is_empty(), "should be empty");
1325
1326 if (!_aux_bitmap_region_special && !os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size())) {
1327 log_warning(gc)("Could not uncommit native memory for auxiliary marking bitmap for heap iteration");
1328 }
1329 }
1330
1331 // Keep alive an object that was loaded with AS_NO_KEEPALIVE.
1332 void ShenandoahHeap::keep_alive(oop obj) {
1333 if (is_concurrent_mark_in_progress()) {
1334 ShenandoahBarrierSet::barrier_set()->enqueue(obj);
1335 } else {
1336 // Otherwise, it must be live, guaranteed by LRB
1337 shenandoah_assert_marked_if(NULL, obj, has_forwarded_objects());
1338 }
1339 }
1340
1341 void ShenandoahHeap::heap_region_iterate(ShenandoahHeapRegionClosure* blk) const {
1342 for (size_t i = 0; i < num_regions(); i++) {
1343 ShenandoahHeapRegion* current = get_region(i);
1344 blk->heap_region_do(current);
1345 }
1346 }
1347
1348 class ShenandoahParallelHeapRegionTask : public AbstractGangTask {
1349 private:
1350 ShenandoahHeap* const _heap;
1351 ShenandoahHeapRegionClosure* const _blk;
1352
1353 DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
1354 volatile size_t _index;
1355 DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, 0);
1356
1357 public:
|
1315
1316 // Work through the oop stack to traverse heap.
1317 while (! oop_stack.is_empty()) {
1318 oop obj = oop_stack.pop();
1319 assert(oopDesc::is_oop(obj), "must be a valid oop");
1320 cl->do_object(obj);
1321 obj->oop_iterate(&oops);
1322 }
1323
1324 assert(oop_stack.is_empty(), "should be empty");
1325
1326 if (!_aux_bitmap_region_special && !os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size())) {
1327 log_warning(gc)("Could not uncommit native memory for auxiliary marking bitmap for heap iteration");
1328 }
1329 }
1330
1331 // Keep alive an object that was loaded with AS_NO_KEEPALIVE.
1332 void ShenandoahHeap::keep_alive(oop obj) {
1333 if (is_concurrent_mark_in_progress()) {
1334 ShenandoahBarrierSet::barrier_set()->enqueue(obj);
1335 }
1336 }
1337
1338 void ShenandoahHeap::heap_region_iterate(ShenandoahHeapRegionClosure* blk) const {
1339 for (size_t i = 0; i < num_regions(); i++) {
1340 ShenandoahHeapRegion* current = get_region(i);
1341 blk->heap_region_do(current);
1342 }
1343 }
1344
1345 class ShenandoahParallelHeapRegionTask : public AbstractGangTask {
1346 private:
1347 ShenandoahHeap* const _heap;
1348 ShenandoahHeapRegionClosure* const _blk;
1349
1350 DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
1351 volatile size_t _index;
1352 DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, 0);
1353
1354 public:
|