Mercurial > hg > truffle
comparison graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/MethodSubstitutionTest.java @ 11959:23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 10 Oct 2013 16:14:55 +0200 |
parents | c69df2e602f4 |
children | 0fc653a9e019 |
comparison
equal
deleted
inserted
replaced
11958:a0f5be106e67 | 11959:23ccaa863eda |
---|---|
42 * substituted is a native method. For Java methods, additional checks are necessary. | 42 * substituted is a native method. For Java methods, additional checks are necessary. |
43 */ | 43 */ |
44 public abstract class MethodSubstitutionTest extends GraalCompilerTest { | 44 public abstract class MethodSubstitutionTest extends GraalCompilerTest { |
45 | 45 |
46 protected StructuredGraph test(final String snippet) { | 46 protected StructuredGraph test(final String snippet) { |
47 return Debug.scope("MethodSubstitutionTest", runtime.lookupJavaMethod(getMethod(snippet)), new Callable<StructuredGraph>() { | 47 return Debug.scope("MethodSubstitutionTest", getMetaAccess().lookupJavaMethod(getMethod(snippet)), new Callable<StructuredGraph>() { |
48 | 48 |
49 @Override | 49 @Override |
50 public StructuredGraph call() { | 50 public StructuredGraph call() { |
51 StructuredGraph graph = parse(snippet); | 51 StructuredGraph graph = parse(snippet); |
52 PhasePlan phasePlan = getDefaultPhasePlan(); | 52 PhasePlan phasePlan = getDefaultPhasePlan(); |
53 Assumptions assumptions = new Assumptions(true); | 53 Assumptions assumptions = new Assumptions(true); |
54 HighTierContext context = new HighTierContext(runtime(), assumptions, replacements, null, phasePlan, OptimisticOptimizations.ALL); | 54 HighTierContext context = new HighTierContext(getMetaAccess(), getCodeCache(), assumptions, replacements, null, phasePlan, OptimisticOptimizations.ALL); |
55 Debug.dump(graph, "Graph"); | 55 Debug.dump(graph, "Graph"); |
56 new InliningPhase(new CanonicalizerPhase(true)).apply(graph, context); | 56 new InliningPhase(new CanonicalizerPhase(true)).apply(graph, context); |
57 Debug.dump(graph, "Graph"); | 57 Debug.dump(graph, "Graph"); |
58 new CanonicalizerPhase(true).apply(graph, context); | 58 new CanonicalizerPhase(true).apply(graph, context); |
59 new DeadCodeEliminationPhase().apply(graph); | 59 new DeadCodeEliminationPhase().apply(graph); |