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 } |