author | tschatzl |
Fri, 17 May 2019 12:33:37 +0200 | |
changeset 54923 | 23837d614c17 |
parent 54786 | ebf733a324d4 |
permissions | -rw-r--r-- |
35851 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52811
diff
changeset
|
2 |
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
35851 | 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 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52811
diff
changeset
|
25 |
#ifndef SHARE_GC_G1_G1HEAPVERIFIER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52811
diff
changeset
|
26 |
#define SHARE_GC_G1_G1HEAPVERIFIER_HPP |
35851 | 27 |
|
28 |
#include "gc/g1/heapRegionSet.hpp" |
|
54781 | 29 |
#include "gc/shared/verifyOption.hpp" |
35851 | 30 |
#include "memory/allocation.hpp" |
49725
e740e1a38c96
8200550: Xcode 9.3 produce warning -Wexpansion-to-defined
kbarrett
parents:
49602
diff
changeset
|
31 |
#include "utilities/macros.hpp" |
35851 | 32 |
|
33 |
class G1CollectedHeap; |
|
34 |
||
35 |
class G1HeapVerifier : public CHeapObj<mtGC> { |
|
36 |
private: |
|
49602 | 37 |
static int _enabled_verification_types; |
38 |
||
35851 | 39 |
G1CollectedHeap* _g1h; |
40 |
||
41 |
void verify_region_sets(); |
|
42 |
||
43 |
public: |
|
48179 | 44 |
enum G1VerifyType { |
50787
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
45 |
G1VerifyYoungNormal = 1, // -XX:VerifyGCType=young-normal |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
46 |
G1VerifyConcurrentStart = 2, // -XX:VerifyGCType=concurrent-start |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
47 |
G1VerifyMixed = 4, // -XX:VerifyGCType=mixed |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
48 |
G1VerifyRemark = 8, // -XX:VerifyGCType=remark |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
49 |
G1VerifyCleanup = 16, // -XX:VerifyGCType=cleanup |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
50 |
G1VerifyFull = 32, // -XX:VerifyGCType=full |
5f0266d16543
8204082: Make names of Young GCs more uniform in logs
tschatzl
parents:
49725
diff
changeset
|
51 |
G1VerifyAll = -1 |
48179 | 52 |
}; |
35851 | 53 |
|
49602 | 54 |
G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap) {} |
48179 | 55 |
|
49602 | 56 |
static void enable_verification_type(G1VerifyType type); |
57 |
static bool should_verify(G1VerifyType type); |
|
35851 | 58 |
|
59 |
// Perform verification. |
|
60 |
||
47885
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
61 |
// vo == UsePrevMarking -> use "prev" marking information, |
35851 | 62 |
// vo == UseNextMarking -> use "next" marking information |
47885
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
63 |
// vo == UseFullMarking -> use "next" marking bitmap but no TAMS |
35851 | 64 |
// |
65 |
// NOTE: Only the "prev" marking information is guaranteed to be |
|
66 |
// consistent most of the time, so most calls to this should use |
|
67 |
// vo == UsePrevMarking. |
|
68 |
// Currently, there is only one case where this is called with |
|
69 |
// vo == UseNextMarking, which is to verify the "next" marking |
|
70 |
// information at the end of remark. |
|
71 |
// Currently there is only one place where this is called with |
|
47885
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
72 |
// vo == UseFullMarking, which is to verify the marking during a |
35851 | 73 |
// full GC. |
74 |
void verify(VerifyOption vo); |
|
75 |
||
76 |
// verify_region_sets_optional() is planted in the code for |
|
49725
e740e1a38c96
8200550: Xcode 9.3 produce warning -Wexpansion-to-defined
kbarrett
parents:
49602
diff
changeset
|
77 |
// list verification in debug builds. |
e740e1a38c96
8200550: Xcode 9.3 produce warning -Wexpansion-to-defined
kbarrett
parents:
49602
diff
changeset
|
78 |
void verify_region_sets_optional() { DEBUG_ONLY(verify_region_sets();) } |
35851 | 79 |
|
80 |
void prepare_for_verify(); |
|
48179 | 81 |
double verify(G1VerifyType type, VerifyOption vo, const char* msg); |
82 |
void verify_before_gc(G1VerifyType type); |
|
83 |
void verify_after_gc(G1VerifyType type); |
|
35851 | 84 |
|
85 |
#ifndef PRODUCT |
|
86 |
// Make sure that the given bitmap has no marked objects in the |
|
87 |
// range [from,limit). If it does, print an error message and return |
|
88 |
// false. Otherwise, just return true. bitmap_name should be "prev" |
|
89 |
// or "next". |
|
46750 | 90 |
bool verify_no_bits_over_tams(const char* bitmap_name, const G1CMBitMap* const bitmap, |
35851 | 91 |
HeapWord* from, HeapWord* limit); |
92 |
||
93 |
// Verify that the prev / next bitmap range [tams,end) for the given |
|
94 |
// region has no marks. Return true if all is well, false if errors |
|
95 |
// are detected. |
|
96 |
bool verify_bitmaps(const char* caller, HeapRegion* hr); |
|
97 |
#endif // PRODUCT |
|
98 |
||
99 |
// If G1VerifyBitmaps is set, verify that the marking bitmaps for |
|
100 |
// the given region do not have any spurious marks. If errors are |
|
101 |
// detected, print appropriate error messages and crash. |
|
102 |
void check_bitmaps(const char* caller, HeapRegion* hr) PRODUCT_RETURN; |
|
103 |
||
104 |
// If G1VerifyBitmaps is set, verify that the marking bitmaps do not |
|
105 |
// have any spurious marks. If errors are detected, print |
|
106 |
// appropriate error messages and crash. |
|
107 |
void check_bitmaps(const char* caller) PRODUCT_RETURN; |
|
108 |
||
109 |
// Do sanity check on the contents of the in-cset fast test table. |
|
54923 | 110 |
bool check_region_attr_table() PRODUCT_RETURN_( return true; ); |
35851 | 111 |
|
112 |
void verify_card_table_cleanup() PRODUCT_RETURN; |
|
113 |
||
114 |
void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN; |
|
115 |
void verify_dirty_region(HeapRegion* hr) PRODUCT_RETURN; |
|
116 |
void verify_dirty_young_regions() PRODUCT_RETURN; |
|
46810
7dad333205cd
8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents:
46750
diff
changeset
|
117 |
|
52811
ff04b71bf6f1
8214388: CDS dumping fails with java heap fragmentation
iklam
parents:
50787
diff
changeset
|
118 |
static void verify_ready_for_archiving(); |
46810
7dad333205cd
8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents:
46750
diff
changeset
|
119 |
static void verify_archive_regions(); |
35851 | 120 |
}; |
121 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52811
diff
changeset
|
122 |
#endif // SHARE_GC_G1_G1HEAPVERIFIER_HPP |