comparison 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
comparison
equal deleted inserted replaced
19227:6e495e8cc407 19228:6340d851894b
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.lir.phases; 23 package com.oracle.graal.lir.phases;
24 24
25 import com.oracle.graal.compiler.common.cfg.*;
26 import com.oracle.graal.lir.*; 25 import com.oracle.graal.lir.*;
27 import com.oracle.graal.lir.alloc.lsra.*; 26 import com.oracle.graal.lir.alloc.lsra.*;
28 import com.oracle.graal.lir.constopt.*; 27 import com.oracle.graal.lir.constopt.*;
29 import com.oracle.graal.lir.phases.LowLevelHighTierPhase.LowLevelHighTierContext; 28 import com.oracle.graal.lir.phases.LowLevelHighTierPhase.LowLevelHighTierContext;
30 import com.oracle.graal.lir.phases.LowLevelLowTierPhase.LowLevelLowTierContext; 29 import com.oracle.graal.lir.phases.LowLevelLowTierPhase.LowLevelLowTierContext;
31 import com.oracle.graal.lir.phases.LowLevelMidTierPhase.LowLevelMidTierContext; 30 import com.oracle.graal.lir.phases.LowLevelMidTierPhase.LowLevelMidTierContext;
32 import com.oracle.graal.lir.stackslotalloc.*; 31 import com.oracle.graal.lir.stackslotalloc.*;
33 32
34 public class DefaultLowLevelCompilerConfiguration implements LowLevelCompilerConfiguration { 33 public class DefaultLowLevelCompilerConfiguration implements LowLevelCompilerConfiguration {
35 34
36 public <B extends AbstractBlock<B>> LowLevelPhaseSuite<LowLevelHighTierContext, B> createHighTier() { 35 public LowLevelPhaseSuite<LowLevelHighTierContext> createHighTier() {
37 LowLevelPhaseSuite<LowLevelHighTierContext, B> suite = new LowLevelPhaseSuite<>(LowLevelHighTierContext.class); 36 LowLevelPhaseSuite<LowLevelHighTierContext> suite = new LowLevelPhaseSuite<>(LowLevelHighTierContext.class);
38 if (ConstantLoadOptimization.Options.ConstantLoadOptimization.getValue()) { 37 if (ConstantLoadOptimization.Options.ConstantLoadOptimization.getValue()) {
39 suite.appendPhase(new ConstantLoadOptimization<B>()); 38 suite.appendPhase(new ConstantLoadOptimization());
40 } 39 }
41 return suite; 40 return suite;
42 } 41 }
43 42
44 public <B extends AbstractBlock<B>> LowLevelPhaseSuite<LowLevelMidTierContext, B> createMidTier() { 43 public LowLevelPhaseSuite<LowLevelMidTierContext> createMidTier() {
45 LowLevelPhaseSuite<LowLevelMidTierContext, B> suite = new LowLevelPhaseSuite<>(LowLevelMidTierContext.class); 44 LowLevelPhaseSuite<LowLevelMidTierContext> suite = new LowLevelPhaseSuite<>(LowLevelMidTierContext.class);
46 suite.appendPhase(new LinearScanPhase<B>()); 45 suite.appendPhase(new LinearScanPhase());
47 46
48 // build frame map 47 // build frame map
49 if (LSStackSlotAllocator.Options.LSStackSlotAllocation.getValue()) { 48 if (LSStackSlotAllocator.Options.LSStackSlotAllocation.getValue()) {
50 suite.appendPhase(new LSStackSlotAllocator<B>()); 49 suite.appendPhase(new LSStackSlotAllocator());
51 } else { 50 } else {
52 suite.appendPhase(new SimpleStackSlotAllocator<B>()); 51 suite.appendPhase(new SimpleStackSlotAllocator());
53 } 52 }
54 // currently we mark locations only if we do register allocation 53 // currently we mark locations only if we do register allocation
55 suite.appendPhase(new LocationMarker<B>()); 54 suite.appendPhase(new LocationMarker());
56 return suite; 55 return suite;
57 } 56 }
58 57
59 public <B extends AbstractBlock<B>> LowLevelPhaseSuite<LowLevelLowTierContext, B> createLowTier() { 58 public LowLevelPhaseSuite<LowLevelLowTierContext> createLowTier() {
60 LowLevelPhaseSuite<LowLevelLowTierContext, B> suite = new LowLevelPhaseSuite<>(LowLevelLowTierContext.class); 59 LowLevelPhaseSuite<LowLevelLowTierContext> suite = new LowLevelPhaseSuite<>(LowLevelLowTierContext.class);
61 suite.appendPhase(new EdgeMoveOptimizer<B>()); 60 suite.appendPhase(new EdgeMoveOptimizer());
62 suite.appendPhase(new ControlFlowOptimizer<B>()); 61 suite.appendPhase(new ControlFlowOptimizer());
63 suite.appendPhase(new RedundantMoveElimination<B>()); 62 suite.appendPhase(new RedundantMoveElimination());
64 suite.appendPhase(new NullCheckOptimizer<B>()); 63 suite.appendPhase(new NullCheckOptimizer());
65 return suite; 64 return suite;
66 } 65 }
67 66
68 } 67 }