use of org.graalvm.compiler.phases.common.LazyValue in project graal by oracle.
the class ConvertDeoptimizeToGuardPhase method run.
@Override
@SuppressWarnings("try")
protected void run(final StructuredGraph graph, final CoreProviders context) {
assert graph.isBeforeStage(StageFlag.VALUE_PROXY_REMOVAL) : "ConvertDeoptimizeToGuardPhase always creates proxies";
assert !graph.getGuardsStage().areFrameStatesAtDeopts() : graph.getGuardsStage();
LazyValue<LoopsData> lazyLoops = new LazyValue<>(() -> context.getLoopsDataProvider().getLoopsData(graph));
for (DeoptimizeNode d : graph.getNodes(DeoptimizeNode.TYPE)) {
assert d.isAlive();
if (d.getAction() == DeoptimizationAction.None) {
continue;
}
try (DebugCloseable closable = d.withNodeSourcePosition()) {
propagateFixed(d, d, context, lazyLoops);
}
}
if (context != null) {
for (FixedGuardNode fixedGuard : graph.getNodes(FixedGuardNode.TYPE)) {
try (DebugCloseable closable = fixedGuard.withNodeSourcePosition()) {
trySplitFixedGuard(fixedGuard, context, lazyLoops);
}
}
}
new DeadCodeEliminationPhase(Optional).apply(graph);
}
Aggregations