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

Print this page
rev 5146 : [mq]: first-patch
   1 /*
   2  * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 338   // the total value for the collection set.
 339   size_t _predicted_bytes_to_copy;
 340 
 341  public:
 342   HeapRegion(uint hrs_index,
 343              G1BlockOffsetSharedArray* sharedOffsetArray,
 344              MemRegion mr);
 345 
 346   static int    LogOfHRGrainBytes;
 347   static int    LogOfHRGrainWords;
 348 
 349   static size_t GrainBytes;
 350   static size_t GrainWords;
 351   static size_t CardsPerRegion;
 352 
 353   static size_t align_up_to_region_byte_size(size_t sz) {
 354     return (sz + (size_t) GrainBytes - 1) &
 355                                       ~((1 << (size_t) LogOfHRGrainBytes) - 1);
 356   }
 357 

 358   // It sets up the heap region size (GrainBytes / GrainWords), as
 359   // well as other related fields that are based on the heap region
 360   // size (LogOfHRGrainBytes / LogOfHRGrainWords /
 361   // CardsPerRegion). All those fields are considered constant
 362   // throughout the JVM's execution, therefore they should only be set
 363   // up once during initialization time.
 364   static void setup_heap_region_size(uintx min_heap_size);
 365 
 366   enum ClaimValues {
 367     InitialClaimValue          = 0,
 368     FinalCountClaimValue       = 1,
 369     NoteEndClaimValue          = 2,
 370     ScrubRemSetClaimValue      = 3,
 371     ParVerifyClaimValue        = 4,
 372     RebuildRSClaimValue        = 5,
 373     ParEvacFailureClaimValue   = 6,
 374     AggregateCountClaimValue   = 7,
 375     VerifyCountClaimValue      = 8,
 376     ParMarkRootClaimValue      = 9
 377   };


   1 /*
   2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 338   // the total value for the collection set.
 339   size_t _predicted_bytes_to_copy;
 340 
 341  public:
 342   HeapRegion(uint hrs_index,
 343              G1BlockOffsetSharedArray* sharedOffsetArray,
 344              MemRegion mr);
 345 
 346   static int    LogOfHRGrainBytes;
 347   static int    LogOfHRGrainWords;
 348 
 349   static size_t GrainBytes;
 350   static size_t GrainWords;
 351   static size_t CardsPerRegion;
 352 
 353   static size_t align_up_to_region_byte_size(size_t sz) {
 354     return (sz + (size_t) GrainBytes - 1) &
 355                                       ~((1 << (size_t) LogOfHRGrainBytes) - 1);
 356   }
 357 
 358   static size_t max_region_size();
 359   // It sets up the heap region size (GrainBytes / GrainWords), as
 360   // well as other related fields that are based on the heap region
 361   // size (LogOfHRGrainBytes / LogOfHRGrainWords /
 362   // CardsPerRegion). All those fields are considered constant
 363   // throughout the JVM's execution, therefore they should only be set
 364   // up once during initialization time.
 365   static void setup_heap_region_size(uintx min_heap_size);
 366 
 367   enum ClaimValues {
 368     InitialClaimValue          = 0,
 369     FinalCountClaimValue       = 1,
 370     NoteEndClaimValue          = 2,
 371     ScrubRemSetClaimValue      = 3,
 372     ParVerifyClaimValue        = 4,
 373     RebuildRSClaimValue        = 5,
 374     ParEvacFailureClaimValue   = 6,
 375     AggregateCountClaimValue   = 7,
 376     VerifyCountClaimValue      = 8,
 377     ParMarkRootClaimValue      = 9
 378   };