55
56 static void assert_in_heap(void* interior_loc, oop obj, const char* file, int line);
57 static void assert_in_heap_or_null(void* interior_loc, oop obj, const char* file, int line);
58 static void assert_in_correct_region(void* interior_loc, oop obj, const char* file, int line);
59
60 static void assert_correct(void* interior_loc, oop obj, const char* file, int line);
61 static void assert_forwarded(void* interior_loc, oop obj, const char* file, int line);
62 static void assert_not_forwarded(void* interior_loc, oop obj, const char* file, int line);
63 static void assert_marked(void* interior_loc, oop obj, const char* file, int line);
64 static void assert_marked_weak(void* interior_loc, oop obj, const char* file, int line);
65 static void assert_marked_strong(void* interior_loc, oop obj, const char* file, int line);
66 static void assert_in_cset(void* interior_loc, oop obj, const char* file, int line);
67 static void assert_not_in_cset(void* interior_loc, oop obj, const char* file, int line);
68 static void assert_not_in_cset_loc(void* interior_loc, const char* file, int line);
69
70 static void assert_locked_or_shenandoah_safepoint(Mutex* lock, const char* file, int line);
71
72 static void assert_heaplocked(const char* file, int line);
73 static void assert_not_heaplocked(const char* file, int line);
74 static void assert_heaplocked_or_safepoint(const char* file, int line);
75
76 #ifdef ASSERT
77 #define shenandoah_assert_in_heap(interior_loc, obj) \
78 ShenandoahAsserts::assert_in_heap(interior_loc, obj, __FILE__, __LINE__)
79 #define shenandoah_assert_in_heap_or_null(interior_loc, obj) \
80 ShenandoahAsserts::assert_in_heap_or_null(interior_loc, obj, __FILE__, __LINE__)
81 #define shenandoah_assert_in_correct_region(interior_loc, obj) \
82 ShenandoahAsserts::assert_in_correct_region(interior_loc, obj, __FILE__, __LINE__)
83
84 #define shenandoah_assert_correct_if(interior_loc, obj, condition) \
85 if (condition) ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
86 #define shenandoah_assert_correct_except(interior_loc, obj, exception) \
87 if (!(exception)) ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
88 #define shenandoah_assert_correct(interior_loc, obj) \
89 ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
90
91 #define shenandoah_assert_forwarded_if(interior_loc, obj, condition) \
92 if (condition) ShenandoahAsserts::assert_forwarded(interior_loc, obj, __FILE__, __LINE__)
93 #define shenandoah_assert_forwarded_except(interior_loc, obj, exception) \
94 if (!(exception)) ShenandoahAsserts::assert_forwarded(interior_loc, obj, __FILE__, __LINE__)
146
147 #define shenandoah_assert_rp_isalive_installed() \
148 ShenandoahAsserts::assert_rp_isalive_installed(__FILE__, __LINE__)
149 #define shenandoah_assert_rp_isalive_not_installed() \
150 ShenandoahAsserts::assert_rp_isalive_not_installed(__FILE__, __LINE__)
151
152 #define shenandoah_assert_safepoint() \
153 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Should be at Shenandoah Safepoints")
154
155 #define shenandoah_assert_locked_or_safepoint(lock) \
156 ShenandoahAsserts::assert_locked_or_shenandoah_safepoint(lock, __FILE__, __LINE__)
157
158 #define shenandoah_assert_heaplocked() \
159 ShenandoahAsserts::assert_heaplocked(__FILE__, __LINE__)
160
161 #define shenandoah_assert_not_heaplocked() \
162 ShenandoahAsserts::assert_not_heaplocked(__FILE__, __LINE__)
163
164 #define shenandoah_assert_heaplocked_or_safepoint() \
165 ShenandoahAsserts::assert_heaplocked_or_safepoint(__FILE__, __LINE__)
166 #else
167 #define shenandoah_assert_in_heap(interior_loc, obj)
168 #define shenandoah_assert_in_heap_or_null(interior_loc, obj)
169 #define shenandoah_assert_in_correct_region(interior_loc, obj)
170
171 #define shenandoah_assert_correct_if(interior_loc, obj, condition)
172 #define shenandoah_assert_correct_except(interior_loc, obj, exception)
173 #define shenandoah_assert_correct(interior_loc, obj)
174
175 #define shenandoah_assert_forwarded_if(interior_loc, obj, condition)
176 #define shenandoah_assert_forwarded_except(interior_loc, obj, exception)
177 #define shenandoah_assert_forwarded(interior_loc, obj)
178
179 #define shenandoah_assert_not_forwarded_if(interior_loc, obj, condition)
180 #define shenandoah_assert_not_forwarded_except(interior_loc, obj, exception)
181 #define shenandoah_assert_not_forwarded(interior_loc, obj)
182
183 #define shenandoah_assert_marked_if(interior_loc, obj, condition)
184 #define shenandoah_assert_marked_except(interior_loc, obj, exception)
185 #define shenandoah_assert_marked(interior_loc, obj)
196 #define shenandoah_assert_in_cset_except(interior_loc, obj, exception)
197 #define shenandoah_assert_in_cset(interior_loc, obj)
198
199 #define shenandoah_assert_not_in_cset_if(interior_loc, obj, condition)
200 #define shenandoah_assert_not_in_cset_except(interior_loc, obj, exception)
201 #define shenandoah_assert_not_in_cset(interior_loc, obj)
202
203 #define shenandoah_assert_not_in_cset_loc_if(interior_loc, condition)
204 #define shenandoah_assert_not_in_cset_loc_except(interior_loc, exception)
205 #define shenandoah_assert_not_in_cset_loc(interior_loc)
206
207 #define shenandoah_assert_rp_isalive_installed()
208 #define shenandoah_assert_rp_isalive_not_installed()
209
210 #define shenandoah_assert_safepoint()
211 #define shenandoah_assert_locked_or_safepoint(lock)
212
213 #define shenandoah_assert_heaplocked()
214 #define shenandoah_assert_not_heaplocked()
215 #define shenandoah_assert_heaplocked_or_safepoint()
216
217 #endif
218
219 #define shenandoah_not_implemented \
220 { fatal("Deliberately not implemented."); }
221 #define shenandoah_not_implemented_return(v) \
222 { fatal("Deliberately not implemented."); return v; }
223
224 };
225
226 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHASSERTS_HPP
|
55
56 static void assert_in_heap(void* interior_loc, oop obj, const char* file, int line);
57 static void assert_in_heap_or_null(void* interior_loc, oop obj, const char* file, int line);
58 static void assert_in_correct_region(void* interior_loc, oop obj, const char* file, int line);
59
60 static void assert_correct(void* interior_loc, oop obj, const char* file, int line);
61 static void assert_forwarded(void* interior_loc, oop obj, const char* file, int line);
62 static void assert_not_forwarded(void* interior_loc, oop obj, const char* file, int line);
63 static void assert_marked(void* interior_loc, oop obj, const char* file, int line);
64 static void assert_marked_weak(void* interior_loc, oop obj, const char* file, int line);
65 static void assert_marked_strong(void* interior_loc, oop obj, const char* file, int line);
66 static void assert_in_cset(void* interior_loc, oop obj, const char* file, int line);
67 static void assert_not_in_cset(void* interior_loc, oop obj, const char* file, int line);
68 static void assert_not_in_cset_loc(void* interior_loc, const char* file, int line);
69
70 static void assert_locked_or_shenandoah_safepoint(Mutex* lock, const char* file, int line);
71
72 static void assert_heaplocked(const char* file, int line);
73 static void assert_not_heaplocked(const char* file, int line);
74 static void assert_heaplocked_or_safepoint(const char* file, int line);
75 static void assert_heaplocked_or_fullgc_safepoint(const char* file, int line);
76
77 #ifdef ASSERT
78 #define shenandoah_assert_in_heap(interior_loc, obj) \
79 ShenandoahAsserts::assert_in_heap(interior_loc, obj, __FILE__, __LINE__)
80 #define shenandoah_assert_in_heap_or_null(interior_loc, obj) \
81 ShenandoahAsserts::assert_in_heap_or_null(interior_loc, obj, __FILE__, __LINE__)
82 #define shenandoah_assert_in_correct_region(interior_loc, obj) \
83 ShenandoahAsserts::assert_in_correct_region(interior_loc, obj, __FILE__, __LINE__)
84
85 #define shenandoah_assert_correct_if(interior_loc, obj, condition) \
86 if (condition) ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
87 #define shenandoah_assert_correct_except(interior_loc, obj, exception) \
88 if (!(exception)) ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
89 #define shenandoah_assert_correct(interior_loc, obj) \
90 ShenandoahAsserts::assert_correct(interior_loc, obj, __FILE__, __LINE__)
91
92 #define shenandoah_assert_forwarded_if(interior_loc, obj, condition) \
93 if (condition) ShenandoahAsserts::assert_forwarded(interior_loc, obj, __FILE__, __LINE__)
94 #define shenandoah_assert_forwarded_except(interior_loc, obj, exception) \
95 if (!(exception)) ShenandoahAsserts::assert_forwarded(interior_loc, obj, __FILE__, __LINE__)
147
148 #define shenandoah_assert_rp_isalive_installed() \
149 ShenandoahAsserts::assert_rp_isalive_installed(__FILE__, __LINE__)
150 #define shenandoah_assert_rp_isalive_not_installed() \
151 ShenandoahAsserts::assert_rp_isalive_not_installed(__FILE__, __LINE__)
152
153 #define shenandoah_assert_safepoint() \
154 assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Should be at Shenandoah Safepoints")
155
156 #define shenandoah_assert_locked_or_safepoint(lock) \
157 ShenandoahAsserts::assert_locked_or_shenandoah_safepoint(lock, __FILE__, __LINE__)
158
159 #define shenandoah_assert_heaplocked() \
160 ShenandoahAsserts::assert_heaplocked(__FILE__, __LINE__)
161
162 #define shenandoah_assert_not_heaplocked() \
163 ShenandoahAsserts::assert_not_heaplocked(__FILE__, __LINE__)
164
165 #define shenandoah_assert_heaplocked_or_safepoint() \
166 ShenandoahAsserts::assert_heaplocked_or_safepoint(__FILE__, __LINE__)
167
168 #define shenandoah_assert_heaplocked_or_fullgc_safepoint() \
169 ShenandoahAsserts::assert_heaplocked_or_fullgc_safepoint(__FILE__, __LINE__)
170 #define shenandoah_assert_control_or_vm_thread() \
171 assert(Thread::current()->is_VM_thread() || Thread::current() == ShenandoahHeap::heap()->control_thread(), "Expected control thread or vm thread")
172
173 #define shenandoah_assert_generational() \
174 assert(ShenandoahHeap::heap()->mode()->is_generational(), "Must be in generational mode here.")
175 #else
176 #define shenandoah_assert_in_heap(interior_loc, obj)
177 #define shenandoah_assert_in_heap_or_null(interior_loc, obj)
178 #define shenandoah_assert_in_correct_region(interior_loc, obj)
179
180 #define shenandoah_assert_correct_if(interior_loc, obj, condition)
181 #define shenandoah_assert_correct_except(interior_loc, obj, exception)
182 #define shenandoah_assert_correct(interior_loc, obj)
183
184 #define shenandoah_assert_forwarded_if(interior_loc, obj, condition)
185 #define shenandoah_assert_forwarded_except(interior_loc, obj, exception)
186 #define shenandoah_assert_forwarded(interior_loc, obj)
187
188 #define shenandoah_assert_not_forwarded_if(interior_loc, obj, condition)
189 #define shenandoah_assert_not_forwarded_except(interior_loc, obj, exception)
190 #define shenandoah_assert_not_forwarded(interior_loc, obj)
191
192 #define shenandoah_assert_marked_if(interior_loc, obj, condition)
193 #define shenandoah_assert_marked_except(interior_loc, obj, exception)
194 #define shenandoah_assert_marked(interior_loc, obj)
205 #define shenandoah_assert_in_cset_except(interior_loc, obj, exception)
206 #define shenandoah_assert_in_cset(interior_loc, obj)
207
208 #define shenandoah_assert_not_in_cset_if(interior_loc, obj, condition)
209 #define shenandoah_assert_not_in_cset_except(interior_loc, obj, exception)
210 #define shenandoah_assert_not_in_cset(interior_loc, obj)
211
212 #define shenandoah_assert_not_in_cset_loc_if(interior_loc, condition)
213 #define shenandoah_assert_not_in_cset_loc_except(interior_loc, exception)
214 #define shenandoah_assert_not_in_cset_loc(interior_loc)
215
216 #define shenandoah_assert_rp_isalive_installed()
217 #define shenandoah_assert_rp_isalive_not_installed()
218
219 #define shenandoah_assert_safepoint()
220 #define shenandoah_assert_locked_or_safepoint(lock)
221
222 #define shenandoah_assert_heaplocked()
223 #define shenandoah_assert_not_heaplocked()
224 #define shenandoah_assert_heaplocked_or_safepoint()
225 #define shenandoah_assert_heaplocked_or_fullgc_safepoint()
226 #define shenandoah_assert_control_or_vm_thread()
227 #define shenandoah_assert_generational()
228
229 #endif
230
231 #define shenandoah_not_implemented \
232 { fatal("Deliberately not implemented."); }
233 #define shenandoah_not_implemented_return(v) \
234 { fatal("Deliberately not implemented."); return v; }
235
236 };
237
238 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHASSERTS_HPP
|