src/hotspot/share/memory/universe.cpp
changeset 47913 cde4a65ba47d
parent 47819 ee36a8e36561
child 48092 72855b7d10ac
child 55934 912c55e702d6
equal deleted inserted replaced
47912:7397b5b2d3b2 47913:cde4a65ba47d
    30 #include "classfile/stringTable.hpp"
    30 #include "classfile/stringTable.hpp"
    31 #include "classfile/systemDictionary.hpp"
    31 #include "classfile/systemDictionary.hpp"
    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/serial/serialHeap.hpp"
       
    36 #include "gc/shared/cardTableModRefBS.hpp"
    35 #include "gc/shared/cardTableModRefBS.hpp"
    37 #include "gc/shared/collectedHeap.inline.hpp"
    36 #include "gc/shared/collectedHeap.inline.hpp"
       
    37 #include "gc/shared/gcArguments.hpp"
    38 #include "gc/shared/gcLocker.inline.hpp"
    38 #include "gc/shared/gcLocker.inline.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"
    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/shared/adaptiveSizePolicy.hpp"
       
    92 #endif // INCLUDE_ALL_GCS
       
    93 #if INCLUDE_CDS
    85 #if INCLUDE_CDS
    94 #include "classfile/sharedClassUtil.hpp"
    86 #include "classfile/sharedClassUtil.hpp"
    95 #endif
    87 #endif
    96 
    88 
    97 // Known objects
    89 // Known objects
   744   return JNI_OK;
   736   return JNI_OK;
   745 }
   737 }
   746 
   738 
   747 CollectedHeap* Universe::create_heap() {
   739 CollectedHeap* Universe::create_heap() {
   748   assert(_collectedHeap == NULL, "Heap already created");
   740   assert(_collectedHeap == NULL, "Heap already created");
   749 #if !INCLUDE_ALL_GCS
   741   assert(GCArguments::is_initialized(), "GC must be initialized here");
   750   if (UseParallelGC) {
   742   return GCArguments::arguments()->create_heap();
   751     fatal("UseParallelGC not supported in this VM.");
       
   752   } else if (UseG1GC) {
       
   753     fatal("UseG1GC not supported in this VM.");
       
   754   } else if (UseConcMarkSweepGC) {
       
   755     fatal("UseConcMarkSweepGC not supported in this VM.");
       
   756 #else
       
   757   if (UseParallelGC) {
       
   758     return Universe::create_heap_with_policy<ParallelScavengeHeap, GenerationSizer>();
       
   759   } else if (UseG1GC) {
       
   760     return Universe::create_heap_with_policy<G1CollectedHeap, G1CollectorPolicy>();
       
   761   } else if (UseConcMarkSweepGC) {
       
   762     return Universe::create_heap_with_policy<CMSHeap, ConcurrentMarkSweepPolicy>();
       
   763 #endif
       
   764   } else if (UseSerialGC) {
       
   765     return Universe::create_heap_with_policy<SerialHeap, MarkSweepPolicy>();
       
   766   }
       
   767 
       
   768   ShouldNotReachHere();
       
   769   return NULL;
       
   770 }
   743 }
   771 
   744 
   772 // Choose the heap base address and oop encoding mode
   745 // Choose the heap base address and oop encoding mode
   773 // when compressed oops are used:
   746 // when compressed oops are used:
   774 // Unscaled  - Use 32-bits oops without encoding when
   747 // Unscaled  - Use 32-bits oops without encoding when