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

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 #include "incls/_precompiled.incl"
  26 #include "incls/_psParallelCompact.cpp.incl"































  27 
  28 #include <math.h>
  29 
  30 // All sizes are in HeapWords.
  31 const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
  32 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  33 const size_t ParallelCompactData::RegionSizeBytes =
  34   RegionSize << LogHeapWordSize;
  35 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  36 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  37 const size_t ParallelCompactData::RegionAddrMask  = ~RegionAddrOffsetMask;
  38 
  39 const ParallelCompactData::RegionData::region_sz_t
  40 ParallelCompactData::RegionData::dc_shift = 27;
  41 
  42 const ParallelCompactData::RegionData::region_sz_t
  43 ParallelCompactData::RegionData::dc_mask = ~0U << dc_shift;
  44 
  45 const ParallelCompactData::RegionData::region_sz_t
  46 ParallelCompactData::RegionData::dc_one = 0x1U << dc_shift;




   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 #include "precompiled.hpp"
  26 #include "classfile/symbolTable.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
  30 #include "gc_implementation/parallelScavenge/generationSizer.hpp"
  31 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
  32 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
  33 #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp"
  34 #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
  35 #include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
  36 #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp"
  37 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
  38 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
  39 #include "gc_implementation/parallelScavenge/psPermGen.hpp"
  40 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
  41 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
  42 #include "gc_implementation/parallelScavenge/psYoungGen.hpp"
  43 #include "gc_implementation/shared/isGCActiveMark.hpp"
  44 #include "gc_interface/gcCause.hpp"
  45 #include "memory/gcLocker.inline.hpp"
  46 #include "memory/referencePolicy.hpp"
  47 #include "memory/referenceProcessor.hpp"
  48 #include "oops/methodDataOop.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "oops/oop.pcgc.inline.hpp"
  51 #include "runtime/fprofiler.hpp"
  52 #include "runtime/safepoint.hpp"
  53 #include "runtime/vmThread.hpp"
  54 #include "services/management.hpp"
  55 #include "services/memoryService.hpp"
  56 #include "utilities/events.hpp"
  57 #include "utilities/stack.inline.hpp"
  58 
  59 #include <math.h>
  60 
  61 // All sizes are in HeapWords.
  62 const size_t ParallelCompactData::Log2RegionSize  = 9; // 512 words
  63 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  64 const size_t ParallelCompactData::RegionSizeBytes =
  65   RegionSize << LogHeapWordSize;
  66 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  67 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  68 const size_t ParallelCompactData::RegionAddrMask  = ~RegionAddrOffsetMask;
  69 
  70 const ParallelCompactData::RegionData::region_sz_t
  71 ParallelCompactData::RegionData::dc_shift = 27;
  72 
  73 const ParallelCompactData::RegionData::region_sz_t
  74 ParallelCompactData::RegionData::dc_mask = ~0U << dc_shift;
  75 
  76 const ParallelCompactData::RegionData::region_sz_t
  77 ParallelCompactData::RegionData::dc_one = 0x1U << dc_shift;