compiler/calls intermittently fail when running with Graal as JIT.
All failures pretty much the same and look like "Unexpected caller compilation level: expected 4 to equal 0".
I did modify CallsBase:compileMethod by adding check wb.isMethodCompiled(method)
protected final void compileMethod(Method method, int compLevel) {
wb.deoptimizeMethod(method);
Asserts.assertTrue(wb.isMethodCompilable(method, compLevel));
wb.enqueueMethodForCompilation(method, compLevel);
boolean waited = false;
long startTime = System.currentTimeMillis();
while (! wb.isMethodCompiled(method)) {
try { Thread.sleep(10); } catch (Exception e) {}
waited = true;
}
if (waited)
System.out.println("Waited for method being compiled " + (System.currentTimeMillis() - startTime) + " ms");
}
and I see that from run to run we can wait up to 100 ms for method being compiled.
I also verified that wb.enqueueMethodForCompilation returns true.
So it looks like the Graal compilation is not blocking although we run with -Xbatch.