src/hotspot/share/memory/universe.cpp
branchepsilon-gc-branch
changeset 55934 912c55e702d6
parent 55767 8e22715afabc
parent 47913 cde4a65ba47d
child 55974 06122633fead
equal deleted inserted replaced
55802:b2b4df384c83 55934:912c55e702d6
    32 #include "classfile/vmSymbols.hpp"
    32 #include "classfile/vmSymbols.hpp"
    33 #include "code/codeCache.hpp"
    33 #include "code/codeCache.hpp"
    34 #include "code/dependencies.hpp"
    34 #include "code/dependencies.hpp"
    35 #include "gc/shared/cardTableModRefBS.hpp"
    35 #include "gc/shared/cardTableModRefBS.hpp"
    36 #include "gc/shared/collectedHeap.inline.hpp"
    36 #include "gc/shared/collectedHeap.inline.hpp"
       
    37 #include "gc/shared/gcArguments.hpp"
    37 #include "gc/shared/gcLocker.inline.hpp"
    38 #include "gc/shared/gcLocker.inline.hpp"
    38 #include "gc/shared/genCollectedHeap.hpp"
       
    39 #include "gc/shared/generation.hpp"
    39 #include "gc/shared/generation.hpp"
    40 #include "gc/shared/gcTraceTime.inline.hpp"
    40 #include "gc/shared/gcTraceTime.inline.hpp"
    41 #include "gc/shared/space.hpp"
    41 #include "gc/shared/space.hpp"
    42 #include "interpreter/interpreter.hpp"
    42 #include "interpreter/interpreter.hpp"
    43 #include "logging/log.hpp"
    43 #include "logging/log.hpp"
    80 #include "utilities/formatBuffer.hpp"
    80 #include "utilities/formatBuffer.hpp"
    81 #include "utilities/hashtable.inline.hpp"
    81 #include "utilities/hashtable.inline.hpp"
    82 #include "utilities/macros.hpp"
    82 #include "utilities/macros.hpp"
    83 #include "utilities/ostream.hpp"
    83 #include "utilities/ostream.hpp"
    84 #include "utilities/preserveException.hpp"
    84 #include "utilities/preserveException.hpp"
    85 #if INCLUDE_ALL_GCS
       
    86 #include "gc/cms/cmsCollectorPolicy.hpp"
       
    87 #include "gc/cms/cmsHeap.hpp"
       
    88 #include "gc/g1/g1CollectedHeap.inline.hpp"
       
    89 #include "gc/g1/g1CollectorPolicy.hpp"
       
    90 #include "gc/parallel/parallelScavengeHeap.hpp"
       
    91 #include "gc/epsilon/epsilonCollectedHeap.hpp"
       
    92 #include "gc/epsilon/epsilonCollectorPolicy.hpp"
       
    93 #include "gc/shared/adaptiveSizePolicy.hpp"
       
    94 #endif // INCLUDE_ALL_GCS
       
    95 #if INCLUDE_CDS
    85 #if INCLUDE_CDS
    96 #include "classfile/sharedClassUtil.hpp"
    86 #include "classfile/sharedClassUtil.hpp"
    97 #endif
    87 #endif
    98 
    88 
    99 // Known objects
    89 // Known objects
   746   return JNI_OK;
   736   return JNI_OK;
   747 }
   737 }
   748 
   738 
   749 CollectedHeap* Universe::create_heap() {
   739 CollectedHeap* Universe::create_heap() {
   750   assert(_collectedHeap == NULL, "Heap already created");
   740   assert(_collectedHeap == NULL, "Heap already created");
   751 #if !INCLUDE_ALL_GCS
   741   assert(GCArguments::is_initialized(), "GC must be initialized here");
   752   if (UseParallelGC) {
   742   return GCArguments::arguments()->create_heap();
   753     fatal("UseParallelGC not supported in this VM.");
       
   754   } else if (UseG1GC) {
       
   755     fatal("UseG1GC not supported in this VM.");
       
   756   } else if (UseConcMarkSweepGC) {
       
   757     fatal("UseConcMarkSweepGC not supported in this VM.");
       
   758   } else if (UseEpsilonGC) {
       
   759     fatal("UseEpsilonGC not supported in this VM.");
       
   760 #else
       
   761   if (UseParallelGC) {
       
   762     return Universe::create_heap_with_policy<ParallelScavengeHeap, GenerationSizer>();
       
   763   } else if (UseG1GC) {
       
   764     return Universe::create_heap_with_policy<G1CollectedHeap, G1CollectorPolicy>();
       
   765   } else if (UseConcMarkSweepGC) {
       
   766     return Universe::create_heap_with_policy<CMSHeap, ConcurrentMarkSweepPolicy>();
       
   767   } else if (UseEpsilonGC) {
       
   768     return Universe::create_heap_with_policy<EpsilonCollectedHeap, EpsilonCollectorPolicy>();
       
   769 #endif
       
   770   } else if (UseSerialGC) {
       
   771     return Universe::create_heap_with_policy<GenCollectedHeap, MarkSweepPolicy>();
       
   772   }
       
   773 
       
   774   ShouldNotReachHere();
       
   775   return NULL;
       
   776 }
   743 }
   777 
   744 
   778 // Choose the heap base address and oop encoding mode
   745 // Choose the heap base address and oop encoding mode
   779 // when compressed oops are used:
   746 // when compressed oops are used:
   780 // Unscaled  - Use 32-bits oops without encoding when
   747 // Unscaled  - Use 32-bits oops without encoding when