< prev index next >

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

Print this page
rev 10742 : Make fields used in lock-free algorithms volatile


 367          "postcondition of block_start");
 368   oop obj;
 369   while (cur < mr.end()) {
 370     obj = oop(cur);
 371     if (obj->klass_or_null() == NULL) {
 372       // Ran into an unparseable point.
 373       return cur;
 374     } else if (!g1h->is_obj_dead(obj)) {
 375       cl->do_object(obj);
 376     }
 377     cur += block_size(cur);
 378   }
 379   return NULL;
 380 }
 381 
 382 HeapWord*
 383 HeapRegion::
 384 oops_on_card_seq_iterate_careful(MemRegion mr,
 385                                  FilterOutOfRegionClosure* cl,
 386                                  bool filter_young,
 387                                  jbyte* card_ptr) {
 388   // Currently, we should only have to clean the card if filter_young
 389   // is true and vice versa.
 390   if (filter_young) {
 391     assert(card_ptr != NULL, "pre-condition");
 392   } else {
 393     assert(card_ptr == NULL, "pre-condition");
 394   }
 395   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 396 
 397   // If we're within a stop-world GC, then we might look at a card in a
 398   // GC alloc region that extends onto a GC LAB, which may not be
 399   // parseable.  Stop such at the "scan_top" of the region.
 400   if (g1h->is_gc_active()) {
 401     mr = mr.intersection(MemRegion(bottom(), scan_top()));
 402   } else {
 403     mr = mr.intersection(used_region());
 404   }
 405   if (mr.is_empty()) return NULL;
 406   // Otherwise, find the obj that extends onto mr.start().
 407 


1076       blk->do_object(oop(p));
1077     }
1078     p += block_size(p);
1079   }
1080 }
1081 
1082 G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) :
1083   _bot_part(bot, this),
1084   _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
1085   _gc_time_stamp(0)
1086 {
1087 }
1088 
1089 void G1ContiguousSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
1090   CompactibleSpace::initialize(mr, clear_space, mangle_space);
1091   _top = bottom();
1092   _scan_top = bottom();
1093   set_saved_mark_word(NULL);
1094   reset_bot();
1095 }
1096 


 367          "postcondition of block_start");
 368   oop obj;
 369   while (cur < mr.end()) {
 370     obj = oop(cur);
 371     if (obj->klass_or_null() == NULL) {
 372       // Ran into an unparseable point.
 373       return cur;
 374     } else if (!g1h->is_obj_dead(obj)) {
 375       cl->do_object(obj);
 376     }
 377     cur += block_size(cur);
 378   }
 379   return NULL;
 380 }
 381 
 382 HeapWord*
 383 HeapRegion::
 384 oops_on_card_seq_iterate_careful(MemRegion mr,
 385                                  FilterOutOfRegionClosure* cl,
 386                                  bool filter_young,
 387                                  volatile jbyte* card_ptr) {
 388   // Currently, we should only have to clean the card if filter_young
 389   // is true and vice versa.
 390   if (filter_young) {
 391     assert(card_ptr != NULL, "pre-condition");
 392   } else {
 393     assert(card_ptr == NULL, "pre-condition");
 394   }
 395   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 396 
 397   // If we're within a stop-world GC, then we might look at a card in a
 398   // GC alloc region that extends onto a GC LAB, which may not be
 399   // parseable.  Stop such at the "scan_top" of the region.
 400   if (g1h->is_gc_active()) {
 401     mr = mr.intersection(MemRegion(bottom(), scan_top()));
 402   } else {
 403     mr = mr.intersection(used_region());
 404   }
 405   if (mr.is_empty()) return NULL;
 406   // Otherwise, find the obj that extends onto mr.start().
 407 


1076       blk->do_object(oop(p));
1077     }
1078     p += block_size(p);
1079   }
1080 }
1081 
1082 G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) :
1083   _bot_part(bot, this),
1084   _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
1085   _gc_time_stamp(0)
1086 {
1087 }
1088 
1089 void G1ContiguousSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
1090   CompactibleSpace::initialize(mr, clear_space, mangle_space);
1091   _top = bottom();
1092   _scan_top = bottom();
1093   set_saved_mark_word(NULL);
1094   reset_bot();
1095 }

< prev index next >