hotspot/src/share/vm/compiler/compileBroker.cpp
changeset 20688 663a6dd0bcbf
parent 20290 2127dc70bce9
child 20707 b3b658c6d1f8
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Oct 02 06:17:10 2013 -0700
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Oct 04 09:19:13 2013 +0200
@@ -1953,6 +1953,10 @@
       // Since code cache is full, immediately stop new compiles
       if (CompileBroker::set_should_compile_new_jobs(CompileBroker::stop_compilation)) {
         NMethodSweeper::log_sweep("disable_compiler");
+
+        // Switch to 'vm_state'. This ensures that possibly_sweep() can be called
+        // without having to consider the state in which the current thread is.
+        ThreadInVMfromUnknown in_vm;
         NMethodSweeper::possibly_sweep();
       }
     } else {