0 /*
1 * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/parallel/cardTableExtension.hpp"
26 #include "gc/parallel/gcTaskManager.hpp"
27 #include "gc/parallel/objectStartArray.inline.hpp"
28 #include "gc/parallel/parallelScavengeHeap.hpp"
29 #include "gc/parallel/psPromotionManager.inline.hpp"
30 #include "gc/parallel/psScavenge.hpp"
31 #include "gc/parallel/psTasks.hpp"
32 #include "gc/parallel/psYoungGen.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "runtime/prefetch.inline.hpp"
35 #include "utilities/align.hpp"
36
37 // Checks an individual oop for missing precise marks. Mark
38 // may be either dirty or newgen.
39 class CheckForUnmarkedOops : public OopClosure {
40 private:
41 PSYoungGen* _young_gen;
42 CardTableExtension* _card_table;
43 HeapWord* _unmarked_addr;
44
45 protected:
46 template <class T> void do_oop_work(T* p) {
47 oop obj = oopDesc::load_decode_heap_oop(p);
|
0 /*
1 * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/parallel/cardTableExtension.hpp"
26 #include "gc/parallel/gcTaskManager.hpp"
27 #include "gc/parallel/objectStartArray.inline.hpp"
28 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
29 #include "gc/parallel/psPromotionManager.inline.hpp"
30 #include "gc/parallel/psScavenge.hpp"
31 #include "gc/parallel/psTasks.hpp"
32 #include "gc/parallel/psYoungGen.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "runtime/prefetch.inline.hpp"
35 #include "utilities/align.hpp"
36
37 // Checks an individual oop for missing precise marks. Mark
38 // may be either dirty or newgen.
39 class CheckForUnmarkedOops : public OopClosure {
40 private:
41 PSYoungGen* _young_gen;
42 CardTableExtension* _card_table;
43 HeapWord* _unmarked_addr;
44
45 protected:
46 template <class T> void do_oop_work(T* p) {
47 oop obj = oopDesc::load_decode_heap_oop(p);
|
658 // -------------
659 // ------------
660 // | target |
661 // ------------
662 // -------------
663 // | |
664 // -------------
665 // ^ returns this
666
667 HeapWord* CardTableExtension::lowest_prev_committed_start(int ind) const {
668 assert(_cur_covered_regions >= 0, "Expecting at least on region");
669 HeapWord* min_start = _committed[ind].start();
670 for (int j = 0; j < ind; j++) {
671 HeapWord* this_start = _committed[j].start();
672 if ((this_start < min_start) &&
673 !(_committed[j].intersection(_committed[ind])).is_empty()) {
674 min_start = this_start;
675 }
676 }
677 return min_start;
678 }
|
658 // -------------
659 // ------------
660 // | target |
661 // ------------
662 // -------------
663 // | |
664 // -------------
665 // ^ returns this
666
667 HeapWord* CardTableExtension::lowest_prev_committed_start(int ind) const {
668 assert(_cur_covered_regions >= 0, "Expecting at least on region");
669 HeapWord* min_start = _committed[ind].start();
670 for (int j = 0; j < ind; j++) {
671 HeapWord* this_start = _committed[j].start();
672 if ((this_start < min_start) &&
673 !(_committed[j].intersection(_committed[ind])).is_empty()) {
674 min_start = this_start;
675 }
676 }
677 return min_start;
678 }
679
680 bool CardTableExtension::is_in_young(oop obj) const {
681 return ParallelScavengeHeap::heap()->is_in_young(obj);
682 }
|