src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
changeset 54678 93f09ca4a7f8
parent 54606 24eb7720919c
child 54687 df2b3565f343
equal deleted inserted replaced
54677:beca9f8524c1 54678:93f09ca4a7f8
    22  */
    22  */
    23 
    23 
    24 #include "precompiled.hpp"
    24 #include "precompiled.hpp"
    25 #include "memory/allocation.hpp"
    25 #include "memory/allocation.hpp"
    26 
    26 
       
    27 #include "gc/shared/gcArguments.hpp"
    27 #include "gc/shared/gcTimer.hpp"
    28 #include "gc/shared/gcTimer.hpp"
    28 #include "gc/shared/gcTraceTime.inline.hpp"
    29 #include "gc/shared/gcTraceTime.inline.hpp"
    29 #include "gc/shared/memAllocator.hpp"
    30 #include "gc/shared/memAllocator.hpp"
    30 #include "gc/shared/parallelCleaning.hpp"
    31 #include "gc/shared/parallelCleaning.hpp"
    31 #include "gc/shared/plab.hpp"
    32 #include "gc/shared/plab.hpp"
    64 #include "gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp"
    65 #include "gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp"
    65 #include "gc/shenandoah/heuristics/shenandoahStaticHeuristics.hpp"
    66 #include "gc/shenandoah/heuristics/shenandoahStaticHeuristics.hpp"
    66 #include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp"
    67 #include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp"
    67 
    68 
    68 #include "memory/metaspace.hpp"
    69 #include "memory/metaspace.hpp"
       
    70 #include "runtime/globals.hpp"
    69 #include "runtime/interfaceSupport.inline.hpp"
    71 #include "runtime/interfaceSupport.inline.hpp"
    70 #include "runtime/safepointMechanism.hpp"
    72 #include "runtime/safepointMechanism.hpp"
    71 #include "runtime/vmThread.hpp"
    73 #include "runtime/vmThread.hpp"
    72 #include "services/mallocTracker.hpp"
    74 #include "services/mallocTracker.hpp"
    73 
    75 
   137 
   139 
   138   //
   140   //
   139   // Figure out heap sizing
   141   // Figure out heap sizing
   140   //
   142   //
   141 
   143 
   142   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
   144   size_t init_byte_size = InitialHeapSize;
   143   size_t min_byte_size  = collector_policy()->min_heap_byte_size();
   145   size_t min_byte_size  = MinHeapSize;
   144   size_t max_byte_size  = collector_policy()->max_heap_byte_size();
   146   size_t max_byte_size  = MaxHeapSize;
   145   size_t heap_alignment = collector_policy()->heap_alignment();
   147   size_t heap_alignment = HeapAlignment;
   146 
   148 
   147   size_t reg_size_bytes = ShenandoahHeapRegion::region_size_bytes();
   149   size_t reg_size_bytes = ShenandoahHeapRegion::region_size_bytes();
   148 
   150 
   149   if (ShenandoahAlwaysPreTouch) {
   151   if (ShenandoahAlwaysPreTouch) {
   150     // Enabled pre-touch means the entire heap is committed right away.
   152     // Enabled pre-touch means the entire heap is committed right away.
  1157 
  1159 
  1158 void ShenandoahHeap::do_full_collection(bool clear_all_soft_refs) {
  1160 void ShenandoahHeap::do_full_collection(bool clear_all_soft_refs) {
  1159   //assert(false, "Shouldn't need to do full collections");
  1161   //assert(false, "Shouldn't need to do full collections");
  1160 }
  1162 }
  1161 
  1163 
  1162 CollectorPolicy* ShenandoahHeap::collector_policy() const {
       
  1163   return _shenandoah_policy;
       
  1164 }
       
  1165 
       
  1166 HeapWord* ShenandoahHeap::block_start(const void* addr) const {
  1164 HeapWord* ShenandoahHeap::block_start(const void* addr) const {
  1167   Space* sp = heap_region_containing(addr);
  1165   Space* sp = heap_region_containing(addr);
  1168   if (sp != NULL) {
  1166   if (sp != NULL) {
  1169     return sp->block_start(addr);
  1167     return sp->block_start(addr);
  1170   }
  1168   }