< prev index next >

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

Print this page




  41 #include "gc_implementation/shared/gcHeapSummary.hpp"
  42 #include "gc_implementation/shared/gcTimer.hpp"
  43 #include "gc_implementation/shared/gcTrace.hpp"
  44 #include "gc_implementation/shared/gcTraceTime.hpp"
  45 #include "gc_implementation/shared/isGCActiveMark.hpp"
  46 #include "gc_interface/gcCause.hpp"
  47 #include "memory/gcLocker.inline.hpp"
  48 #include "memory/referencePolicy.hpp"
  49 #include "memory/referenceProcessor.hpp"
  50 #include "oops/methodData.hpp"
  51 #include "oops/oop.inline.hpp"
  52 #include "oops/oop.pcgc.inline.hpp"
  53 #include "runtime/fprofiler.hpp"
  54 #include "runtime/safepoint.hpp"
  55 #include "runtime/vmThread.hpp"
  56 #include "services/management.hpp"
  57 #include "services/memoryService.hpp"
  58 #include "services/memTracker.hpp"
  59 #include "utilities/events.hpp"
  60 #include "utilities/stack.inline.hpp"



  61 
  62 #include <math.h>
  63 
  64 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  65 
  66 // All sizes are in HeapWords.
  67 const size_t ParallelCompactData::Log2RegionSize  = 16; // 64K words
  68 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  69 const size_t ParallelCompactData::RegionSizeBytes =
  70   RegionSize << LogHeapWordSize;
  71 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  72 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  73 const size_t ParallelCompactData::RegionAddrMask       = ~RegionAddrOffsetMask;
  74 
  75 const size_t ParallelCompactData::Log2BlockSize   = 7; // 128 words
  76 const size_t ParallelCompactData::BlockSize       = (size_t)1 << Log2BlockSize;
  77 const size_t ParallelCompactData::BlockSizeBytes  =
  78   BlockSize << LogHeapWordSize;
  79 const size_t ParallelCompactData::BlockSizeOffsetMask = BlockSize - 1;
  80 const size_t ParallelCompactData::BlockAddrOffsetMask = BlockSizeBytes - 1;


2447 
2448   // Need new claim bits when tracing through and adjusting pointers.
2449   ClassLoaderDataGraph::clear_claimed_marks();
2450 
2451   // General strong roots.
2452   Universe::oops_do(adjust_pointer_closure());
2453   JNIHandles::oops_do(adjust_pointer_closure());   // Global (strong) JNI handles
2454   CLDToOopClosure adjust_from_cld(adjust_pointer_closure());
2455   Threads::oops_do(adjust_pointer_closure(), &adjust_from_cld, NULL);
2456   ObjectSynchronizer::oops_do(adjust_pointer_closure());
2457   FlatProfiler::oops_do(adjust_pointer_closure());
2458   Management::oops_do(adjust_pointer_closure());
2459   JvmtiExport::oops_do(adjust_pointer_closure());
2460   SystemDictionary::oops_do(adjust_pointer_closure());
2461   ClassLoaderDataGraph::oops_do(adjust_pointer_closure(), adjust_klass_closure(), true);
2462 
2463   // Now adjust pointers in remaining weak roots.  (All of which should
2464   // have been cleared if they pointed to non-surviving objects.)
2465   // Global (weak) JNI handles
2466   JNIHandles::weak_oops_do(adjust_pointer_closure());

2467 
2468   CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations);
2469   CodeCache::blobs_do(&adjust_from_blobs);
2470   StringTable::oops_do(adjust_pointer_closure());
2471   ref_processor()->weak_oops_do(adjust_pointer_closure());
2472   // Roots were visited so references into the young gen in roots
2473   // may have been scanned.  Process them also.
2474   // Should the reference processor have a span that excludes
2475   // young gen objects?
2476   PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure());
2477 }
2478 
2479 void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q,
2480                                                       uint parallel_gc_threads)
2481 {
2482   GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
2483 
2484   // Find the threads that are active
2485   unsigned int which = 0;
2486 




  41 #include "gc_implementation/shared/gcHeapSummary.hpp"
  42 #include "gc_implementation/shared/gcTimer.hpp"
  43 #include "gc_implementation/shared/gcTrace.hpp"
  44 #include "gc_implementation/shared/gcTraceTime.hpp"
  45 #include "gc_implementation/shared/isGCActiveMark.hpp"
  46 #include "gc_interface/gcCause.hpp"
  47 #include "memory/gcLocker.inline.hpp"
  48 #include "memory/referencePolicy.hpp"
  49 #include "memory/referenceProcessor.hpp"
  50 #include "oops/methodData.hpp"
  51 #include "oops/oop.inline.hpp"
  52 #include "oops/oop.pcgc.inline.hpp"
  53 #include "runtime/fprofiler.hpp"
  54 #include "runtime/safepoint.hpp"
  55 #include "runtime/vmThread.hpp"
  56 #include "services/management.hpp"
  57 #include "services/memoryService.hpp"
  58 #include "services/memTracker.hpp"
  59 #include "utilities/events.hpp"
  60 #include "utilities/stack.inline.hpp"
  61 #if INCLUDE_JFR
  62 #include "jfr/jfr.hpp"
  63 #endif // INCLUDE_JFR
  64 
  65 #include <math.h>
  66 
  67 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  68 
  69 // All sizes are in HeapWords.
  70 const size_t ParallelCompactData::Log2RegionSize  = 16; // 64K words
  71 const size_t ParallelCompactData::RegionSize      = (size_t)1 << Log2RegionSize;
  72 const size_t ParallelCompactData::RegionSizeBytes =
  73   RegionSize << LogHeapWordSize;
  74 const size_t ParallelCompactData::RegionSizeOffsetMask = RegionSize - 1;
  75 const size_t ParallelCompactData::RegionAddrOffsetMask = RegionSizeBytes - 1;
  76 const size_t ParallelCompactData::RegionAddrMask       = ~RegionAddrOffsetMask;
  77 
  78 const size_t ParallelCompactData::Log2BlockSize   = 7; // 128 words
  79 const size_t ParallelCompactData::BlockSize       = (size_t)1 << Log2BlockSize;
  80 const size_t ParallelCompactData::BlockSizeBytes  =
  81   BlockSize << LogHeapWordSize;
  82 const size_t ParallelCompactData::BlockSizeOffsetMask = BlockSize - 1;
  83 const size_t ParallelCompactData::BlockAddrOffsetMask = BlockSizeBytes - 1;


2450 
2451   // Need new claim bits when tracing through and adjusting pointers.
2452   ClassLoaderDataGraph::clear_claimed_marks();
2453 
2454   // General strong roots.
2455   Universe::oops_do(adjust_pointer_closure());
2456   JNIHandles::oops_do(adjust_pointer_closure());   // Global (strong) JNI handles
2457   CLDToOopClosure adjust_from_cld(adjust_pointer_closure());
2458   Threads::oops_do(adjust_pointer_closure(), &adjust_from_cld, NULL);
2459   ObjectSynchronizer::oops_do(adjust_pointer_closure());
2460   FlatProfiler::oops_do(adjust_pointer_closure());
2461   Management::oops_do(adjust_pointer_closure());
2462   JvmtiExport::oops_do(adjust_pointer_closure());
2463   SystemDictionary::oops_do(adjust_pointer_closure());
2464   ClassLoaderDataGraph::oops_do(adjust_pointer_closure(), adjust_klass_closure(), true);
2465 
2466   // Now adjust pointers in remaining weak roots.  (All of which should
2467   // have been cleared if they pointed to non-surviving objects.)
2468   // Global (weak) JNI handles
2469   JNIHandles::weak_oops_do(adjust_pointer_closure());
2470   JFR_ONLY(Jfr::weak_oops_do(adjust_pointer_closure()));
2471 
2472   CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations);
2473   CodeCache::blobs_do(&adjust_from_blobs);
2474   StringTable::oops_do(adjust_pointer_closure());
2475   ref_processor()->weak_oops_do(adjust_pointer_closure());
2476   // Roots were visited so references into the young gen in roots
2477   // may have been scanned.  Process them also.
2478   // Should the reference processor have a span that excludes
2479   // young gen objects?
2480   PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure());
2481 }
2482 
2483 void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q,
2484                                                       uint parallel_gc_threads)
2485 {
2486   GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer, _gc_tracer.gc_id());
2487 
2488   // Find the threads that are active
2489   unsigned int which = 0;
2490 


< prev index next >