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

Print this page


   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  *


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


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


   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  *


 337   // the total value for the collection set.
 338   size_t _predicted_bytes_to_copy;
 339 
 340  public:
 341   HeapRegion(uint hrs_index,
 342              G1BlockOffsetSharedArray* sharedOffsetArray,
 343              MemRegion mr);
 344 
 345   static int    LogOfHRGrainBytes;
 346   static int    LogOfHRGrainWords;
 347 
 348   static size_t GrainBytes;
 349   static size_t GrainWords;
 350   static size_t CardsPerRegion;
 351 
 352   static size_t align_up_to_region_byte_size(size_t sz) {
 353     return (sz + (size_t) GrainBytes - 1) &
 354                                       ~((1 << (size_t) LogOfHRGrainBytes) - 1);
 355   }
 356 
 357   // return the (conservative) maximum heap alignment for any heap region
 358   static size_t max_heap_alignment();
 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   };
 378