Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java @ 23347:f868bd0c3f02
Make CallingConvention in HotSpotHostBackend instead of passing it in as a parameter to GraalCompiler.compile
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 21 Jan 2016 10:35:29 -0800 |
parents | 52f4acf6f365 |
children |
comparison
equal
deleted
inserted
replaced
23346:59be481d0b4c | 23347:f868bd0c3f02 |
---|---|
23 package com.oracle.graal.hotspot.test; | 23 package com.oracle.graal.hotspot.test; |
24 | 24 |
25 import static com.oracle.graal.compiler.GraalCompiler.compileGraph; | 25 import static com.oracle.graal.compiler.GraalCompiler.compileGraph; |
26 import static com.oracle.graal.compiler.common.GraalOptions.ImmutableCode; | 26 import static com.oracle.graal.compiler.common.GraalOptions.ImmutableCode; |
27 import static com.oracle.graal.nodes.ConstantNode.getConstantNodes; | 27 import static com.oracle.graal.nodes.ConstantNode.getConstantNodes; |
28 import static jdk.vm.ci.code.CodeUtil.getCallingConvention; | |
29 import jdk.vm.ci.code.CallingConvention; | |
30 import jdk.vm.ci.code.CallingConvention.Type; | |
31 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; | 28 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; |
32 import jdk.vm.ci.meta.JavaConstant; | 29 import jdk.vm.ci.meta.JavaConstant; |
33 import jdk.vm.ci.meta.JavaKind; | 30 import jdk.vm.ci.meta.JavaKind; |
34 import jdk.vm.ci.meta.ResolvedJavaMethod; | 31 import jdk.vm.ci.meta.ResolvedJavaMethod; |
35 | 32 |
213 @SuppressWarnings("try") | 210 @SuppressWarnings("try") |
214 private StructuredGraph compile(String test, boolean compileAOT) { | 211 private StructuredGraph compile(String test, boolean compileAOT) { |
215 try (OverrideScope s = OptionValue.override(ImmutableCode, compileAOT)) { | 212 try (OverrideScope s = OptionValue.override(ImmutableCode, compileAOT)) { |
216 StructuredGraph graph = parseEager(test, AllowAssumptions.YES); | 213 StructuredGraph graph = parseEager(test, AllowAssumptions.YES); |
217 ResolvedJavaMethod method = graph.method(); | 214 ResolvedJavaMethod method = graph.method(); |
218 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); | |
219 // create suites everytime, as we modify options for the compiler | 215 // create suites everytime, as we modify options for the compiler |
220 SuitesProvider suitesProvider = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getSuites(); | 216 SuitesProvider suitesProvider = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getSuites(); |
221 final Suites suitesLocal = suitesProvider.getDefaultSuites(); | 217 final Suites suitesLocal = suitesProvider.getDefaultSuites(); |
222 final LIRSuites lirSuitesLocal = suitesProvider.getDefaultLIRSuites(); | 218 final LIRSuites lirSuitesLocal = suitesProvider.getDefaultLIRSuites(); |
223 final CompilationResult compResult = compileGraph(graph, cc, method, getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, graph.getProfilingInfo(), | 219 final CompilationResult compResult = compileGraph(graph, method, getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, graph.getProfilingInfo(), |
224 suitesLocal, lirSuitesLocal, new CompilationResult(), CompilationResultBuilderFactory.Default); | 220 suitesLocal, lirSuitesLocal, new CompilationResult(), CompilationResultBuilderFactory.Default); |
225 addMethod(method, compResult); | 221 addMethod(method, compResult); |
226 return graph; | 222 return graph; |
227 } | 223 } |
228 } | 224 } |