Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 13239:bb35fc7e0d68
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 03 Dec 2013 18:40:03 +0100 |
parents | 8ea51438445c 210f58e992a1 |
children | 0e5c4f9fa9a5 |
comparison
equal
deleted
inserted
replaced
13238:b429ec5c46d6 | 13239:bb35fc7e0d68 |
---|---|
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.graal.hotspot; | 23 package com.oracle.graal.hotspot; |
24 | 24 |
25 import static com.oracle.graal.api.code.CodeUtil.*; | 25 import static com.oracle.graal.api.code.CodeUtil.*; |
26 import static com.oracle.graal.compiler.GraalCompiler.*; | |
26 import static com.oracle.graal.nodes.StructuredGraph.*; | 27 import static com.oracle.graal.nodes.StructuredGraph.*; |
27 import static com.oracle.graal.phases.GraalOptions.*; | 28 import static com.oracle.graal.phases.GraalOptions.*; |
28 import static com.oracle.graal.phases.common.InliningUtil.*; | 29 import static com.oracle.graal.phases.common.InliningUtil.*; |
29 | 30 |
30 import java.lang.reflect.*; | 31 import java.lang.reflect.*; |
33 | 34 |
34 import com.oracle.graal.api.code.*; | 35 import com.oracle.graal.api.code.*; |
35 import com.oracle.graal.api.code.CallingConvention.Type; | 36 import com.oracle.graal.api.code.CallingConvention.Type; |
36 import com.oracle.graal.api.meta.*; | 37 import com.oracle.graal.api.meta.*; |
37 import com.oracle.graal.compiler.CompilerThreadFactory.CompilerThread; | 38 import com.oracle.graal.compiler.CompilerThreadFactory.CompilerThread; |
38 import com.oracle.graal.compiler.*; | |
39 import com.oracle.graal.debug.*; | 39 import com.oracle.graal.debug.*; |
40 import com.oracle.graal.debug.Debug.Scope; | 40 import com.oracle.graal.debug.Debug.Scope; |
41 import com.oracle.graal.debug.internal.*; | 41 import com.oracle.graal.debug.internal.*; |
42 import com.oracle.graal.hotspot.bridge.*; | 42 import com.oracle.graal.hotspot.bridge.*; |
43 import com.oracle.graal.hotspot.meta.*; | 43 import com.oracle.graal.hotspot.meta.*; |
62 } | 62 } |
63 | 63 |
64 private final HotSpotBackend backend; | 64 private final HotSpotBackend backend; |
65 private final PhasePlan plan; | 65 private final PhasePlan plan; |
66 private final OptimisticOptimizations optimisticOpts; | 66 private final OptimisticOptimizations optimisticOpts; |
67 private final ProfilingInfo profilingInfo; | |
67 private final HotSpotResolvedJavaMethod method; | 68 private final HotSpotResolvedJavaMethod method; |
68 private final int entryBCI; | 69 private final int entryBCI; |
69 private final int id; | 70 private final int id; |
70 private final AtomicReference<CompilationStatus> status; | 71 private final AtomicReference<CompilationStatus> status; |
71 | 72 |
72 private StructuredGraph graph; | 73 private StructuredGraph graph; |
73 | 74 |
74 public static CompilationTask create(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int entryBCI, int id) { | 75 public static CompilationTask create(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, |
75 return new CompilationTask(backend, plan, optimisticOpts, method, entryBCI, id); | 76 int id) { |
76 } | 77 return new CompilationTask(backend, plan, optimisticOpts, profilingInfo, method, entryBCI, id); |
77 | 78 } |
78 private CompilationTask(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int entryBCI, int id) { | 79 |
80 private CompilationTask(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, int id) { | |
79 assert id >= 0; | 81 assert id >= 0; |
80 this.backend = backend; | 82 this.backend = backend; |
81 this.plan = plan; | 83 this.plan = plan; |
82 this.method = method; | 84 this.method = method; |
83 this.optimisticOpts = optimisticOpts; | 85 this.optimisticOpts = optimisticOpts; |
86 this.profilingInfo = profilingInfo; | |
84 this.entryBCI = entryBCI; | 87 this.entryBCI = entryBCI; |
85 this.id = id; | 88 this.id = id; |
86 this.status = new AtomicReference<>(CompilationStatus.Queued); | 89 this.status = new AtomicReference<>(CompilationStatus.Queued); |
87 } | 90 } |
88 | 91 |
160 graph = graph.copy(); | 163 graph = graph.copy(); |
161 } | 164 } |
162 InlinedBytecodes.add(method.getCodeSize()); | 165 InlinedBytecodes.add(method.getCodeSize()); |
163 CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false); | 166 CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false); |
164 Suites suites = providers.getSuites().getDefaultSuites(); | 167 Suites suites = providers.getSuites().getDefaultSuites(); |
165 result = GraalCompiler.compileGraph(graph, cc, method, providers, backend, backend.getTarget(), graphCache, plan, optimisticOpts, method.getSpeculationLog(), suites, true, | 168 result = compileGraph(graph, cc, method, providers, backend, backend.getTarget(), graphCache, plan, optimisticOpts, profilingInfo, method.getSpeculationLog(), suites, true, |
166 new CompilationResult(), CompilationResultBuilderFactory.Default); | 169 new CompilationResult(), CompilationResultBuilderFactory.Default); |
167 | 170 |
168 } catch (Throwable e) { | 171 } catch (Throwable e) { |
169 throw Debug.handle(e); | 172 throw Debug.handle(e); |
170 } finally { | 173 } finally { |