1 /*
2 * Copyright (c) 2001, 2019, 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 *
122 inline void
123 G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) {
124 assert_heap_not_locked();
125
126 // Assign the containing region to containing_hr so that we don't
127 // have to keep calling heap_region_containing() in the
128 // asserts below.
129 DEBUG_ONLY(HeapRegion* containing_hr = heap_region_containing(start);)
130 assert(word_size > 0, "pre-condition");
131 assert(containing_hr->is_in(start), "it should contain start");
132 assert(containing_hr->is_young(), "it should be young");
133 assert(!containing_hr->is_humongous(), "it should not be humongous");
134
135 HeapWord* end = start + word_size;
136 assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
137
138 MemRegion mr(start, end);
139 card_table()->g1_mark_as_young(mr);
140 }
141
142 inline RefToScanQueue* G1CollectedHeap::task_queue(uint i) const {
143 return _task_queues->queue(i);
144 }
145
146 inline bool G1CollectedHeap::is_marked_next(oop obj) const {
147 return _cm->next_mark_bitmap()->is_marked(obj);
148 }
149
150 inline bool G1CollectedHeap::is_in_cset(oop obj) {
151 return is_in_cset(cast_from_oop<HeapWord*>(obj));
152 }
153
154 inline bool G1CollectedHeap::is_in_cset(HeapWord* addr) {
155 return _region_attr.is_in_cset(addr);
156 }
157
158 bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
159 return _region_attr.is_in_cset(hr);
160 }
161
162 bool G1CollectedHeap::is_in_cset_or_humongous(const oop obj) {
|
1 /*
2 * Copyright (c) 2001, 2020, 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 *
122 inline void
123 G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) {
124 assert_heap_not_locked();
125
126 // Assign the containing region to containing_hr so that we don't
127 // have to keep calling heap_region_containing() in the
128 // asserts below.
129 DEBUG_ONLY(HeapRegion* containing_hr = heap_region_containing(start);)
130 assert(word_size > 0, "pre-condition");
131 assert(containing_hr->is_in(start), "it should contain start");
132 assert(containing_hr->is_young(), "it should be young");
133 assert(!containing_hr->is_humongous(), "it should not be humongous");
134
135 HeapWord* end = start + word_size;
136 assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
137
138 MemRegion mr(start, end);
139 card_table()->g1_mark_as_young(mr);
140 }
141
142 inline ScannerTasksQueue* G1CollectedHeap::task_queue(uint i) const {
143 return _task_queues->queue(i);
144 }
145
146 inline bool G1CollectedHeap::is_marked_next(oop obj) const {
147 return _cm->next_mark_bitmap()->is_marked(obj);
148 }
149
150 inline bool G1CollectedHeap::is_in_cset(oop obj) {
151 return is_in_cset(cast_from_oop<HeapWord*>(obj));
152 }
153
154 inline bool G1CollectedHeap::is_in_cset(HeapWord* addr) {
155 return _region_attr.is_in_cset(addr);
156 }
157
158 bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
159 return _region_attr.is_in_cset(hr);
160 }
161
162 bool G1CollectedHeap::is_in_cset_or_humongous(const oop obj) {
|