src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java	Mon Mar 20 17:40:16 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java	Mon Mar 20 17:40:16 2017

*** 71,81 **** --- 71,81 ---- import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult; import org.graalvm.compiler.nodes.cfg.Block; import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; import org.graalvm.compiler.nodes.spi.LoweringProvider; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; ! import org.graalvm.compiler.options.DerivedOptionValue; ! import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.phases.OptimisticOptimizations; import org.graalvm.compiler.phases.PhaseSuite; import org.graalvm.compiler.phases.tiers.HighTierContext; import org.graalvm.compiler.phases.tiers.Suites; import org.graalvm.compiler.phases.tiers.TargetProvider;
*** 103,132 **** --- 103,130 ---- private StructuredGraph originalGraph; /** * The graph processed by the benchmark. */ + private final OptionValues options; private StructuredGraph graph; private final Backend backend; private final Providers providers; private final DerivedOptionValue<Suites> suites; private final DerivedOptionValue<LIRSuites> lirSuites; /** * We only allow inner classes to subclass this to ensure that the {@link Setup} methods are * executed in the right order. */ @SuppressWarnings("try") protected GraalCompilerState() { + this.options = Graal.getRequiredCapability(OptionValues.class); this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend(); this.providers = backend.getProviders(); this.suites = new DerivedOptionValue<>(this::createSuites); this.lirSuites = new DerivedOptionValue<>(this::createLIRSuites); // Ensure a debug configuration for this thread is initialized if (Debug.isEnabled() && DebugScope.getConfig() == null) { ! DebugEnvironment.initialize(System.out); ! DebugEnvironment.ensureInitialized(options); } } protected boolean useProfilingInfo() {
*** 247,277 **** --- 245,267 ---- protected StructuredGraph preprocessOriginal(StructuredGraph structuredGraph) { return structuredGraph; } protected Suites createSuites() { ! Suites ret = backend.getSuites().getDefaultSuites(options).copy(); return ret; } protected LIRSuites createLIRSuites() { ! LIRSuites ret = backend.getSuites().getDefaultLIRSuites(options).copy(); return ret; } protected Backend getBackend() { return backend; } protected Suites getSuites() { return suites.getValue(); } protected LIRSuites getOriginalLIRSuites() { return lirSuites.getValue(); } protected Providers getProviders() { return providers; } protected SnippetReflectionProvider getSnippetReflection() {
*** 321,341 **** --- 311,331 ---- private AbstractBlockBase<?>[] linearScanOrder; /** * Copies the {@link #originalGraph original graph} and prepares the {@link #request}. * ! * The {@link Suites} can be changed by overriding {@link #createSuites()}. {@link LIRSuites} ! * can be changed by overriding {@link #createLIRSuites()}. ! * The {@link Suites} can be changed by overriding {@link #createSuites}. {@link LIRSuites} can ! * be changed by overriding {@link #createLIRSuites}. */ protected final void prepareRequest() { assert originalGraph != null : "call initialzeMethod first"; CompilationIdentifier compilationId = backend.getCompilationIdentifier(originalGraph.method()); graph = originalGraph.copyWithIdentifier(compilationId); assert !graph.isFrozen(); ResolvedJavaMethod installedCodeOwner = graph.method(); request = new Request<>(graph, installedCodeOwner, getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, ! graph.getProfilingInfo(), getSuites(), getOriginalLIRSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); ! graph.getProfilingInfo(), createSuites(), createLIRSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); } /** * Executes the high-level (FrontEnd) part of the compiler. */
*** 382,392 **** --- 372,382 ---- assert startBlock.getPredecessorCount() == 0; codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blocks.length, startBlock); linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blocks.length, startBlock); ! LIR lir = new LIR(cfg, linearScanOrder, codeEmittingOrder, graph.getOptions()); FrameMapBuilder frameMapBuilder = request.backend.newFrameMapBuilder(registerConfig); lirGenRes = request.backend.newLIRGenerationResult(graph.compilationId(), lir, frameMapBuilder, request.graph, stub); lirGenTool = request.backend.newLIRGenerator(lirGenRes); nodeLirGen = request.backend.newNodeLIRBuilder(request.graph, lirGenTool); }
*** 420,430 **** --- 410,420 ---- } /** * Executes the {@link PreAllocationStage}. * - * {@link LIRPhase phases} can be changed by overriding {@link #createLIRSuites()}. */ protected final void preAllocationStage() { applyLIRPhase(getLIRSuites().getPreAllocationOptimizationStage(), createPreAllocationOptimizationContext()); }
*** 433,456 **** --- 423,446 ---- } /** * Executes the {@link AllocationStage}. * - * {@link LIRPhase phases} can be changed by overriding {@link #createLIRSuites()}. */ protected final void allocationStage() { applyLIRPhase(getLIRSuites().getAllocationStage(), createAllocationContext()); } protected AllocationContext createAllocationContext() { ! return new AllocationContext(lirGenTool.getSpillMoveFactory(), request.backend.newRegisterAllocationConfig(registerConfig, null)); } /** * Executes the {@link PostAllocationStage}. * - * {@link LIRPhase phases} can be changed by overriding {@link #createLIRSuites()}. */ protected final void postAllocationStage() { applyLIRPhase(getLIRSuites().getPostAllocationOptimizationStage(), createPostAllocationOptimizationContext()); }

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File