comparison 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
comparison
equal deleted inserted replaced
21781:d013bb1cbf9f 21782:9c454c650b29
245 if (verbose) { 245 if (verbose) {
246 TTY.println(s); 246 TTY.println(s);
247 } 247 }
248 } 248 }
249 249
250 @SuppressWarnings("unused")
251 private static void dummy() {
252 }
253
250 /** 254 /**
251 * Compiles all methods in all classes in the Zip/Jar files passed. 255 * Compiles all methods in all classes in the Zip/Jar files passed.
252 * 256 *
253 * @param fileList {@link File#pathSeparator} separated list of Zip/Jar files to compile 257 * @param fileList {@link File#pathSeparator} separated list of Zip/Jar files to compile
254 * @throws IOException 258 * @throws IOException
263 return DebugEnvironment.initialize(System.out); 267 return DebugEnvironment.initialize(System.out);
264 } 268 }
265 return null; 269 return null;
266 } 270 }
267 }); 271 });
272
273 try {
274 // compile dummy method to get compiler initilized outside of the config debug override.
275 HotSpotResolvedJavaMethod dummyMethod = (HotSpotResolvedJavaMethod) JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod(
276 CompileTheWorld.class.getDeclaredMethod("dummy"));
277 CompilationTask task = new CompilationTask(dummyMethod, Compiler.INVOCATION_ENTRY_BCI, 0L, dummyMethod.allocateCompileId(Compiler.INVOCATION_ENTRY_BCI), false);
278 task.runCompilation();
279 } catch (NoSuchMethodException | SecurityException e1) {
280 e1.printStackTrace();
281 }
268 282
269 /* 283 /*
270 * Always use a thread pool, even for single threaded mode since it simplifies the use of 284 * Always use a thread pool, even for single threaded mode since it simplifies the use of
271 * DebugValueThreadFilter to filter on the thread names. 285 * DebugValueThreadFilter to filter on the thread names.
272 */ 286 */