changeset 20007:83539d28f95c

Fixed help text and add CompileTheWorldThreads flag
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 20 Mar 2015 17:26:08 -0700
parents a8d664e10e4f
children b47d7ebcfa4e
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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<String> 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<Boolean> 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<Integer> 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<Runnable>(), factory);
+            int threadCount = Options.CompileTheWorldThreads.getValue();
+            if (threadCount == 0) {
+                threadCount = Runtime.getRuntime().availableProcessors();
+            }
+            threadPool = new ThreadPoolExecutor(threadCount, threadCount, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), factory);
         }
 
         try (OverrideScope s = config.apply()) {