src/hotspot/share/gc/shared/space.cpp
changeset 50752 9d62da00bf15
parent 50429 83aec1d357d4
child 50801 94b56c8594ef
equal deleted inserted replaced
50751:d9132bdf6c30 50752:9d62da00bf15
    30 #include "gc/shared/genCollectedHeap.hpp"
    30 #include "gc/shared/genCollectedHeap.hpp"
    31 #include "gc/shared/genOopClosures.inline.hpp"
    31 #include "gc/shared/genOopClosures.inline.hpp"
    32 #include "gc/shared/space.hpp"
    32 #include "gc/shared/space.hpp"
    33 #include "gc/shared/space.inline.hpp"
    33 #include "gc/shared/space.inline.hpp"
    34 #include "gc/shared/spaceDecorator.hpp"
    34 #include "gc/shared/spaceDecorator.hpp"
       
    35 #include "memory/iterator.inline.hpp"
    35 #include "memory/universe.hpp"
    36 #include "memory/universe.hpp"
    36 #include "oops/oop.inline.hpp"
    37 #include "oops/oop.inline.hpp"
    37 #include "runtime/atomic.hpp"
    38 #include "runtime/atomic.hpp"
    38 #include "runtime/java.hpp"
    39 #include "runtime/java.hpp"
    39 #include "runtime/orderAccess.hpp"
    40 #include "runtime/orderAccess.hpp"
   179     assert(_min_done == _last_explicit_min_done,
   180     assert(_min_done == _last_explicit_min_done,
   180            "Don't update _min_done for idempotent cl");
   181            "Don't update _min_done for idempotent cl");
   181   }
   182   }
   182 }
   183 }
   183 
   184 
   184 DirtyCardToOopClosure* Space::new_dcto_cl(ExtendedOopClosure* cl,
   185 DirtyCardToOopClosure* Space::new_dcto_cl(OopIterateClosure* cl,
   185                                           CardTable::PrecisionStyle precision,
   186                                           CardTable::PrecisionStyle precision,
   186                                           HeapWord* boundary,
   187                                           HeapWord* boundary,
   187                                           bool parallel) {
   188                                           bool parallel) {
   188   return new DirtyCardToOopClosure(this, cl, precision, boundary);
   189   return new DirtyCardToOopClosure(this, cl, precision, boundary);
   189 }
   190 }
   255 }
   256 }
   256 
   257 
   257 // (There are only two of these, rather than N, because the split is due
   258 // (There are only two of these, rather than N, because the split is due
   258 // only to the introduction of the FilteringClosure, a local part of the
   259 // only to the introduction of the FilteringClosure, a local part of the
   259 // impl of this abstraction.)
   260 // impl of this abstraction.)
   260 ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure)
   261 ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(OopIterateClosure)
   261 ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure)
   262 ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure)
   262 
   263 
   263 DirtyCardToOopClosure*
   264 DirtyCardToOopClosure*
   264 ContiguousSpace::new_dcto_cl(ExtendedOopClosure* cl,
   265 ContiguousSpace::new_dcto_cl(OopIterateClosure* cl,
   265                              CardTable::PrecisionStyle precision,
   266                              CardTable::PrecisionStyle precision,
   266                              HeapWord* boundary,
   267                              HeapWord* boundary,
   267                              bool parallel) {
   268                              bool parallel) {
   268   return new ContiguousSpaceDCTOC(this, cl, precision, boundary);
   269   return new ContiguousSpaceDCTOC(this, cl, precision, boundary);
   269 }
   270 }
   478               top() == block_start_const(top()),
   479               top() == block_start_const(top()),
   479               "top should be start of unallocated block, if it exists");
   480               "top should be start of unallocated block, if it exists");
   480   }
   481   }
   481 }
   482 }
   482 
   483 
   483 void Space::oop_iterate(ExtendedOopClosure* blk) {
   484 void Space::oop_iterate(OopIterateClosure* blk) {
   484   ObjectToOopClosure blk2(blk);
   485   ObjectToOopClosure blk2(blk);
   485   object_iterate(&blk2);
   486   object_iterate(&blk2);
   486 }
   487 }
   487 
   488 
   488 bool Space::obj_is_alive(const HeapWord* p) const {
   489 bool Space::obj_is_alive(const HeapWord* p) const {
   489   assert (block_is_obj(p), "The address should point to an object");
   490   assert (block_is_obj(p), "The address should point to an object");
   490   return true;
   491   return true;
   491 }
   492 }
   492 
   493 
   493 void ContiguousSpace::oop_iterate(ExtendedOopClosure* blk) {
   494 void ContiguousSpace::oop_iterate(OopIterateClosure* blk) {
   494   if (is_empty()) return;
   495   if (is_empty()) return;
   495   HeapWord* obj_addr = bottom();
   496   HeapWord* obj_addr = bottom();
   496   HeapWord* t = top();
   497   HeapWord* t = top();
   497   // Could call objects iterate, but this is easier.
   498   // Could call objects iterate, but this is easier.
   498   while (obj_addr < t) {
   499   while (obj_addr < t) {