src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
changeset 58877 aec7bf35d6f5
parent 52910 583fd71c47d6
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    22  */
    22  */
    23 
    23 
    24 
    24 
    25 package org.graalvm.compiler.core.phases;
    25 package org.graalvm.compiler.core.phases;
    26 
    26 
    27 import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode;
       
    28 
       
    29 import org.graalvm.compiler.nodes.spi.LoweringTool;
    27 import org.graalvm.compiler.nodes.spi.LoweringTool;
    30 import org.graalvm.compiler.options.OptionValues;
    28 import org.graalvm.compiler.options.OptionValues;
    31 import org.graalvm.compiler.phases.PhaseSuite;
       
    32 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    29 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    33 import org.graalvm.compiler.phases.common.LoweringPhase;
    30 import org.graalvm.compiler.phases.common.LoweringPhase;
    34 import org.graalvm.compiler.phases.tiers.HighTierContext;
    31 import org.graalvm.compiler.phases.tiers.HighTierContext;
    35 
    32 
    36 public class EconomyHighTier extends PhaseSuite<HighTierContext> {
    33 public class EconomyHighTier extends BaseTier<HighTierContext> {
    37 
    34 
    38     public EconomyHighTier(OptionValues options) {
    35     public EconomyHighTier(OptionValues options) {
    39         CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
    36         CanonicalizerPhase canonicalizer = this.createCanonicalizerPhase(options);
    40         if (ImmutableCode.getValue(options)) {
       
    41             canonicalizer.disableReadCanonicalization();
       
    42         }
       
    43 
       
    44         appendPhase(canonicalizer);
    37         appendPhase(canonicalizer);
    45         appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER));
    38         appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER));
    46     }
    39     }
    47 }
    40 }