src/share/vm/gc/parallel/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc/parallel

src/share/vm/gc/parallel/psParallelCompact.cpp

Print this page




  40 #include "gc/parallel/psScavenge.hpp"
  41 #include "gc/parallel/psYoungGen.hpp"
  42 #include "gc/shared/gcCause.hpp"
  43 #include "gc/shared/gcHeapSummary.hpp"
  44 #include "gc/shared/gcId.hpp"
  45 #include "gc/shared/gcLocker.inline.hpp"
  46 #include "gc/shared/gcTimer.hpp"
  47 #include "gc/shared/gcTrace.hpp"
  48 #include "gc/shared/gcTraceTime.inline.hpp"
  49 #include "gc/shared/isGCActiveMark.hpp"
  50 #include "gc/shared/referencePolicy.hpp"
  51 #include "gc/shared/referenceProcessor.hpp"
  52 #include "gc/shared/spaceDecorator.hpp"
  53 #include "logging/log.hpp"
  54 #include "memory/resourceArea.hpp"
  55 #include "oops/instanceKlass.inline.hpp"
  56 #include "oops/instanceMirrorKlass.inline.hpp"
  57 #include "oops/methodData.hpp"
  58 #include "oops/objArrayKlass.inline.hpp"
  59 #include "oops/oop.inline.hpp"

  60 #include "runtime/atomic.hpp"
  61 #include "runtime/fprofiler.hpp"
  62 #include "runtime/safepoint.hpp"
  63 #include "runtime/vmThread.hpp"
  64 #include "services/management.hpp"
  65 #include "services/memTracker.hpp"
  66 #include "services/memoryService.hpp"
  67 #include "utilities/events.hpp"
  68 #include "utilities/stack.inline.hpp"
  69 
  70 #include <math.h>
  71 
  72 // All sizes are in HeapWords.
  73 const size_t ParallelCompactData::Log2RegionSize  = 16; // 64K words
  74 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  75 const size_t ParallelCompactData::RegionSizeBytes =
  76   RegionSize << LogHeapWordSize;
  77 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  78 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  79 const size_t ParallelCompactData::RegionAddrMask       = ~RegionAddrOffsetMask;


2166   PSParallelCompact::AdjustKlassClosure klass_closure(cm);
2167 
2168   // General strong roots.
2169   Universe::oops_do(&oop_closure);
2170   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2171   Threads::oops_do(&oop_closure, NULL);
2172   ObjectSynchronizer::oops_do(&oop_closure);
2173   FlatProfiler::oops_do(&oop_closure);
2174   Management::oops_do(&oop_closure);
2175   JvmtiExport::oops_do(&oop_closure);
2176   SystemDictionary::oops_do(&oop_closure);
2177   ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true);
2178 
2179   // Now adjust pointers in remaining weak roots.  (All of which should
2180   // have been cleared if they pointed to non-surviving objects.)
2181   // Global (weak) JNI handles
2182   JNIHandles::weak_oops_do(&oop_closure);
2183 
2184   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2185   CodeCache::blobs_do(&adjust_from_blobs);



2186   StringTable::oops_do(&oop_closure);
2187   ref_processor()->weak_oops_do(&oop_closure);
2188   // Roots were visited so references into the young gen in roots
2189   // may have been scanned.  Process them also.
2190   // Should the reference processor have a span that excludes
2191   // young gen objects?
2192   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2193 }
2194 
2195 // Helper class to print 8 region numbers per line and then print the total at the end.
2196 class FillableRegionLogger : public StackObj {
2197 private:
2198   Log(gc, compaction) log;
2199   static const int LineLength = 8;
2200   size_t _regions[LineLength];
2201   int _next_index;
2202   bool _enabled;
2203   size_t _total_regions;
2204 public:
2205   FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { }




  40 #include "gc/parallel/psScavenge.hpp"
  41 #include "gc/parallel/psYoungGen.hpp"
  42 #include "gc/shared/gcCause.hpp"
  43 #include "gc/shared/gcHeapSummary.hpp"
  44 #include "gc/shared/gcId.hpp"
  45 #include "gc/shared/gcLocker.inline.hpp"
  46 #include "gc/shared/gcTimer.hpp"
  47 #include "gc/shared/gcTrace.hpp"
  48 #include "gc/shared/gcTraceTime.inline.hpp"
  49 #include "gc/shared/isGCActiveMark.hpp"
  50 #include "gc/shared/referencePolicy.hpp"
  51 #include "gc/shared/referenceProcessor.hpp"
  52 #include "gc/shared/spaceDecorator.hpp"
  53 #include "logging/log.hpp"
  54 #include "memory/resourceArea.hpp"
  55 #include "oops/instanceKlass.inline.hpp"
  56 #include "oops/instanceMirrorKlass.inline.hpp"
  57 #include "oops/methodData.hpp"
  58 #include "oops/objArrayKlass.inline.hpp"
  59 #include "oops/oop.inline.hpp"
  60 #include "aot/aotLoader.hpp"
  61 #include "runtime/atomic.hpp"
  62 #include "runtime/fprofiler.hpp"
  63 #include "runtime/safepoint.hpp"
  64 #include "runtime/vmThread.hpp"
  65 #include "services/management.hpp"
  66 #include "services/memTracker.hpp"
  67 #include "services/memoryService.hpp"
  68 #include "utilities/events.hpp"
  69 #include "utilities/stack.inline.hpp"
  70 
  71 #include <math.h>
  72 
  73 // All sizes are in HeapWords.
  74 const size_t ParallelCompactData::Log2RegionSize  = 16; // 64K words
  75 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  76 const size_t ParallelCompactData::RegionSizeBytes =
  77   RegionSize << LogHeapWordSize;
  78 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  79 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  80 const size_t ParallelCompactData::RegionAddrMask       = ~RegionAddrOffsetMask;


2167   PSParallelCompact::AdjustKlassClosure klass_closure(cm);
2168 
2169   // General strong roots.
2170   Universe::oops_do(&oop_closure);
2171   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2172   Threads::oops_do(&oop_closure, NULL);
2173   ObjectSynchronizer::oops_do(&oop_closure);
2174   FlatProfiler::oops_do(&oop_closure);
2175   Management::oops_do(&oop_closure);
2176   JvmtiExport::oops_do(&oop_closure);
2177   SystemDictionary::oops_do(&oop_closure);
2178   ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true);
2179 
2180   // Now adjust pointers in remaining weak roots.  (All of which should
2181   // have been cleared if they pointed to non-surviving objects.)
2182   // Global (weak) JNI handles
2183   JNIHandles::weak_oops_do(&oop_closure);
2184 
2185   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2186   CodeCache::blobs_do(&adjust_from_blobs);
2187   if (UseAOT) {
2188     AOTLoader::oops_do(&oop_closure);
2189   }
2190   StringTable::oops_do(&oop_closure);
2191   ref_processor()->weak_oops_do(&oop_closure);
2192   // Roots were visited so references into the young gen in roots
2193   // may have been scanned.  Process them also.
2194   // Should the reference processor have a span that excludes
2195   // young gen objects?
2196   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2197 }
2198 
2199 // Helper class to print 8 region numbers per line and then print the total at the end.
2200 class FillableRegionLogger : public StackObj {
2201 private:
2202   Log(gc, compaction) log;
2203   static const int LineLength = 8;
2204   size_t _regions[LineLength];
2205   int _next_index;
2206   bool _enabled;
2207   size_t _total_regions;
2208 public:
2209   FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { }


src/share/vm/gc/parallel/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File