hotspot/src/share/vm/compiler/compileBroker.cpp
changeset 27642 8c9eff693145
parent 27464 37671dcc4d8d
child 27696 c43940b3cf78
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Sat Nov 08 16:00:28 2014 +0300
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Mon Nov 10 19:04:38 2014 +0300
@@ -35,6 +35,7 @@
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/nativeLookup.hpp"
+#include "prims/whitebox.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/compilationPolicy.hpp"
@@ -1963,6 +1964,12 @@
     if (comp == NULL) {
       ci_env.record_method_not_compilable("no compiler", !TieredCompilation);
     } else {
+      if (WhiteBoxAPI && WhiteBox::compilation_locked) {
+        MonitorLockerEx locker(Compilation_lock, Mutex::_no_safepoint_check_flag);
+        while (WhiteBox::compilation_locked) {
+          locker.wait(Mutex::_no_safepoint_check_flag);
+        }
+      }
       comp->compile_method(&ci_env, target, osr_bci);
     }