# HG changeset patch # User Gilles Duboscq # Date 1433771872 -7200 # Node ID 9c454c650b29ff8c5a2e64a5ca93b66549037188 # Parent d013bb1cbf9fc1d7707f8ff6ae0fa5090ae7026a Work around CTW Graal compiler initlization order issue diff -r d013bb1cbf9f -r 9c454c650b29 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompileTheWorld.java --- 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.