src/hotspot/share/gc/shared/space.cpp
changeset 59154 0c2e1808f800
parent 59153 1152339c298a
child 59252 623722a6aeb9
equal deleted inserted replaced
59153:1152339c298a 59154:0c2e1808f800
   108 // scanned some of that extended region, we may need to
   108 // scanned some of that extended region, we may need to
   109 // trim its right-end back some so we do not scan what
   109 // trim its right-end back some so we do not scan what
   110 // we (or another worker thread) may already have scanned
   110 // we (or another worker thread) may already have scanned
   111 // or planning to scan.
   111 // or planning to scan.
   112 void DirtyCardToOopClosure::do_MemRegion(MemRegion mr) {
   112 void DirtyCardToOopClosure::do_MemRegion(MemRegion mr) {
   113 
       
   114   // Some collectors need to do special things whenever their dirty
       
   115   // cards are processed. For instance, CMS must remember mutator updates
       
   116   // (i.e. dirty cards) so as to re-scan mutated objects.
       
   117   // Such work can be piggy-backed here on dirty card scanning, so as to make
       
   118   // it slightly more efficient than doing a complete non-destructive pre-scan
       
   119   // of the card table.
       
   120   MemRegionClosure* pCl = _sp->preconsumptionDirtyCardClosure();
       
   121   if (pCl != NULL) {
       
   122     pCl->do_MemRegion(mr);
       
   123   }
       
   124 
       
   125   HeapWord* bottom = mr.start();
   113   HeapWord* bottom = mr.start();
   126   HeapWord* last = mr.last();
   114   HeapWord* last = mr.last();
   127   HeapWord* top = mr.end();
   115   HeapWord* top = mr.end();
   128   HeapWord* bottom_obj;
   116   HeapWord* bottom_obj;
   129   HeapWord* top_obj;
   117   HeapWord* top_obj;
   503     blk->do_object(oop(mark));
   491     blk->do_object(oop(mark));
   504     mark += oop(mark)->size();
   492     mark += oop(mark)->size();
   505   }
   493   }
   506 }
   494 }
   507 
   495 
   508 HeapWord*
       
   509 ContiguousSpace::object_iterate_careful(ObjectClosureCareful* blk) {
       
   510   HeapWord * limit = concurrent_iteration_safe_limit();
       
   511   assert(limit <= top(), "sanity check");
       
   512   for (HeapWord* p = bottom(); p < limit;) {
       
   513     size_t size = blk->do_object_careful(oop(p));
       
   514     if (size == 0) {
       
   515       return p;  // failed at p
       
   516     } else {
       
   517       p += size;
       
   518     }
       
   519   }
       
   520   return NULL; // all done
       
   521 }
       
   522 
       
   523 // Very general, slow implementation.
   496 // Very general, slow implementation.
   524 HeapWord* ContiguousSpace::block_start_const(const void* p) const {
   497 HeapWord* ContiguousSpace::block_start_const(const void* p) const {
   525   assert(MemRegion(bottom(), end()).contains(p),
   498   assert(MemRegion(bottom(), end()).contains(p),
   526          "p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
   499          "p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
   527          p2i(p), p2i(bottom()), p2i(end()));
   500          p2i(p), p2i(bottom()), p2i(end()));