src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 












  25 class ParallelScavengeHeap;
  26 class PSAdaptiveSizePolicy;
  27 class PSYoungGen;
  28 class PSOldGen;
  29 class PSPermGen;
  30 class ParCompactionManager;
  31 class ParallelTaskTerminator;
  32 class PSParallelCompact;
  33 class GCTaskManager;
  34 class GCTaskQueue;
  35 class PreGCValues;
  36 class MoveAndUpdateClosure;
  37 class RefProcTaskExecutor;
  38 
  39 // The SplitInfo class holds the information needed to 'split' a source region
  40 // so that the live data can be copied to two destination *spaces*.  Normally,
  41 // all the live data in a region is copied to a single destination space (e.g.,
  42 // everything live in a region in eden is copied entirely into the old gen).
  43 // However, when the heap is nearly full, all the live data in eden may not fit
  44 // into the old gen.  Copying only some of the regions from eden to old gen


1497     _start_array(PSParallelCompact::start_array(space_id))
1498   {
1499     assert(space_id == PSParallelCompact::perm_space_id ||
1500            space_id == PSParallelCompact::old_space_id,
1501            "cannot use FillClosure in the young gen");
1502   }
1503 
1504   virtual IterationStatus do_addr(HeapWord* addr, size_t size) {
1505     CollectedHeap::fill_with_objects(addr, size);
1506     HeapWord* const end = addr + size;
1507     do {
1508       _start_array->allocate_block(addr);
1509       addr += oop(addr)->size();
1510     } while (addr < end);
1511     return ParMarkBitMap::incomplete;
1512   }
1513 
1514 private:
1515   ObjectStartArray* const _start_array;
1516 };




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  27 
  28 #include "gc_implementation/parallelScavenge/objectStartArray.hpp"
  29 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
  30 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
  31 #include "gc_implementation/shared/collectorCounters.hpp"
  32 #include "gc_implementation/shared/markSweep.hpp"
  33 #include "gc_implementation/shared/mutableSpace.hpp"
  34 #include "memory/sharedHeap.hpp"
  35 #include "oops/oop.hpp"
  36 
  37 class ParallelScavengeHeap;
  38 class PSAdaptiveSizePolicy;
  39 class PSYoungGen;
  40 class PSOldGen;
  41 class PSPermGen;
  42 class ParCompactionManager;
  43 class ParallelTaskTerminator;
  44 class PSParallelCompact;
  45 class GCTaskManager;
  46 class GCTaskQueue;
  47 class PreGCValues;
  48 class MoveAndUpdateClosure;
  49 class RefProcTaskExecutor;
  50 
  51 // The SplitInfo class holds the information needed to 'split' a source region
  52 // so that the live data can be copied to two destination *spaces*.  Normally,
  53 // all the live data in a region is copied to a single destination space (e.g.,
  54 // everything live in a region in eden is copied entirely into the old gen).
  55 // However, when the heap is nearly full, all the live data in eden may not fit
  56 // into the old gen.  Copying only some of the regions from eden to old gen


1509     _start_array(PSParallelCompact::start_array(space_id))
1510   {
1511     assert(space_id == PSParallelCompact::perm_space_id ||
1512            space_id == PSParallelCompact::old_space_id,
1513            "cannot use FillClosure in the young gen");
1514   }
1515 
1516   virtual IterationStatus do_addr(HeapWord* addr, size_t size) {
1517     CollectedHeap::fill_with_objects(addr, size);
1518     HeapWord* const end = addr + size;
1519     do {
1520       _start_array->allocate_block(addr);
1521       addr += oop(addr)->size();
1522     } while (addr < end);
1523     return ParMarkBitMap::incomplete;
1524   }
1525 
1526 private:
1527   ObjectStartArray* const _start_array;
1528 };
1529 
1530 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP