< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp

Print this page

 40 class ShenandoahVerifierTask {
 41 public:
 42   ShenandoahVerifierTask(oop o = NULL, int idx = 0): _obj(o) { }
 43   ShenandoahVerifierTask(oop o, size_t idx): _obj(o) { }
 44   // Trivially copyable.
 45 
 46   inline oop obj()  const { return _obj; }
 47 
 48 private:
 49   oop _obj;
 50 };
 51 
 52 typedef Stack<ShenandoahVerifierTask, mtGC> ShenandoahVerifierStack;
 53 typedef volatile juint ShenandoahLivenessData;
 54 
 55 class ShenandoahVerifier : public CHeapObj<mtGC> {
 56 private:
 57   ShenandoahHeap* _heap;
 58   MarkBitMap* _verification_bit_map;
 59 public:


















 60   typedef enum {
 61     // Disable marked objects verification.
 62     _verify_marked_disable,
 63 
 64     // Objects should be marked in "next" bitmap.
 65     _verify_marked_incomplete,
 66 
 67     // Objects should be marked in "complete" bitmap.
 68     _verify_marked_complete,
 69 
 70     // Objects should be marked in "complete" bitmap, except j.l.r.Reference referents, which
 71     // may be dangling after marking but before conc-weakrefs-processing.
 72     _verify_marked_complete_except_references
 73   } VerifyMarked;
 74 
 75   typedef enum {
 76     // Disable forwarded objects verification.
 77     _verify_forwarded_disable,
 78 
 79     // Objects should not have forwardees.

119     _verify_regions_nocset,
120 
121     // No trash and no cset regions allowed
122     _verify_regions_notrash_nocset
123   } VerifyRegions;
124 
125   typedef enum {
126     // Disable gc-state verification
127     _verify_gcstate_disable,
128 
129     // Nothing is in progress, no forwarded objects
130     _verify_gcstate_stable,
131 
132     // Nothing is in progress, no forwarded objects, weak roots handling
133     _verify_gcstate_stable_weakroots,
134 
135     // Nothing is in progress, some objects are forwarded
136     _verify_gcstate_forwarded,
137 
138     // Evacuation is in progress, some objects are forwarded
139     _verify_gcstate_evacuation



140   } VerifyGCState;
141 
142   struct VerifyOptions {
143     VerifyForwarded     _verify_forwarded;
144     VerifyMarked        _verify_marked;
145     VerifyCollectionSet _verify_cset;
146     VerifyLiveness      _verify_liveness;
147     VerifyRegions       _verify_regions;
148     VerifyGCState       _verify_gcstate;
149 
150     VerifyOptions(VerifyForwarded verify_forwarded,
151                   VerifyMarked verify_marked,
152                   VerifyCollectionSet verify_collection_set,
153                   VerifyLiveness verify_liveness,
154                   VerifyRegions verify_regions,
155                   VerifyGCState verify_gcstate) :
156             _verify_forwarded(verify_forwarded), _verify_marked(verify_marked),
157             _verify_cset(verify_collection_set),
158             _verify_liveness(verify_liveness), _verify_regions(verify_regions),
159             _verify_gcstate(verify_gcstate) {}
160   };
161 
162 private:
163   void verify_at_safepoint(const char *label,

164                            VerifyForwarded forwarded,
165                            VerifyMarked marked,
166                            VerifyCollectionSet cset,
167                            VerifyLiveness liveness,
168                            VerifyRegions regions,
169                            VerifyGCState gcstate);
170 
171 public:
172   ShenandoahVerifier(ShenandoahHeap* heap, MarkBitMap* verification_bitmap) :
173           _heap(heap), _verification_bit_map(verification_bitmap) {};
174 
175   void verify_before_concmark();
176   void verify_after_concmark();
177   void verify_before_evacuation();
178   void verify_during_evacuation();
179   void verify_after_evacuation();
180   void verify_before_updaterefs();
181   void verify_after_updaterefs();
182   void verify_before_fullgc();
183   void verify_after_fullgc();

184   void verify_after_degenerated();
185   void verify_generic(VerifyOption option);
186 
187   // Roots should only contain to-space oops
188   void verify_roots_in_to_space();
189 
190   void verify_roots_no_forwarded();
191 };
192 
193 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHVERIFIER_HPP

 40 class ShenandoahVerifierTask {
 41 public:
 42   ShenandoahVerifierTask(oop o = NULL, int idx = 0): _obj(o) { }
 43   ShenandoahVerifierTask(oop o, size_t idx): _obj(o) { }
 44   // Trivially copyable.
 45 
 46   inline oop obj()  const { return _obj; }
 47 
 48 private:
 49   oop _obj;
 50 };
 51 
 52 typedef Stack<ShenandoahVerifierTask, mtGC> ShenandoahVerifierStack;
 53 typedef volatile juint ShenandoahLivenessData;
 54 
 55 class ShenandoahVerifier : public CHeapObj<mtGC> {
 56 private:
 57   ShenandoahHeap* _heap;
 58   MarkBitMap* _verification_bit_map;
 59 public:
 60   typedef enum {
 61     // Disable remembered set verification.
 62     _verify_remembered_disable,
 63 
 64     // Assure old objects are registered and remembered set cards within the read-only remembered set are dirty
 65     // for every interesting pointer within each OLD ShenandoahHeapRegion between bottom() and top().  This is
 66     // appropriate at the init_mark safepoint since all TLABS are retired before we reach this code.
 67     _verify_remembered_for_marking,
 68 
 69     // Assure old objects are registered and remembered set cards within the read-write remembered set are dirty
 70     // for every interesting pointer within each OLD ShenandoahHeapRegion between bottom() and top().
 71     _verify_remembered_for_updating_references,
 72 
 73     // Assure old objects are registered and remembered set cards within the read-write remembered set are dirty
 74     // for every interesting pointer within each OLD ShenandoahHeapRegion between bottom() and top().
 75     _verify_remembered_after_full_gc
 76   } VerifyRememberedSet;
 77 
 78   typedef enum {
 79     // Disable marked objects verification.
 80     _verify_marked_disable,
 81 
 82     // Objects should be marked in "next" bitmap.
 83     _verify_marked_incomplete,
 84 
 85     // Objects should be marked in "complete" bitmap.
 86     _verify_marked_complete,
 87 
 88     // Objects should be marked in "complete" bitmap, except j.l.r.Reference referents, which
 89     // may be dangling after marking but before conc-weakrefs-processing.
 90     _verify_marked_complete_except_references
 91   } VerifyMarked;
 92 
 93   typedef enum {
 94     // Disable forwarded objects verification.
 95     _verify_forwarded_disable,
 96 
 97     // Objects should not have forwardees.

137     _verify_regions_nocset,
138 
139     // No trash and no cset regions allowed
140     _verify_regions_notrash_nocset
141   } VerifyRegions;
142 
143   typedef enum {
144     // Disable gc-state verification
145     _verify_gcstate_disable,
146 
147     // Nothing is in progress, no forwarded objects
148     _verify_gcstate_stable,
149 
150     // Nothing is in progress, no forwarded objects, weak roots handling
151     _verify_gcstate_stable_weakroots,
152 
153     // Nothing is in progress, some objects are forwarded
154     _verify_gcstate_forwarded,
155 
156     // Evacuation is in progress, some objects are forwarded
157     _verify_gcstate_evacuation,
158 
159     // Evacuation is done, objects are forwarded, updating is in progress
160     _verify_gcstate_updating
161   } VerifyGCState;
162 
163   struct VerifyOptions {
164     VerifyForwarded     _verify_forwarded;
165     VerifyMarked        _verify_marked;
166     VerifyCollectionSet _verify_cset;
167     VerifyLiveness      _verify_liveness;
168     VerifyRegions       _verify_regions;
169     VerifyGCState       _verify_gcstate;
170 
171     VerifyOptions(VerifyForwarded verify_forwarded,
172                   VerifyMarked verify_marked,
173                   VerifyCollectionSet verify_collection_set,
174                   VerifyLiveness verify_liveness,
175                   VerifyRegions verify_regions,
176                   VerifyGCState verify_gcstate) :
177             _verify_forwarded(verify_forwarded), _verify_marked(verify_marked),
178             _verify_cset(verify_collection_set),
179             _verify_liveness(verify_liveness), _verify_regions(verify_regions),
180             _verify_gcstate(verify_gcstate) {}
181   };
182 
183 private:
184   void verify_at_safepoint(const char* label,
185                            VerifyRememberedSet remembered,
186                            VerifyForwarded forwarded,
187                            VerifyMarked marked,
188                            VerifyCollectionSet cset,
189                            VerifyLiveness liveness,
190                            VerifyRegions regions,
191                            VerifyGCState gcstate);
192 
193 public:
194   ShenandoahVerifier(ShenandoahHeap* heap, MarkBitMap* verification_bitmap) :
195           _heap(heap), _verification_bit_map(verification_bitmap) {};
196 
197   void verify_before_concmark();
198   void verify_after_concmark();
199   void verify_before_evacuation();
200   void verify_during_evacuation();
201   void verify_after_evacuation();
202   void verify_before_updaterefs();
203   void verify_after_updaterefs();
204   void verify_before_fullgc();
205   void verify_after_fullgc();
206   void verify_after_generational_fullgc();
207   void verify_after_degenerated();
208   void verify_generic(VerifyOption option);
209 
210   // Roots should only contain to-space oops
211   void verify_roots_in_to_space();
212 
213   void verify_roots_no_forwarded();
214 };
215 
216 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHVERIFIER_HPP
< prev index next >