Mercurial > hg > truffle
comparison src/share/vm/runtime/sweeper.cpp @ 13722:2d4a8d3d286b
Sweeper: make sure we only run the sweeper on java threads
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 21 Jan 2014 18:35:03 +0100 |
parents | 810f2c413ace |
children | d8041d695d19 |
comparison
equal
deleted
inserted
replaced
13721:2f944a810dd4 | 13722:2d4a8d3d286b |
---|---|
231 * (3) We have not been sweeping for 'some time' | 231 * (3) We have not been sweeping for 'some time' |
232 */ | 232 */ |
233 void NMethodSweeper::possibly_sweep() { | 233 void NMethodSweeper::possibly_sweep() { |
234 assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode"); | 234 assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode"); |
235 // Only compiler threads are allowed to sweep | 235 // Only compiler threads are allowed to sweep |
236 if (!MethodFlushing || !sweep_in_progress() NOT_GRAAL(|| !Thread::current()->is_Compiler_thread())) { | 236 if (!MethodFlushing || !sweep_in_progress() NOT_GRAAL(|| !Thread::current()->is_Compiler_thread()) GRAAL_ONLY(|| !Thread::current()->is_Java_thread())) { |
237 return; | 237 return; |
238 } | 238 } |
239 | 239 |
240 // If there was no state change while nmethod sweeping, 'should_sweep' will be false. | 240 // If there was no state change while nmethod sweeping, 'should_sweep' will be false. |
241 // This is one of the two places where should_sweep can be set to true. The general | 241 // This is one of the two places where should_sweep can be set to true. The general |