comparison graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java @ 9966:4158612eca60

GraalOptions: use static import
author Bernhard Urban <bernhard.urban@jku.at>
date Mon, 10 Jun 2013 15:41:23 +0200
parents ab90954e5fec
children 3df534c97af1
comparison
equal deleted inserted replaced
9965:6c13b749d3f9 9966:4158612eca60
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.hotspot.test; 23 package com.oracle.graal.hotspot.test;
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.phases.GraalOptions.*;
26 27
27 import org.junit.*; 28 import org.junit.*;
28 29
29 import com.oracle.graal.api.code.*; 30 import com.oracle.graal.api.code.*;
30 import com.oracle.graal.api.code.CallingConvention.Type; 31 import com.oracle.graal.api.code.CallingConvention.Type;
72 73
73 private StructuredGraph compile(String test, boolean compileAOT) { 74 private StructuredGraph compile(String test, boolean compileAOT) {
74 StructuredGraph graph = parse(test); 75 StructuredGraph graph = parse(test);
75 ResolvedJavaMethod method = graph.method(); 76 ResolvedJavaMethod method = graph.method();
76 77
77 boolean originalSetting = GraalOptions.OptCanonicalizeReads.getValue(); 78 boolean originalSetting = OptCanonicalizeReads.getValue();
78 GraalOptions.OptCanonicalizeReads.setValue(!compileAOT); 79 OptCanonicalizeReads.setValue(!compileAOT);
79 PhasePlan phasePlan = new PhasePlan(); 80 PhasePlan phasePlan = new PhasePlan();
80 final StructuredGraph graphCopy = graph.copy(); 81 final StructuredGraph graphCopy = graph.copy();
81 GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); 82 GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL);
82 phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); 83 phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
83 phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase()); 84 phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase());
85 CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); 86 CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false);
86 final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, 87 final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL,
87 new SpeculationLog()); 88 new SpeculationLog());
88 addMethod(method, compResult, graphCopy); 89 addMethod(method, compResult, graphCopy);
89 90
90 GraalOptions.OptCanonicalizeReads.setValue(originalSetting); 91 OptCanonicalizeReads.setValue(originalSetting);
91 92
92 return graph; 93 return graph;
93 } 94 }
94 } 95 }