src/share/vm/gc_implementation/g1/heapRegion.hpp

changeset 1377
2c79770d1f6e
parent 1246
830ca2573896
child 1455
ff2402f6a50b
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Sep 02 00:04:29 2009 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Thu Jul 30 16:22:58 2009 -0400
     1.3 @@ -297,15 +297,24 @@
     1.4    HeapRegion(G1BlockOffsetSharedArray* sharedOffsetArray,
     1.5               MemRegion mr, bool is_zeroed);
     1.6  
     1.7 -  enum SomePublicConstants {
     1.8 -    // HeapRegions are GrainBytes-aligned
     1.9 -    // and have sizes that are multiples of GrainBytes.
    1.10 -    LogOfHRGrainBytes = 20,
    1.11 -    LogOfHRGrainWords = LogOfHRGrainBytes - LogHeapWordSize,
    1.12 -    GrainBytes = 1 << LogOfHRGrainBytes,
    1.13 -    GrainWords = 1 <<LogOfHRGrainWords,
    1.14 -    MaxAge = 2, NoOfAges = MaxAge+1
    1.15 -  };
    1.16 +  static int LogOfHRGrainBytes;
    1.17 +  static int LogOfHRGrainWords;
    1.18 +  // The normal type of these should be size_t. However, they used to
    1.19 +  // be members of an enum before and they are assumed by the
    1.20 +  // compilers to be ints. To avoid going and fixing all their uses,
    1.21 +  // I'm declaring them as ints. I'm not anticipating heap region
    1.22 +  // sizes to reach anywhere near 2g, so using an int here is safe.
    1.23 +  static int GrainBytes;
    1.24 +  static int GrainWords;
    1.25 +  static int CardsPerRegion;
    1.26 +
    1.27 +  // It sets up the heap region size (GrainBytes / GrainWords), as
    1.28 +  // well as other related fields that are based on the heap region
    1.29 +  // size (LogOfHRGrainBytes / LogOfHRGrainWords /
    1.30 +  // CardsPerRegion). All those fields are considered constant
    1.31 +  // throughout the JVM's execution, therefore they should only be set
    1.32 +  // up once during initialization time.
    1.33 +  static void setup_heap_region_size(uintx min_heap_size);
    1.34  
    1.35    enum ClaimValues {
    1.36      InitialClaimValue     = 0,

mercurial