hotspot/src/share/vm/memory/universe.cpp
changeset 15484 7395ace8a11a
parent 15463 8693f5fb0828
parent 15483 113ca9e9c1bb
child 15957 58302a2ffb9a
equal deleted inserted replaced
15470:998186997e90 15484:7395ace8a11a
    68 #include "services/memoryService.hpp"
    68 #include "services/memoryService.hpp"
    69 #include "utilities/copy.hpp"
    69 #include "utilities/copy.hpp"
    70 #include "utilities/events.hpp"
    70 #include "utilities/events.hpp"
    71 #include "utilities/hashtable.inline.hpp"
    71 #include "utilities/hashtable.inline.hpp"
    72 #include "utilities/preserveException.hpp"
    72 #include "utilities/preserveException.hpp"
    73 #ifndef SERIALGC
    73 #include "utilities/macros.hpp"
       
    74 #if INCLUDE_ALL_GCS
    74 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
    75 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
    75 #include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
    76 #include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
    76 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
    77 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
    77 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
    78 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
    78 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
    79 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
    79 #endif
    80 #endif // INCLUDE_ALL_GCS
    80 
    81 
    81 // Known objects
    82 // Known objects
    82 Klass* Universe::_boolArrayKlassObj                 = NULL;
    83 Klass* Universe::_boolArrayKlassObj                 = NULL;
    83 Klass* Universe::_byteArrayKlassObj                 = NULL;
    84 Klass* Universe::_byteArrayKlassObj                 = NULL;
    84 Klass* Universe::_charArrayKlassObj                 = NULL;
    85 Klass* Universe::_charArrayKlassObj                 = NULL;
   756 }
   757 }
   757 
   758 
   758 jint Universe::initialize_heap() {
   759 jint Universe::initialize_heap() {
   759 
   760 
   760   if (UseParallelGC) {
   761   if (UseParallelGC) {
   761 #ifndef SERIALGC
   762 #if INCLUDE_ALL_GCS
   762     Universe::_collectedHeap = new ParallelScavengeHeap();
   763     Universe::_collectedHeap = new ParallelScavengeHeap();
   763 #else  // SERIALGC
   764 #else  // INCLUDE_ALL_GCS
   764     fatal("UseParallelGC not supported in this VM.");
   765     fatal("UseParallelGC not supported in this VM.");
   765 #endif // SERIALGC
   766 #endif // INCLUDE_ALL_GCS
   766 
   767 
   767   } else if (UseG1GC) {
   768   } else if (UseG1GC) {
   768 #ifndef SERIALGC
   769 #if INCLUDE_ALL_GCS
   769     G1CollectorPolicy* g1p = new G1CollectorPolicy();
   770     G1CollectorPolicy* g1p = new G1CollectorPolicy();
   770     G1CollectedHeap* g1h = new G1CollectedHeap(g1p);
   771     G1CollectedHeap* g1h = new G1CollectedHeap(g1p);
   771     Universe::_collectedHeap = g1h;
   772     Universe::_collectedHeap = g1h;
   772 #else  // SERIALGC
   773 #else  // INCLUDE_ALL_GCS
   773     fatal("UseG1GC not supported in java kernel vm.");
   774     fatal("UseG1GC not supported in java kernel vm.");
   774 #endif // SERIALGC
   775 #endif // INCLUDE_ALL_GCS
   775 
   776 
   776   } else {
   777   } else {
   777     GenCollectorPolicy *gc_policy;
   778     GenCollectorPolicy *gc_policy;
   778 
   779 
   779     if (UseSerialGC) {
   780     if (UseSerialGC) {
   780       gc_policy = new MarkSweepPolicy();
   781       gc_policy = new MarkSweepPolicy();
   781     } else if (UseConcMarkSweepGC) {
   782     } else if (UseConcMarkSweepGC) {
   782 #ifndef SERIALGC
   783 #if INCLUDE_ALL_GCS
   783       if (UseAdaptiveSizePolicy) {
   784       if (UseAdaptiveSizePolicy) {
   784         gc_policy = new ASConcurrentMarkSweepPolicy();
   785         gc_policy = new ASConcurrentMarkSweepPolicy();
   785       } else {
   786       } else {
   786         gc_policy = new ConcurrentMarkSweepPolicy();
   787         gc_policy = new ConcurrentMarkSweepPolicy();
   787       }
   788       }
   788 #else   // SERIALGC
   789 #else  // INCLUDE_ALL_GCS
   789     fatal("UseConcMarkSweepGC not supported in this VM.");
   790     fatal("UseConcMarkSweepGC not supported in this VM.");
   790 #endif // SERIALGC
   791 #endif // INCLUDE_ALL_GCS
   791     } else { // default old generation
   792     } else { // default old generation
   792       gc_policy = new MarkSweepPolicy();
   793       gc_policy = new MarkSweepPolicy();
   793     }
   794     }
   794 
   795 
   795     Universe::_collectedHeap = new GenCollectedHeap(gc_policy);
   796     Universe::_collectedHeap = new GenCollectedHeap(gc_policy);