46 size_t G1CardCounts::heap_map_factor() {
47 // See G1CardCounts::compute_size() why we reuse the card table value.
48 return G1CardTable::heap_map_factor();
49 }
50
51 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
52 if (has_count_table()) {
53 assert(from_card_num < to_card_num,
54 "Wrong order? from: " SIZE_FORMAT ", to: " SIZE_FORMAT,
55 from_card_num, to_card_num);
56 Copy::fill_to_bytes(&_card_counts[from_card_num], (to_card_num - from_card_num));
57 }
58 }
59
60 G1CardCounts::G1CardCounts(G1CollectedHeap *g1h):
61 _listener(), _g1h(g1h), _card_counts(NULL), _reserved_max_card_num(0) {
62 _listener.set_cardcounts(this);
63 }
64
65 void G1CardCounts::initialize(G1RegionToSpaceMapper* mapper) {
66 assert(_g1h->max_capacity() > 0, "initialization order");
67 assert(_g1h->capacity() == 0, "initialization order");
68
69 if (G1ConcRSHotCardLimit > 0) {
70 // The max value we can store in the counts table is
71 // max_jubyte. Guarantee the value of the hot
72 // threshold limit is no more than this.
73 guarantee(G1ConcRSHotCardLimit <= max_jubyte, "sanity");
74
75 _ct = _g1h->card_table();
76 _ct_bot = _ct->byte_for_const(_g1h->reserved_region().start());
77
78 _card_counts = (jubyte*) mapper->reserved().start();
79 _reserved_max_card_num = mapper->reserved().byte_size();
80 mapper->set_mapping_changed_listener(&_listener);
81 }
82 }
83
84 uint G1CardCounts::add_card_count(jbyte* card_ptr) {
85 // Returns the number of times the card has been refined.
86 // If we failed to reserve/commit the counts table, return 0.
|
46 size_t G1CardCounts::heap_map_factor() {
47 // See G1CardCounts::compute_size() why we reuse the card table value.
48 return G1CardTable::heap_map_factor();
49 }
50
51 void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
52 if (has_count_table()) {
53 assert(from_card_num < to_card_num,
54 "Wrong order? from: " SIZE_FORMAT ", to: " SIZE_FORMAT,
55 from_card_num, to_card_num);
56 Copy::fill_to_bytes(&_card_counts[from_card_num], (to_card_num - from_card_num));
57 }
58 }
59
60 G1CardCounts::G1CardCounts(G1CollectedHeap *g1h):
61 _listener(), _g1h(g1h), _card_counts(NULL), _reserved_max_card_num(0) {
62 _listener.set_cardcounts(this);
63 }
64
65 void G1CardCounts::initialize(G1RegionToSpaceMapper* mapper) {
66 assert(_g1h->max_reserved_capacity() > 0, "initialization order");
67 assert(_g1h->capacity() == 0, "initialization order");
68
69 if (G1ConcRSHotCardLimit > 0) {
70 // The max value we can store in the counts table is
71 // max_jubyte. Guarantee the value of the hot
72 // threshold limit is no more than this.
73 guarantee(G1ConcRSHotCardLimit <= max_jubyte, "sanity");
74
75 _ct = _g1h->card_table();
76 _ct_bot = _ct->byte_for_const(_g1h->reserved_region().start());
77
78 _card_counts = (jubyte*) mapper->reserved().start();
79 _reserved_max_card_num = mapper->reserved().byte_size();
80 mapper->set_mapping_changed_listener(&_listener);
81 }
82 }
83
84 uint G1CardCounts::add_card_count(jbyte* card_ptr) {
85 // Returns the number of times the card has been refined.
86 // If we failed to reserve/commit the counts table, return 0.
|