Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/interfaceSupport.cpp @ 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 | a61af66fc99e |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
800:7295839252de | 806:821269eca479 |
---|---|
64 tty->print_cr("%6d %s", _number_of_calls, header); | 64 tty->print_cr("%6d %s", _number_of_calls, header); |
65 } | 65 } |
66 | 66 |
67 void InterfaceSupport::gc_alot() { | 67 void InterfaceSupport::gc_alot() { |
68 Thread *thread = Thread::current(); | 68 Thread *thread = Thread::current(); |
69 if (thread->is_VM_thread()) return; // Avoid concurrent calls | 69 if (!thread->is_Java_thread()) return; // Avoid concurrent calls |
70 // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC. | 70 // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC. |
71 JavaThread *current_thread = (JavaThread *)thread; | 71 JavaThread *current_thread = (JavaThread *)thread; |
72 if (current_thread->active_handles() == NULL) return; | 72 if (current_thread->active_handles() == NULL) return; |
73 | |
74 // Short-circuit any possible re-entrant gc-a-lot attempt | |
75 if (thread->skip_gcalot()) return; | |
73 | 76 |
74 if (is_init_completed()) { | 77 if (is_init_completed()) { |
75 | 78 |
76 if (++_fullgc_alot_invocation < FullGCALotStart) { | 79 if (++_fullgc_alot_invocation < FullGCALotStart) { |
77 return; | 80 return; |