Mercurial > hg > truffle
comparison graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java @ 19232:66c60942c06c
GraalCompiler.emitLowLevel: use LowLevelSuites instead of LowLevelCompilerConfiguration.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 10 Feb 2015 11:09:28 +0100 |
parents | 41af11212ed3 |
children | 9f411d79ffc0 |
comparison
equal
deleted
inserted
replaced
19231:df89224ee04a | 19232:66c60942c06c |
---|---|
48 import com.oracle.graal.debug.*; | 48 import com.oracle.graal.debug.*; |
49 import com.oracle.graal.debug.Debug.Scope; | 49 import com.oracle.graal.debug.Debug.Scope; |
50 import com.oracle.graal.graph.*; | 50 import com.oracle.graal.graph.*; |
51 import com.oracle.graal.java.*; | 51 import com.oracle.graal.java.*; |
52 import com.oracle.graal.lir.asm.*; | 52 import com.oracle.graal.lir.asm.*; |
53 import com.oracle.graal.lir.phases.*; | |
53 import com.oracle.graal.nodeinfo.*; | 54 import com.oracle.graal.nodeinfo.*; |
54 import com.oracle.graal.nodes.*; | 55 import com.oracle.graal.nodes.*; |
55 import com.oracle.graal.nodes.cfg.*; | 56 import com.oracle.graal.nodes.cfg.*; |
56 import com.oracle.graal.nodes.spi.*; | 57 import com.oracle.graal.nodes.spi.*; |
57 import com.oracle.graal.nodes.virtual.*; | 58 import com.oracle.graal.nodes.virtual.*; |
86 public abstract class GraalCompilerTest extends GraalTest { | 87 public abstract class GraalCompilerTest extends GraalTest { |
87 | 88 |
88 private final Providers providers; | 89 private final Providers providers; |
89 private final Backend backend; | 90 private final Backend backend; |
90 private final Suites suites; | 91 private final Suites suites; |
92 private final LowLevelSuites lowLevelSuites; | |
91 | 93 |
92 /** | 94 /** |
93 * Can be overridden by unit tests to verify properties of the graph. | 95 * Can be overridden by unit tests to verify properties of the graph. |
94 * | 96 * |
95 * @param graph the graph at the end of HighTier | 97 * @param graph the graph at the end of HighTier |
161 } | 163 } |
162 }); | 164 }); |
163 return ret; | 165 return ret; |
164 } | 166 } |
165 | 167 |
168 protected LowLevelSuites createLowLevelSuites() { | |
169 LowLevelSuites ret = backend.getSuites().createLowLevelSuites(); | |
170 return ret; | |
171 } | |
172 | |
166 public GraalCompilerTest() { | 173 public GraalCompilerTest() { |
167 this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend(); | 174 this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend(); |
168 this.providers = getBackend().getProviders(); | 175 this.providers = getBackend().getProviders(); |
169 this.suites = createSuites(); | 176 this.suites = createSuites(); |
177 this.lowLevelSuites = createLowLevelSuites(); | |
170 installSubstitutions(); | 178 installSubstitutions(); |
171 } | 179 } |
172 | 180 |
173 /** | 181 /** |
174 * Set up a test for a non-default backend. The test should check (via {@link #getBackend()} ) | 182 * Set up a test for a non-default backend. The test should check (via {@link #getBackend()} ) |
185 // Fall back to the default/host backend | 193 // Fall back to the default/host backend |
186 this.backend = runtime.getHostBackend(); | 194 this.backend = runtime.getHostBackend(); |
187 } | 195 } |
188 this.providers = backend.getProviders(); | 196 this.providers = backend.getProviders(); |
189 this.suites = createSuites(); | 197 this.suites = createSuites(); |
198 this.lowLevelSuites = createLowLevelSuites(); | |
190 installSubstitutions(); | 199 installSubstitutions(); |
191 } | 200 } |
192 | 201 |
193 @BeforeClass | 202 @BeforeClass |
194 public static void initializeDebugging() { | 203 public static void initializeDebugging() { |
352 | 361 |
353 protected Suites getSuites() { | 362 protected Suites getSuites() { |
354 return suites; | 363 return suites; |
355 } | 364 } |
356 | 365 |
366 protected LowLevelSuites getLowLevelSuites() { | |
367 return lowLevelSuites; | |
368 } | |
369 | |
357 protected Providers getProviders() { | 370 protected Providers getProviders() { |
358 return providers; | 371 return providers; |
359 } | 372 } |
360 | 373 |
361 protected SnippetReflectionProvider getSnippetReflection() { | 374 protected SnippetReflectionProvider getSnippetReflection() { |
738 protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph) { | 751 protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph) { |
739 StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner) : graph; | 752 StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner) : graph; |
740 lastCompiledGraph = graphToCompile; | 753 lastCompiledGraph = graphToCompile; |
741 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graphToCompile.method(), false); | 754 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graphToCompile.method(), false); |
742 Request<CompilationResult> request = new Request<>(graphToCompile, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), | 755 Request<CompilationResult> request = new Request<>(graphToCompile, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), |
743 OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); | 756 OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), getLowLevelSuites(), new CompilationResult(), |
757 CompilationResultBuilderFactory.Default); | |
744 return GraalCompiler.compile(request); | 758 return GraalCompiler.compile(request); |
745 } | 759 } |
746 | 760 |
747 protected StructuredGraph lastCompiledGraph; | 761 protected StructuredGraph lastCompiledGraph; |
748 | 762 |