comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 13353:0e5c4f9fa9a5

enabled non-hosted CompileTheWorld execution with complete bootstrapping and the ability to override compilation options separately for CTW compilations
author Doug Simon <doug.simon@oracle.com>
date Mon, 16 Dec 2013 23:33:40 +0100
parents bb35fc7e0d68
children 1480cfe97462
comparison
equal deleted inserted replaced
13352:cd22c6bb4a35 13353:0e5c4f9fa9a5
45 import com.oracle.graal.nodes.*; 45 import com.oracle.graal.nodes.*;
46 import com.oracle.graal.nodes.spi.*; 46 import com.oracle.graal.nodes.spi.*;
47 import com.oracle.graal.phases.*; 47 import com.oracle.graal.phases.*;
48 import com.oracle.graal.phases.tiers.*; 48 import com.oracle.graal.phases.tiers.*;
49 49
50 public final class CompilationTask implements Runnable { 50 public class CompilationTask implements Runnable {
51 51
52 public static final ThreadLocal<Boolean> withinEnqueue = new ThreadLocal<Boolean>() { 52 public static final ThreadLocal<Boolean> withinEnqueue = new ThreadLocal<Boolean>() {
53 53
54 @Override 54 @Override
55 protected Boolean initialValue() { 55 protected Boolean initialValue() {
75 public static CompilationTask create(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, 75 public static CompilationTask create(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI,
76 int id) { 76 int id) {
77 return new CompilationTask(backend, plan, optimisticOpts, profilingInfo, method, entryBCI, id); 77 return new CompilationTask(backend, plan, optimisticOpts, profilingInfo, method, entryBCI, id);
78 } 78 }
79 79
80 private CompilationTask(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, int id) { 80 protected CompilationTask(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, int id) {
81 assert id >= 0; 81 assert id >= 0;
82 this.backend = backend; 82 this.backend = backend;
83 this.plan = plan; 83 this.plan = plan;
84 this.method = method; 84 this.method = method;
85 this.optimisticOpts = optimisticOpts; 85 this.optimisticOpts = optimisticOpts;
117 * Time spent in compilation. 117 * Time spent in compilation.
118 */ 118 */
119 public static final DebugTimer CompilationTime = Debug.timer("CompilationTime"); 119 public static final DebugTimer CompilationTime = Debug.timer("CompilationTime");
120 120
121 public static final DebugTimer CodeInstallationTime = Debug.timer("CodeInstallation"); 121 public static final DebugTimer CodeInstallationTime = Debug.timer("CodeInstallation");
122
123 protected Suites getSuites(HotSpotProviders providers) {
124 return providers.getSuites().getDefaultSuites();
125 }
122 126
123 public void runCompilation() { 127 public void runCompilation() {
124 /* 128 /*
125 * no code must be outside this try/finally because it could happen otherwise that 129 * no code must be outside this try/finally because it could happen otherwise that
126 * clearQueuedForCompilation() is not executed 130 * clearQueuedForCompilation() is not executed
162 // Compiling method substitution - must clone the graph 166 // Compiling method substitution - must clone the graph
163 graph = graph.copy(); 167 graph = graph.copy();
164 } 168 }
165 InlinedBytecodes.add(method.getCodeSize()); 169 InlinedBytecodes.add(method.getCodeSize());
166 CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false); 170 CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false);
167 Suites suites = providers.getSuites().getDefaultSuites(); 171 Suites suites = getSuites(providers);
168 result = compileGraph(graph, cc, method, providers, backend, backend.getTarget(), graphCache, plan, optimisticOpts, profilingInfo, method.getSpeculationLog(), suites, true, 172 result = compileGraph(graph, cc, method, providers, backend, backend.getTarget(), graphCache, plan, optimisticOpts, profilingInfo, method.getSpeculationLog(), suites, true,
169 new CompilationResult(), CompilationResultBuilderFactory.Default); 173 new CompilationResult(), CompilationResultBuilderFactory.Default);
170 174
171 } catch (Throwable e) { 175 } catch (Throwable e) {
172 throw Debug.handle(e); 176 throw Debug.handle(e);