# HG changeset patch # User Tom Rodriguez # Date 1426897568 25200 # Node ID 83539d28f95c89a70d4a8a961ba4ba6437d645e4 # Parent a8d664e10e4f786d242011a6dbd9fa1f89292fc7 Fixed help text and add CompileTheWorldThreads flag diff -r a8d664e10e4f -r 83539d28f95c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Fri Mar 20 23:19:24 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Fri Mar 20 17:26:08 2015 -0700 @@ -75,8 +75,10 @@ "The format for each option is the same as on the command line just without the '-G:' prefix.", type = OptionType.Debug) public static final OptionValue CompileTheWorldConfig = new OptionValue<>(null); - @Option(help = "Last class to consider when using -XX:+CompileTheWorld", type = OptionType.Debug) + @Option(help = "Run CTW using as many threads as there are processors on the system", type = OptionType.Debug) public static final OptionValue CompileTheWorldMultiThreaded = new OptionValue<>(false); + @Option(help = "Number of threads to use for multithreaded CTW. Defaults to Runtime.getRuntime().availableProcessors()", type = OptionType.Debug) + public static final OptionValue CompileTheWorldThreads = new OptionValue<>(0); // @formatter:on /** @@ -240,8 +242,11 @@ return DebugEnvironment.initialize(System.out); } }); - int availableProcessors = Runtime.getRuntime().availableProcessors(); - threadPool = new ThreadPoolExecutor(availableProcessors, availableProcessors, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), factory); + int threadCount = Options.CompileTheWorldThreads.getValue(); + if (threadCount == 0) { + threadCount = Runtime.getRuntime().availableProcessors(); + } + threadPool = new ThreadPoolExecutor(threadCount, threadCount, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), factory); } try (OverrideScope s = config.apply()) {