Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompileTheWorld.java @ 21782:9c454c650b29
Work around CTW Graal compiler initlization order issue
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 08 Jun 2015 15:57:52 +0200 |
parents | 3d15183f3c93 |
children | 5b9adb645217 |
line wrap: on
line diff
--- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompileTheWorld.java Mon Jun 08 15:01:17 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompileTheWorld.java Mon Jun 08 15:57:52 2015 +0200 @@ -247,6 +247,10 @@ } } + @SuppressWarnings("unused") + private static void dummy() { + } + /** * Compiles all methods in all classes in the Zip/Jar files passed. * @@ -266,6 +270,16 @@ } }); + try { + // compile dummy method to get compiler initilized outside of the config debug override. + HotSpotResolvedJavaMethod dummyMethod = (HotSpotResolvedJavaMethod) JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod( + CompileTheWorld.class.getDeclaredMethod("dummy")); + CompilationTask task = new CompilationTask(dummyMethod, Compiler.INVOCATION_ENTRY_BCI, 0L, dummyMethod.allocateCompileId(Compiler.INVOCATION_ENTRY_BCI), false); + task.runCompilation(); + } catch (NoSuchMethodException | SecurityException e1) { + e1.printStackTrace(); + } + /* * Always use a thread pool, even for single threaded mode since it simplifies the use of * DebugValueThreadFilter to filter on the thread names.