hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp

Print this page




  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 #include "precompiled.hpp"
  26 #include "gc_implementation/g1/g1CardCounts.hpp"
  27 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  29 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
  30 #include "memory/cardTableModRefBS.hpp"
  31 #include "services/memTracker.hpp"
  32 #include "utilities/copy.hpp"
  33 
  34 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
  35   if (has_count_table()) {
  36     check_card_num(from_card_num,
  37                    err_msg("from card num out of range: "SIZE_FORMAT, from_card_num));
  38     assert(from_card_num < to_card_num,
  39            err_msg("Wrong order? from: " SIZE_FORMAT ", to: "SIZE_FORMAT,
  40                    from_card_num, to_card_num));
  41     assert(to_card_num <= _committed_max_card_num,
  42            err_msg("to card num out of range: "
  43                    "to: "SIZE_FORMAT ", "
  44                    "max: "SIZE_FORMAT,
  45                    to_card_num, _committed_max_card_num));
  46 
  47     to_card_num = MIN2(_committed_max_card_num, to_card_num);
  48 
  49     Copy::fill_to_bytes(&_card_counts[from_card_num], (to_card_num - from_card_num));
  50   }
  51 }
  52 
  53 G1CardCounts::G1CardCounts(G1CollectedHeap *g1h):
  54   _g1h(g1h), _card_counts(NULL),
  55   _reserved_max_card_num(0), _committed_max_card_num(0),
  56   _committed_size(0) {}
  57 




  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 #include "precompiled.hpp"
  26 #include "gc_implementation/g1/g1CardCounts.hpp"
  27 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  29 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
  30 #include "memory/cardTableModRefBS.hpp"
  31 #include "services/memTracker.hpp"
  32 #include "utilities/copy.hpp"
  33 
  34 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
  35   if (has_count_table()) {
  36     check_card_num(from_card_num);

  37     assert(from_card_num < to_card_num,
  38            err_msg("Wrong order? from: " SIZE_FORMAT ", to: "SIZE_FORMAT,
  39                    from_card_num, to_card_num));
  40     assert(to_card_num <= _committed_max_card_num,
  41            err_msg("to card num out of range: "
  42                    "to: "SIZE_FORMAT ", "
  43                    "max: "SIZE_FORMAT,
  44                    to_card_num, _committed_max_card_num));
  45 
  46     to_card_num = MIN2(_committed_max_card_num, to_card_num);
  47 
  48     Copy::fill_to_bytes(&_card_counts[from_card_num], (to_card_num - from_card_num));
  49   }
  50 }
  51 
  52 G1CardCounts::G1CardCounts(G1CollectedHeap *g1h):
  53   _g1h(g1h), _card_counts(NULL),
  54   _reserved_max_card_num(0), _committed_max_card_num(0),
  55   _committed_size(0) {}
  56