src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
Print this page
*** 20,35 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.virtual.phases.ea;
- import static org.graalvm.compiler.debug.Debug.isEnabled;
import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required;
import org.graalvm.compiler.core.common.util.CompilationAlarm;
! import org.graalvm.compiler.debug.Debug;
! import org.graalvm.compiler.debug.Debug.Scope;
import org.graalvm.compiler.graph.Graph.NodeEventScope;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.spi.Simplifiable;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult;
--- 20,33 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.virtual.phases.ea;
import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required;
import org.graalvm.compiler.core.common.util.CompilationAlarm;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Graph.NodeEventScope;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.spi.Simplifiable;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult;
*** 75,109 ****
@SuppressWarnings("try")
public boolean runAnalysis(StructuredGraph graph, PhaseContextT context) {
boolean changed = false;
CompilationAlarm compilationAlarm = CompilationAlarm.current();
for (int iteration = 0; iteration < maxIterations && !compilationAlarm.hasExpired(); iteration++) {
! try (Scope s = Debug.scope(isEnabled() ? "iteration " + iteration : null)) {
ScheduleResult schedule;
ControlFlowGraph cfg;
if (unscheduled) {
schedule = null;
cfg = ControlFlowGraph.compute(graph, true, true, false, false);
} else {
new SchedulePhase(SchedulePhase.SchedulingStrategy.EARLIEST).apply(graph, false);
schedule = graph.getLastSchedule();
cfg = schedule.getCFG();
}
! try (Scope scheduleScope = Debug.scope("EffectsPhaseWithSchedule", schedule)) {
Closure<?> closure = createEffectsClosure(context, schedule, cfg);
ReentrantBlockIterator.apply(closure, cfg.getStartBlock());
if (closure.needsApplyEffects()) {
// apply the effects collected during this iteration
HashSetNodeEventListener listener = new HashSetNodeEventListener();
try (NodeEventScope nes = graph.trackNodeEvents(listener)) {
closure.applyEffects();
}
! if (Debug.isDumpEnabled(Debug.INFO_LEVEL)) {
! Debug.dump(Debug.DETAILED_LEVEL, graph, "%s iteration", getName());
}
new DeadCodeEliminationPhase(Required).apply(graph);
EconomicSet<Node> changedNodes = listener.getNodes();
--- 73,108 ----
@SuppressWarnings("try")
public boolean runAnalysis(StructuredGraph graph, PhaseContextT context) {
boolean changed = false;
CompilationAlarm compilationAlarm = CompilationAlarm.current();
+ DebugContext debug = graph.getDebug();
for (int iteration = 0; iteration < maxIterations && !compilationAlarm.hasExpired(); iteration++) {
! try (DebugContext.Scope s = debug.scope(debug.areScopesEnabled() ? "iteration " + iteration : null)) {
ScheduleResult schedule;
ControlFlowGraph cfg;
if (unscheduled) {
schedule = null;
cfg = ControlFlowGraph.compute(graph, true, true, false, false);
} else {
new SchedulePhase(SchedulePhase.SchedulingStrategy.EARLIEST).apply(graph, false);
schedule = graph.getLastSchedule();
cfg = schedule.getCFG();
}
! try (DebugContext.Scope scheduleScope = debug.scope("EffectsPhaseWithSchedule", schedule)) {
Closure<?> closure = createEffectsClosure(context, schedule, cfg);
ReentrantBlockIterator.apply(closure, cfg.getStartBlock());
if (closure.needsApplyEffects()) {
// apply the effects collected during this iteration
HashSetNodeEventListener listener = new HashSetNodeEventListener();
try (NodeEventScope nes = graph.trackNodeEvents(listener)) {
closure.applyEffects();
}
! if (debug.isDumpEnabled(DebugContext.INFO_LEVEL)) {
! debug.dump(DebugContext.DETAILED_LEVEL, graph, "%s iteration", getName());
}
new DeadCodeEliminationPhase(Required).apply(graph);
EconomicSet<Node> changedNodes = listener.getNodes();
*** 119,129 ****
changed = true;
} else {
break;
}
} catch (Throwable t) {
! throw Debug.handle(t);
}
}
}
return changed;
}
--- 118,128 ----
changed = true;
} else {
break;
}
} catch (Throwable t) {
! throw debug.handle(t);
}
}
}
return changed;
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File