RFR: bootstrap might exit early in debug JVM

Christian Thalinger christian.thalinger at oracle.com
Wed Mar 4 23:53:33 UTC 2015


Sometimes a debug JVM is too slow to schedule compilations in time during a bootstrap and the result is an early exit:

Bootstrapping Graal in 1000 ms (compiled 0 methods)

Here is a fix that waits until there are some methods in the queue the first time:

diff --git a/src/share/vm/graal/graalCompiler.cpp b/src/share/vm/graal/graalCompiler.cpp
--- a/src/share/vm/graal/graalCompiler.cpp
+++ b/src/share/vm/graal/graalCompiler.cpp
@@ -85,12 +85,15 @@
   }
 
   int qsize;
-  jlong sleep_time = 1000;
+  bool first_round = true;
   int z = 0;
   do {
-    os::sleep(THREAD, sleep_time, true);
-    sleep_time = 100;
-    qsize = CompileBroker::queue_size(CompLevel_full_optimization);
+    // Loop until there is something in the queue.
+    do {
+      os::sleep(THREAD, 100, true);
+      qsize = CompileBroker::queue_size(CompLevel_full_optimization);
+    } while (first_round && qsize == 0);
+    first_round = false;
     if (PrintBootstrap) {
       while (z < (_methodsCompiled / 100)) {
         ++z;



More information about the graal-dev mailing list