src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
equal
deleted
inserted
replaced
36 import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult; |
36 import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult; |
37 import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; |
37 import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; |
38 import org.graalvm.compiler.phases.BasePhase; |
38 import org.graalvm.compiler.phases.BasePhase; |
39 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
39 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
40 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
40 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
41 import org.graalvm.compiler.phases.common.util.HashSetNodeEventListener; |
41 import org.graalvm.compiler.phases.common.util.EconomicSetNodeEventListener; |
42 import org.graalvm.compiler.phases.graph.ReentrantBlockIterator; |
42 import org.graalvm.compiler.phases.graph.ReentrantBlockIterator; |
43 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
43 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
44 import org.graalvm.compiler.phases.tiers.PhaseContext; |
44 import org.graalvm.compiler.phases.tiers.PhaseContext; |
45 |
45 |
46 public abstract class EffectsPhase<PhaseContextT extends PhaseContext> extends BasePhase<PhaseContextT> { |
46 public abstract class EffectsPhase<PhaseContextT extends PhaseContext> extends BasePhase<PhaseContextT> { |
94 Closure<?> closure = createEffectsClosure(context, schedule, cfg); |
94 Closure<?> closure = createEffectsClosure(context, schedule, cfg); |
95 ReentrantBlockIterator.apply(closure, cfg.getStartBlock()); |
95 ReentrantBlockIterator.apply(closure, cfg.getStartBlock()); |
96 |
96 |
97 if (closure.needsApplyEffects()) { |
97 if (closure.needsApplyEffects()) { |
98 // apply the effects collected during this iteration |
98 // apply the effects collected during this iteration |
99 HashSetNodeEventListener listener = new HashSetNodeEventListener(); |
99 EconomicSetNodeEventListener listener = new EconomicSetNodeEventListener(); |
100 try (NodeEventScope nes = graph.trackNodeEvents(listener)) { |
100 try (NodeEventScope nes = graph.trackNodeEvents(listener)) { |
101 closure.applyEffects(); |
101 closure.applyEffects(); |
102 } |
102 } |
103 |
103 |
104 if (debug.isDumpEnabled(DebugContext.VERBOSE_LEVEL)) { |
104 if (debug.isDumpEnabled(DebugContext.VERBOSE_LEVEL)) { |