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_CONCURRENTMARK_INLINE_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP
27
28 #include "gc_implementation/g1/concurrentMark.hpp"
29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
30 #include "utilities/taskqueue.inline.hpp"
31
32 // Utility routine to set an exclusive range of cards on the given
33 // card liveness bitmap
34 inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
35 BitMap::idx_t start_idx,
36 BitMap::idx_t end_idx,
37 bool is_par) {
38
39 // Set the exclusive bit range [start_idx, end_idx).
40 assert((end_idx - start_idx) > 0, "at least one card");
41 assert(end_idx <= card_bm->size(), "sanity");
42
43 // Silently clip the end index
44 end_idx = MIN2(end_idx, card_bm->size());
45
46 // For small ranges use a simple loop; otherwise use set_range or
47 // use par_at_put_range (if parallel). The range is made up of the
48 // cards that are spanned by an object/mem region so 8 cards will
49 // allow up to object sizes up to 4K to be handled using the loop.
50 if ((end_idx - start_idx) <= 8) {
387 // header it's impossible to get back a HC region.
388 assert(!hr->is_continues_humongous(), "sanity");
389
390 // We cannot assert that word_size == obj->size() given that obj
391 // might not be in a consistent state (another thread might be in
392 // the process of copying it). So the best thing we can do is to
393 // assert that word_size is under an upper bound which is its
394 // containing region's capacity.
395 assert(word_size * HeapWordSize <= hr->capacity(),
396 err_msg("size: "SIZE_FORMAT" capacity: "SIZE_FORMAT" "HR_FORMAT,
397 word_size * HeapWordSize, hr->capacity(),
398 HR_FORMAT_PARAMS(hr)));
399
400 if (addr < hr->next_top_at_mark_start()) {
401 if (!_nextMarkBitMap->isMarked(addr)) {
402 par_mark_and_count(obj, word_size, hr, worker_id);
403 }
404 }
405 }
406
407 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP
|
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_G1_CONCURRENTMARK_INLINE_HPP
26 #define SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
27
28 #include "gc/g1/concurrentMark.hpp"
29 #include "gc/g1/g1CollectedHeap.inline.hpp"
30 #include "gc/shared/taskqueue.inline.hpp"
31
32 // Utility routine to set an exclusive range of cards on the given
33 // card liveness bitmap
34 inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
35 BitMap::idx_t start_idx,
36 BitMap::idx_t end_idx,
37 bool is_par) {
38
39 // Set the exclusive bit range [start_idx, end_idx).
40 assert((end_idx - start_idx) > 0, "at least one card");
41 assert(end_idx <= card_bm->size(), "sanity");
42
43 // Silently clip the end index
44 end_idx = MIN2(end_idx, card_bm->size());
45
46 // For small ranges use a simple loop; otherwise use set_range or
47 // use par_at_put_range (if parallel). The range is made up of the
48 // cards that are spanned by an object/mem region so 8 cards will
49 // allow up to object sizes up to 4K to be handled using the loop.
50 if ((end_idx - start_idx) <= 8) {
387 // header it's impossible to get back a HC region.
388 assert(!hr->is_continues_humongous(), "sanity");
389
390 // We cannot assert that word_size == obj->size() given that obj
391 // might not be in a consistent state (another thread might be in
392 // the process of copying it). So the best thing we can do is to
393 // assert that word_size is under an upper bound which is its
394 // containing region's capacity.
395 assert(word_size * HeapWordSize <= hr->capacity(),
396 err_msg("size: "SIZE_FORMAT" capacity: "SIZE_FORMAT" "HR_FORMAT,
397 word_size * HeapWordSize, hr->capacity(),
398 HR_FORMAT_PARAMS(hr)));
399
400 if (addr < hr->next_top_at_mark_start()) {
401 if (!_nextMarkBitMap->isMarked(addr)) {
402 par_mark_and_count(obj, word_size, hr, worker_id);
403 }
404 }
405 }
406
407 #endif // SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
|