26 #define SHARE_VM_GC_G1_G1HEAPVERIFIER_HPP
27
28 #include "gc/g1/heapRegionSet.hpp"
29 #include "memory/allocation.hpp"
30 #include "memory/universe.hpp"
31
32 class G1CollectedHeap;
33
34 class G1HeapVerifier : public CHeapObj<mtGC> {
35 private:
36 G1CollectedHeap* _g1h;
37 int _enabled_verification_types;
38
39 // verify_region_sets() performs verification over the region
40 // lists. It will be compiled in the product code to be used when
41 // necessary (i.e., during heap verification).
42 void verify_region_sets();
43
44 public:
45 enum G1VerifyType {
46 G1VerifyYoung = 1,
47 G1VerifyMixed = 2,
48 G1VerifyRemark = 4,
49 G1VerifyCleanup = 8,
50 G1VerifyFull = 16,
51 G1VerifyAll = -1
52 };
53
54 G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap), _enabled_verification_types(G1VerifyAll) { }
55
56 void parse_verification_type(const char* type);
57 void enable_verification_type(G1VerifyType type);
58 bool should_verify(G1VerifyType type);
59
60 // Perform verification.
61
62 // vo == UsePrevMarking -> use "prev" marking information,
63 // vo == UseNextMarking -> use "next" marking information
64 // vo == UseFullMarking -> use "next" marking bitmap but no TAMS
65 //
66 // NOTE: Only the "prev" marking information is guaranteed to be
67 // consistent most of the time, so most calls to this should use
68 // vo == UsePrevMarking.
69 // Currently, there is only one case where this is called with
70 // vo == UseNextMarking, which is to verify the "next" marking
|
26 #define SHARE_VM_GC_G1_G1HEAPVERIFIER_HPP
27
28 #include "gc/g1/heapRegionSet.hpp"
29 #include "memory/allocation.hpp"
30 #include "memory/universe.hpp"
31
32 class G1CollectedHeap;
33
34 class G1HeapVerifier : public CHeapObj<mtGC> {
35 private:
36 G1CollectedHeap* _g1h;
37 int _enabled_verification_types;
38
39 // verify_region_sets() performs verification over the region
40 // lists. It will be compiled in the product code to be used when
41 // necessary (i.e., during heap verification).
42 void verify_region_sets();
43
44 public:
45 enum G1VerifyType {
46 G1VerifyYoungOnly = 1, // -XX:VerifyGCType=young-only
47 G1VerifyInitialMark = 2, // -XX:VerifyGCType=initial-mark
48 G1VerifyMixed = 4, // -XX:VerifyGCType=mixed
49 G1VerifyRemark = 8, // -XX:VerifyGCType=remark
50 G1VerifyCleanup = 16, // -XX:VerifyGCType=cleanup
51 G1VerifyFull = 32, // -XX:VerifyGCType=full
52 G1VerifyAll = -1
53 };
54
55 G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap), _enabled_verification_types(G1VerifyAll) { }
56
57 void parse_verification_type(const char* type);
58 void enable_verification_type(G1VerifyType type);
59 bool should_verify(G1VerifyType type);
60
61 // Perform verification.
62
63 // vo == UsePrevMarking -> use "prev" marking information,
64 // vo == UseNextMarking -> use "next" marking information
65 // vo == UseFullMarking -> use "next" marking bitmap but no TAMS
66 //
67 // NOTE: Only the "prev" marking information is guaranteed to be
68 // consistent most of the time, so most calls to this should use
69 // vo == UsePrevMarking.
70 // Currently, there is only one case where this is called with
71 // vo == UseNextMarking, which is to verify the "next" marking
|