# HG changeset patch # User Tom Rodriguez # Date 1427131637 25200 # Node ID 3819bcdde8981da69bdda6042be51d4ebfb6936a # Parent 426e45c7577199b55ce2919f0fd1f3bb012018a5# Parent 220c494e50885d4dcb8250a2720b91ff6e470252 Merge diff -r 220c494e5088 -r 3819bcdde898 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Assumptions.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Assumptions.java Mon Mar 23 16:11:48 2015 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Assumptions.java Mon Mar 23 10:27:17 2015 -0700 @@ -57,7 +57,7 @@ public AssumptionResult(T result, Assumption... assumptions) { this.result = result; - this.assumptions = assumptions.clone(); + this.assumptions = assumptions; } public AssumptionResult(T result) { diff -r 220c494e5088 -r 3819bcdde898 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 Mon Mar 23 16:11:48 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Mon Mar 23 10:27:17 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()) { diff -r 220c494e5088 -r 3819bcdde898 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectTypeImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectTypeImpl.java Mon Mar 23 16:11:48 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectTypeImpl.java Mon Mar 23 10:27:17 2015 -0700 @@ -160,8 +160,9 @@ if (leafConcreteSubtype != null) { assert !leafConcreteSubtype.getResult().equals(implementor); AssumptionResult newResult = new AssumptionResult<>(leafConcreteSubtype.getResult(), new ConcreteSubtype(this, implementor)); + // Accumulate leaf assumptions and return the combined result. newResult.add(leafConcreteSubtype); - return leafConcreteSubtype; + return newResult; } return null; }