src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.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.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java	Mon Mar 20 17:38:43 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java	Mon Mar 20 17:38:43 2017

*** 20,40 **** --- 20,39 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; import static org.graalvm.compiler.core.common.GraalOptions.VerifyPhases; import java.util.ListIterator; + import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.HotSpotBackend; import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; import org.graalvm.compiler.hotspot.HotSpotInstructionProfiling; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.phases.AheadOfTimeVerificationPhase; import org.graalvm.compiler.hotspot.phases.LoadJavaMirrorWithKlassPhase; import org.graalvm.compiler.hotspot.phases.WriteBarrierAdditionPhase; import org.graalvm.compiler.hotspot.phases.WriteBarrierVerificationPhase; import org.graalvm.compiler.hotspot.phases.aot.AOTInliningPolicy;
*** 48,67 **** --- 47,69 ---- import org.graalvm.compiler.nodes.GraphEncoder; import org.graalvm.compiler.nodes.SimplifyingGraphDecoder; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; + import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.phases.BasePhase; import org.graalvm.compiler.phases.PhaseSuite; import org.graalvm.compiler.phases.common.AddressLoweringPhase; import org.graalvm.compiler.phases.common.AddressLoweringPhase.AddressLowering; import org.graalvm.compiler.phases.common.CanonicalizerPhase; import org.graalvm.compiler.phases.common.ExpandLogicPhase; + import org.graalvm.compiler.phases.common.FixReadsPhase; import org.graalvm.compiler.phases.common.LoopSafepointInsertionPhase; import org.graalvm.compiler.phases.common.LoweringPhase; import org.graalvm.compiler.phases.common.inlining.InliningPhase; import org.graalvm.compiler.phases.tiers.HighTierContext; + import org.graalvm.compiler.phases.tiers.LowTierContext; import org.graalvm.compiler.phases.tiers.Suites; import org.graalvm.compiler.phases.tiers.SuitesCreator; /** * HotSpot implementation of {@link SuitesCreator}.
*** 81,106 **** --- 83,108 ---- this.addressLowering = addressLowering; this.defaultGraphBuilderSuite = createGraphBuilderSuite(); } @Override ! public Suites createSuites(OptionValues options) { ! Suites ret = defaultSuitesCreator.createSuites(options); ! if (ImmutableCode.getValue(options)) { // lowering introduces class constants, therefore it must be after lowering ret.getHighTier().appendPhase(new LoadJavaMirrorWithKlassPhase(config.classMirrorOffset, config.useCompressedOops ? config.getOopEncoding() : null)); ! if (VerifyPhases.getValue(options)) { ret.getHighTier().appendPhase(new AheadOfTimeVerificationPhase()); } ! if (GeneratePIC.getValue(options)) { // EliminateRedundantInitializationPhase must happen before the first lowering. ListIterator<BasePhase<? super HighTierContext>> highTierLowering = ret.getHighTier().findPhase(LoweringPhase.class); highTierLowering.previous(); highTierLowering.add(new EliminateRedundantInitializationPhase()); ! if (HotSpotAOTProfilingPlugin.Options.TieredAOT.getValue(options)) { ! highTierLowering.add(new FinalizeProfileNodesPhase(HotSpotAOTProfilingPlugin.Options.TierAInvokeInlineeNotifyFreqLog.getValue(options))); } ret.getMidTier().findPhase(LoopSafepointInsertionPhase.class).add(new ReplaceConstantNodesPhase()); // Replace inlining policy ListIterator<BasePhase<? super HighTierContext>> iter = ret.getHighTier().findPhase(InliningPhase.class);
*** 109,123 **** --- 111,129 ---- iter.set(new InliningPhase(new AOTInliningPolicy(null), canonicalizer)); } } ret.getMidTier().appendPhase(new WriteBarrierAdditionPhase(config)); ! if (VerifyPhases.getValue(options)) { ret.getMidTier().appendPhase(new WriteBarrierVerificationPhase(config)); } ! ret.getLowTier().findPhase(ExpandLogicPhase.class).add(new AddressLoweringPhase(addressLowering)); ! ListIterator<BasePhase<? super LowTierContext>> findPhase = ret.getLowTier().findPhase(FixReadsPhase.class); + if (findPhase == null) { + findPhase = ret.getLowTier().findPhase(ExpandLogicPhase.class); + } + findPhase.add(new AddressLoweringPhase(addressLowering)); return ret; } protected PhaseSuite<HighTierContext> createGraphBuilderSuite() {
*** 129,150 **** --- 135,156 ---- /** * When assertions are enabled, we encode and decode every parsed graph, to ensure that the * encoding and decoding process work correctly. The decoding performs canonicalization during * decoding, so the decoded graph can be different than the encoded graph - we cannot check them * for equality here. However, the encoder {@link GraphEncoder#verifyEncoding verifies the ! * encoding itself}, i.e., performs a decoding without canoncialization and checks the graphs ! * encoding itself}, i.e., performs a decoding without canonicalization and checks the graphs * for equality. */ private boolean appendGraphEncoderTest(PhaseSuite<HighTierContext> suite) { suite.appendPhase(new BasePhase<HighTierContext>() { @Override protected void run(StructuredGraph graph, HighTierContext context) { EncodedGraph encodedGraph = GraphEncoder.encodeSingleGraph(graph, runtime.getTarget().arch); SimplifyingGraphDecoder graphDecoder = new SimplifyingGraphDecoder(context.getMetaAccess(), context.getConstantReflection(), context.getConstantFieldProvider(), ! context.getStampProvider(), !ImmutableCode.getValue(graph.getOptions()), runtime.getTarget().arch); ! StructuredGraph targetGraph = new StructuredGraph(graph.method(), AllowAssumptions.YES, INVALID_COMPILATION_ID); ! StructuredGraph targetGraph = new StructuredGraph.Builder(graph.getOptions(), AllowAssumptions.YES).method(graph.method()).build(); graphDecoder.decode(targetGraph, encodedGraph); } @Override protected CharSequence getName() {
*** 167,179 **** --- 173,185 ---- newGbs.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); return newGbs; } @Override ! public LIRSuites createLIRSuites(OptionValues options) { ! LIRSuites suites = defaultSuitesCreator.createLIRSuites(options); ! String profileInstructions = HotSpotBackend.Options.ASMInstructionProfiling.getValue(options); if (profileInstructions != null) { suites.getPostAllocationOptimizationStage().appendPhase(new HotSpotInstructionProfiling(profileInstructions)); } return suites; }

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File