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

Print this page


   1 /*
   2  * Copyright (c) 2001, 2009, 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  *
  23  */
  24 





  25 // Remembered set for a heap region.  Represent a set of "cards" that
  26 // contain pointers into the owner heap region.  Cards are defined somewhat
  27 // abstractly, in terms of what the "BlockOffsetTable" in use can parse.
  28 
  29 class G1CollectedHeap;
  30 class G1BlockOffsetSharedArray;
  31 class HeapRegion;
  32 class HeapRegionRemSetIterator;
  33 class PosParPRT;
  34 class SparsePRT;
  35 
  36 
  37 // The "_coarse_map" is a bitmap with one bit for each region, where set
  38 // bits indicate that the corresponding region may contain some pointer
  39 // into the owning region.
  40 
  41 // The "_fine_grain_entries" array is an open hash table of PerRegionTables
  42 // (PRTs), indicating regions for which we're keeping the RS as a set of
  43 // cards.  The strategy is to cap the size of the fine-grain table,
  44 // deleting an entry and setting the corresponding coarse-grained bit when


 409   // sets "card_index" to one of those cards (which is then considered
 410   // yielded.)   Otherwise, returns false (and leaves "card_index"
 411   // undefined.)
 412   bool has_next(size_t& card_index);
 413 
 414   size_t n_yielded_fine() { return _n_yielded_fine; }
 415   size_t n_yielded_coarse() { return _n_yielded_coarse; }
 416   size_t n_yielded_sparse() { return _n_yielded_sparse; }
 417   size_t n_yielded() {
 418     return n_yielded_fine() + n_yielded_coarse() + n_yielded_sparse();
 419   }
 420 };
 421 
 422 #if 0
 423 class CardClosure: public Closure {
 424 public:
 425   virtual void do_card(HeapWord* card_start) = 0;
 426 };
 427 
 428 #endif


   1 /*
   2  * Copyright (c) 2001, 2010, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP
  27 
  28 #include "gc_implementation/g1/sparsePRT.hpp"
  29 
  30 // Remembered set for a heap region.  Represent a set of "cards" that
  31 // contain pointers into the owner heap region.  Cards are defined somewhat
  32 // abstractly, in terms of what the "BlockOffsetTable" in use can parse.
  33 
  34 class G1CollectedHeap;
  35 class G1BlockOffsetSharedArray;
  36 class HeapRegion;
  37 class HeapRegionRemSetIterator;
  38 class PosParPRT;
  39 class SparsePRT;
  40 
  41 
  42 // The "_coarse_map" is a bitmap with one bit for each region, where set
  43 // bits indicate that the corresponding region may contain some pointer
  44 // into the owning region.
  45 
  46 // The "_fine_grain_entries" array is an open hash table of PerRegionTables
  47 // (PRTs), indicating regions for which we're keeping the RS as a set of
  48 // cards.  The strategy is to cap the size of the fine-grain table,
  49 // deleting an entry and setting the corresponding coarse-grained bit when


 414   // sets "card_index" to one of those cards (which is then considered
 415   // yielded.)   Otherwise, returns false (and leaves "card_index"
 416   // undefined.)
 417   bool has_next(size_t& card_index);
 418 
 419   size_t n_yielded_fine() { return _n_yielded_fine; }
 420   size_t n_yielded_coarse() { return _n_yielded_coarse; }
 421   size_t n_yielded_sparse() { return _n_yielded_sparse; }
 422   size_t n_yielded() {
 423     return n_yielded_fine() + n_yielded_coarse() + n_yielded_sparse();
 424   }
 425 };
 426 
 427 #if 0
 428 class CardClosure: public Closure {
 429 public:
 430   virtual void do_card(HeapWord* card_start) = 0;
 431 };
 432 
 433 #endif
 434 
 435 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONREMSET_HPP