RFR: bootstrap might exit early in debug JVM

Doug Simon doug.simon at oracle.com
Thu Mar 5 09:32:00 UTC 2015


Looks good to me. However, getting it integrated may take a while given the current gate instability.

> On Mar 5, 2015, at 12:53 AM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
> 
> 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