1 /*
2 * Copyright (c) 2001, 2018, 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 *
639 if (_lowest_non_clean_base_chunk_index) {
640 FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
641 _lowest_non_clean_base_chunk_index = NULL;
642 }
643 if (_last_LNC_resizing_collection) {
644 FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
645 _last_LNC_resizing_collection = NULL;
646 }
647 }
648
649 void CardTableRS::initialize() {
650 CardTable::initialize();
651 _lowest_non_clean =
652 NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
653 _lowest_non_clean_chunk_size =
654 NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
655 _lowest_non_clean_base_chunk_index =
656 NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
657 _last_LNC_resizing_collection =
658 NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
659 if (_lowest_non_clean == NULL
660 || _lowest_non_clean_chunk_size == NULL
661 || _lowest_non_clean_base_chunk_index == NULL
662 || _last_LNC_resizing_collection == NULL)
663 vm_exit_during_initialization("couldn't allocate an LNC array.");
664 for (int i = 0; i < _max_covered_regions; i++) {
665 _lowest_non_clean[i] = NULL;
666 _lowest_non_clean_chunk_size[i] = 0;
667 _last_LNC_resizing_collection[i] = -1;
668 }
669 }
670
671 bool CardTableRS::card_will_be_scanned(CardValue cv) {
672 return card_is_dirty_wrt_gen_iter(cv) || is_prev_nonclean_card_val(cv);
673 }
674
675 bool CardTableRS::card_may_have_been_dirty(CardValue cv) {
676 return
677 cv != clean_card &&
678 (card_is_dirty_wrt_gen_iter(cv) ||
679 CardTableRS::youngergen_may_have_been_dirty(cv));
680 }
681
682 void CardTableRS::non_clean_card_iterate_possibly_parallel(
683 Space* sp,
|
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 *
639 if (_lowest_non_clean_base_chunk_index) {
640 FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
641 _lowest_non_clean_base_chunk_index = NULL;
642 }
643 if (_last_LNC_resizing_collection) {
644 FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
645 _last_LNC_resizing_collection = NULL;
646 }
647 }
648
649 void CardTableRS::initialize() {
650 CardTable::initialize();
651 _lowest_non_clean =
652 NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
653 _lowest_non_clean_chunk_size =
654 NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
655 _lowest_non_clean_base_chunk_index =
656 NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
657 _last_LNC_resizing_collection =
658 NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
659
660 for (int i = 0; i < _max_covered_regions; i++) {
661 _lowest_non_clean[i] = NULL;
662 _lowest_non_clean_chunk_size[i] = 0;
663 _last_LNC_resizing_collection[i] = -1;
664 }
665 }
666
667 bool CardTableRS::card_will_be_scanned(CardValue cv) {
668 return card_is_dirty_wrt_gen_iter(cv) || is_prev_nonclean_card_val(cv);
669 }
670
671 bool CardTableRS::card_may_have_been_dirty(CardValue cv) {
672 return
673 cv != clean_card &&
674 (card_is_dirty_wrt_gen_iter(cv) ||
675 CardTableRS::youngergen_may_have_been_dirty(cv));
676 }
677
678 void CardTableRS::non_clean_card_iterate_possibly_parallel(
679 Space* sp,
|