Mercurial > hg > graal-jvmci-8
changeset 12681:343477cb53ff
Merge
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Tue, 05 Nov 2013 19:02:14 +0100 |
parents | 3affe68ddb50 (current diff) 3332295624ec (diff) |
children | 5dbfb4d5eaba 49fe5a06ac6f |
files | |
diffstat | 1 files changed, 13 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Tue Nov 05 19:00:51 2013 +0100 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Tue Nov 05 19:02:14 2013 +0100 @@ -39,6 +39,8 @@ import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.graal.options.*; +import com.oracle.graal.options.OptionValue.OverrideScope; import com.oracle.graal.phases.*; import com.oracle.graal.phases.PhasePlan.PhasePosition; import com.oracle.graal.phases.tiers.*; @@ -172,7 +174,6 @@ } @Test - @Ignore public void testBoxedBooleanAOT() { StructuredGraph result = compile("getBoxedBoolean", true); @@ -199,19 +200,17 @@ StructuredGraph graph = parse(test); ResolvedJavaMethod method = graph.method(); - boolean originalSetting = AOTCompilation.getValue(); - AOTCompilation.setValue(compileAOT); - PhasePlan phasePlan = new PhasePlan(); - GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(getMetaAccess(), getForeignCalls(), GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); - phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); - CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); - // create suites everytime, as we modify options for the compiler - final Suites suitesLocal = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getSuites().createSuites(); - final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, getProviders(), getBackend(), getCodeCache().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, - new SpeculationLog(), suitesLocal, new CompilationResult()); - addMethod(method, compResult); - - AOTCompilation.setValue(originalSetting); + try (OverrideScope s = OptionValue.override(AOTCompilation, compileAOT)) { + PhasePlan phasePlan = new PhasePlan(); + GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(getMetaAccess(), getForeignCalls(), GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); + phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); + CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); + // create suites everytime, as we modify options for the compiler + final Suites suitesLocal = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getSuites().createSuites(); + final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, getProviders(), getBackend(), getCodeCache().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, + new SpeculationLog(), suitesLocal, new CompilationResult()); + addMethod(method, compResult); + } return graph; }