annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/DefaultLowLevelCompilerConfiguration.java @ 19228:6340d851894b

Don't make LowLevelPhase generic but only the apply() method.
author Josef Eisl <josef.eisl@jku.at>
date Mon, 09 Feb 2015 18:23:16 +0100
parents 9c47b23fb0a2
children a0c292287e31
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
1 /*
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
2 * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
4 *
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
7 * published by the Free Software Foundation.
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
8 *
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
13 * accompanied this code).
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
14 *
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
18 *
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
21 * questions.
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
22 */
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
23 package com.oracle.graal.lir.phases;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
24
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
25 import com.oracle.graal.lir.*;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
26 import com.oracle.graal.lir.alloc.lsra.*;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
27 import com.oracle.graal.lir.constopt.*;
19226
9c47b23fb0a2 LowLevelPhase: add support for custom name.
Josef Eisl <josef.eisl@jku.at>
parents: 19220
diff changeset
28 import com.oracle.graal.lir.phases.LowLevelHighTierPhase.LowLevelHighTierContext;
9c47b23fb0a2 LowLevelPhase: add support for custom name.
Josef Eisl <josef.eisl@jku.at>
parents: 19220
diff changeset
29 import com.oracle.graal.lir.phases.LowLevelLowTierPhase.LowLevelLowTierContext;
9c47b23fb0a2 LowLevelPhase: add support for custom name.
Josef Eisl <josef.eisl@jku.at>
parents: 19220
diff changeset
30 import com.oracle.graal.lir.phases.LowLevelMidTierPhase.LowLevelMidTierContext;
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
31 import com.oracle.graal.lir.stackslotalloc.*;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
32
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
33 public class DefaultLowLevelCompilerConfiguration implements LowLevelCompilerConfiguration {
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
34
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
35 public LowLevelPhaseSuite<LowLevelHighTierContext> createHighTier() {
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
36 LowLevelPhaseSuite<LowLevelHighTierContext> suite = new LowLevelPhaseSuite<>(LowLevelHighTierContext.class);
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
37 if (ConstantLoadOptimization.Options.ConstantLoadOptimization.getValue()) {
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
38 suite.appendPhase(new ConstantLoadOptimization());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
39 }
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
40 return suite;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
41 }
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
42
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
43 public LowLevelPhaseSuite<LowLevelMidTierContext> createMidTier() {
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
44 LowLevelPhaseSuite<LowLevelMidTierContext> suite = new LowLevelPhaseSuite<>(LowLevelMidTierContext.class);
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
45 suite.appendPhase(new LinearScanPhase());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
46
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
47 // build frame map
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
48 if (LSStackSlotAllocator.Options.LSStackSlotAllocation.getValue()) {
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
49 suite.appendPhase(new LSStackSlotAllocator());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
50 } else {
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
51 suite.appendPhase(new SimpleStackSlotAllocator());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
52 }
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
53 // currently we mark locations only if we do register allocation
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
54 suite.appendPhase(new LocationMarker());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
55 return suite;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
56 }
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
57
19228
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
58 public LowLevelPhaseSuite<LowLevelLowTierContext> createLowTier() {
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
59 LowLevelPhaseSuite<LowLevelLowTierContext> suite = new LowLevelPhaseSuite<>(LowLevelLowTierContext.class);
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
60 suite.appendPhase(new EdgeMoveOptimizer());
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
61 suite.appendPhase(new ControlFlowOptimizer());
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
62 suite.appendPhase(new RedundantMoveElimination());
6340d851894b Don't make LowLevelPhase generic but only the apply() method.
Josef Eisl <josef.eisl@jku.at>
parents: 19226
diff changeset
63 suite.appendPhase(new NullCheckOptimizer());
19220
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
64 return suite;
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
65 }
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
66
1487207db440 Introduce LowLevelPhaseSuite and LowLevelCompilerConfiguration.
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
67 }