comparison src/share/vm/memory/gcLocker.hpp @ 806:821269eca479

6820167: GCALotAtAllSafepoints + FullGCALot(ScavengeALot) options crash JVM Summary: Short-circuit gc-a-lot attempts by non-JavaThreads; SkipGCALot c'tor to elide re-entrant gc-a-lot attempts. Reviewed-by: apetrusenko, jcoomes, jmasa, kamg
author ysr
date Thu, 11 Jun 2009 12:40:00 -0700
parents d1605aabd0a1
children bd02caa94611
comparison
equal deleted inserted replaced
800:7295839252de 806:821269eca479
240 : Pause_No_GC_Verifier(nsv) {} 240 : Pause_No_GC_Verifier(nsv) {}
241 ~Pause_No_Safepoint_Verifier() {} 241 ~Pause_No_Safepoint_Verifier() {}
242 #endif 242 #endif
243 }; 243 };
244 244
245 // A SkipGCALot object is used to elide the usual effect of gc-a-lot
246 // over a section of execution by a thread. Currently, it's used only to
247 // prevent re-entrant calls to GC.
248 class SkipGCALot : public StackObj {
249 private:
250 bool _saved;
251 Thread* _t;
252
253 public:
254 #ifdef ASSERT
255 SkipGCALot(Thread* t) : _t(t) {
256 _saved = _t->skip_gcalot();
257 _t->set_skip_gcalot(true);
258 }
259
260 ~SkipGCALot() {
261 assert(_t->skip_gcalot(), "Save-restore protocol invariant");
262 _t->set_skip_gcalot(_saved);
263 }
264 #else
265 SkipGCALot(Thread* t) { }
266 ~SkipGCALot() { }
267 #endif
268 };
269
245 // JRT_LEAF currently can be called from either _thread_in_Java or 270 // JRT_LEAF currently can be called from either _thread_in_Java or
246 // _thread_in_native mode. In _thread_in_native, it is ok 271 // _thread_in_native mode. In _thread_in_native, it is ok
247 // for another thread to trigger GC. The rest of the JRT_LEAF 272 // for another thread to trigger GC. The rest of the JRT_LEAF
248 // rules apply. 273 // rules apply.
249 class JRT_Leaf_Verifier : public No_Safepoint_Verifier { 274 class JRT_Leaf_Verifier : public No_Safepoint_Verifier {