< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java

Print this page




  92         this(false, options);
  93     }
  94 
  95     public SchedulePhase(boolean immutableGraph, OptionValues options) {
  96         this(OptScheduleOutOfLoops.getValue(options) ? SchedulingStrategy.LATEST_OUT_OF_LOOPS : SchedulingStrategy.LATEST, immutableGraph);
  97     }
  98 
  99     public SchedulePhase(SchedulingStrategy strategy) {
 100         this(strategy, false);
 101     }
 102 
 103     public SchedulePhase(SchedulingStrategy strategy, boolean immutableGraph) {
 104         this.selectedStrategy = strategy;
 105         this.immutableGraph = immutableGraph;
 106     }
 107 
 108     private NodeEventScope verifyImmutableGraph(StructuredGraph graph) {
 109         if (immutableGraph && Assertions.assertionsEnabled()) {
 110             return graph.trackNodeEvents(new NodeEventListener() {
 111                 @Override
 112                 public void event(NodeEvent e, Node node) {
 113                     assert false : "graph changed: " + e + " on node " + node;
 114                 }
 115             });
 116         } else {
 117             return null;
 118         }
 119     }
 120 
 121     @Override
 122     @SuppressWarnings("try")
 123     protected void run(StructuredGraph graph) {
 124         try (NodeEventScope scope = verifyImmutableGraph(graph)) {
 125             Instance inst = new Instance();
 126             inst.run(graph, selectedStrategy, immutableGraph);
 127         }
 128     }
 129 
 130     public static void run(StructuredGraph graph, SchedulingStrategy strategy, ControlFlowGraph cfg) {
 131         Instance inst = new Instance(cfg);
 132         inst.run(graph, strategy, false);




  92         this(false, options);
  93     }
  94 
  95     public SchedulePhase(boolean immutableGraph, OptionValues options) {
  96         this(OptScheduleOutOfLoops.getValue(options) ? SchedulingStrategy.LATEST_OUT_OF_LOOPS : SchedulingStrategy.LATEST, immutableGraph);
  97     }
  98 
  99     public SchedulePhase(SchedulingStrategy strategy) {
 100         this(strategy, false);
 101     }
 102 
 103     public SchedulePhase(SchedulingStrategy strategy, boolean immutableGraph) {
 104         this.selectedStrategy = strategy;
 105         this.immutableGraph = immutableGraph;
 106     }
 107 
 108     private NodeEventScope verifyImmutableGraph(StructuredGraph graph) {
 109         if (immutableGraph && Assertions.assertionsEnabled()) {
 110             return graph.trackNodeEvents(new NodeEventListener() {
 111                 @Override
 112                 public void changed(NodeEvent e, Node node) {
 113                     assert false : "graph changed: " + e + " on node " + node;
 114                 }
 115             });
 116         } else {
 117             return null;
 118         }
 119     }
 120 
 121     @Override
 122     @SuppressWarnings("try")
 123     protected void run(StructuredGraph graph) {
 124         try (NodeEventScope scope = verifyImmutableGraph(graph)) {
 125             Instance inst = new Instance();
 126             inst.run(graph, selectedStrategy, immutableGraph);
 127         }
 128     }
 129 
 130     public static void run(StructuredGraph graph, SchedulingStrategy strategy, ControlFlowGraph cfg) {
 131         Instance inst = new Instance(cfg);
 132         inst.run(graph, strategy, false);


< prev index next >