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 #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 G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
35 if (zero_filled) {
36 return;
37 }
38 MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
39 _counts->clear_range(mr);
40 }
41
42 size_t G1CardCounts::compute_size(size_t mem_region_size_in_words) {
43 // We keep card counts for every card, so the size of the card counts table must
44 // be the same as the card table.
45 return G1SATBCardTableLoggingModRefBS::compute_size(mem_region_size_in_words);
46 }
47
48 size_t G1CardCounts::heap_map_factor() {
49 // See G1CardCounts::compute_size() why we reuse the card table value.
50 return G1SATBCardTableLoggingModRefBS::heap_map_factor();
|
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 #include "precompiled.hpp"
26 #include "gc/g1/g1CardCounts.hpp"
27 #include "gc/g1/g1CollectedHeap.inline.hpp"
28 #include "gc/g1/g1CollectorPolicy.hpp"
29 #include "gc/g1/g1GCPhaseTimes.hpp"
30 #include "gc/shared/cardTableModRefBS.hpp"
31 #include "services/memTracker.hpp"
32 #include "utilities/copy.hpp"
33
34 void G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
35 if (zero_filled) {
36 return;
37 }
38 MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
39 _counts->clear_range(mr);
40 }
41
42 size_t G1CardCounts::compute_size(size_t mem_region_size_in_words) {
43 // We keep card counts for every card, so the size of the card counts table must
44 // be the same as the card table.
45 return G1SATBCardTableLoggingModRefBS::compute_size(mem_region_size_in_words);
46 }
47
48 size_t G1CardCounts::heap_map_factor() {
49 // See G1CardCounts::compute_size() why we reuse the card table value.
50 return G1SATBCardTableLoggingModRefBS::heap_map_factor();
|