comparison graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java @ 19235:9f411d79ffc0

Merge (LowLevelSuites).
author Josef Eisl <josef.eisl@jku.at>
date Tue, 10 Feb 2015 14:43:12 +0100
parents 66c60942c06c fb1ee63d5b7b
children ba6ce79ad299
comparison
equal deleted inserted replaced
19234:e9e99e6f2c6b 19235:9f411d79ffc0
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.*;
87 public abstract class GraalCompilerTest extends GraalTest { 88 public abstract class GraalCompilerTest extends GraalTest {
88 89
89 private final Providers providers; 90 private final Providers providers;
90 private final Backend backend; 91 private final Backend backend;
91 private final DerivedOptionValue<Suites> suites; 92 private final DerivedOptionValue<Suites> suites;
93 private final LowLevelSuites lowLevelSuites;
92 94
93 /** 95 /**
94 * Can be overridden by unit tests to verify properties of the graph. 96 * Can be overridden by unit tests to verify properties of the graph.
95 * 97 *
96 * @param graph the graph at the end of HighTier 98 * @param graph the graph at the end of HighTier
162 } 164 }
163 }); 165 });
164 return ret; 166 return ret;
165 } 167 }
166 168
169 protected LowLevelSuites createLowLevelSuites() {
170 LowLevelSuites ret = backend.getSuites().createLowLevelSuites();
171 return ret;
172 }
173
167 public GraalCompilerTest() { 174 public GraalCompilerTest() {
168 this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend(); 175 this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend();
169 this.providers = getBackend().getProviders(); 176 this.providers = getBackend().getProviders();
170 this.suites = new DerivedOptionValue<>(this::createSuites); 177 this.suites = new DerivedOptionValue<>(this::createSuites);
178 this.lowLevelSuites = createLowLevelSuites();
171 installSubstitutions(); 179 installSubstitutions();
172 } 180 }
173 181
174 /** 182 /**
175 * Set up a test for a non-default backend. The test should check (via {@link #getBackend()} ) 183 * Set up a test for a non-default backend. The test should check (via {@link #getBackend()} )
186 // Fall back to the default/host backend 194 // Fall back to the default/host backend
187 this.backend = runtime.getHostBackend(); 195 this.backend = runtime.getHostBackend();
188 } 196 }
189 this.providers = backend.getProviders(); 197 this.providers = backend.getProviders();
190 this.suites = new DerivedOptionValue<>(this::createSuites); 198 this.suites = new DerivedOptionValue<>(this::createSuites);
199 this.lowLevelSuites = createLowLevelSuites();
191 installSubstitutions(); 200 installSubstitutions();
192 } 201 }
193 202
194 @BeforeClass 203 @BeforeClass
195 public static void initializeDebugging() { 204 public static void initializeDebugging() {
353 362
354 protected Suites getSuites() { 363 protected Suites getSuites() {
355 return suites.getValue(); 364 return suites.getValue();
356 } 365 }
357 366
367 protected LowLevelSuites getLowLevelSuites() {
368 return lowLevelSuites;
369 }
370
358 protected Providers getProviders() { 371 protected Providers getProviders() {
359 return providers; 372 return providers;
360 } 373 }
361 374
362 protected SnippetReflectionProvider getSnippetReflection() { 375 protected SnippetReflectionProvider getSnippetReflection() {
739 protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph) { 752 protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph) {
740 StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner) : graph; 753 StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner) : graph;
741 lastCompiledGraph = graphToCompile; 754 lastCompiledGraph = graphToCompile;
742 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graphToCompile.method(), false); 755 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graphToCompile.method(), false);
743 Request<CompilationResult> request = new Request<>(graphToCompile, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), 756 Request<CompilationResult> request = new Request<>(graphToCompile, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(),
744 OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); 757 OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), getLowLevelSuites(), new CompilationResult(),
758 CompilationResultBuilderFactory.Default);
745 return GraalCompiler.compile(request); 759 return GraalCompiler.compile(request);
746 } 760 }
747 761
748 protected StructuredGraph lastCompiledGraph; 762 protected StructuredGraph lastCompiledGraph;
749 763