# HG changeset patch # User Christos Kotselidis # Date 1383674534 -3600 # Node ID 343477cb53ff2d432be1f56421fcc206d04d795e # Parent 3affe68ddb50dbc5a9f014d00aafec278a87b45a# Parent 3332295624ecaed9bbeb564d78015228dd787372 Merge diff -r 3affe68ddb50 -r 343477cb53ff graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java --- 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; }