Skip to content

Commit

Permalink
[GR-54661] Graph traversal fix in TypeFlowGraphBuilder
Browse files Browse the repository at this point in the history
PullRequest: graal/17995
  • Loading branch information
d-kozak committed Jun 14, 2024
2 parents c295615 + d005d1c commit 6de5154
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
import java.util.List;
import java.util.stream.Collectors;

import jdk.graal.compiler.nodes.ParameterNode;

import com.oracle.graal.pointsto.PointsToAnalysis;
import com.oracle.graal.pointsto.flow.TypeFlow;
import com.oracle.graal.pointsto.meta.AnalysisMethod;
import com.oracle.graal.pointsto.typestate.PointsToStats;
import com.oracle.graal.pointsto.util.AnalysisError;
import com.oracle.svm.util.ClassUtil;

import jdk.graal.compiler.nodes.ParameterNode;

public class TypeFlowGraphBuilder {
private final PointsToAnalysis bb;
/**
Expand Down Expand Up @@ -140,6 +140,10 @@ public List<TypeFlow<?>> build() {
workQueue.addLast(sinkBuilder);
while (!workQueue.isEmpty()) {
TypeFlowBuilder<?> builder = workQueue.removeFirst();
if (!processed.add(builder)) {
/* Skip if this builder was processed already. */
continue;
}
/* Materialize the builder. */
TypeFlow<?> flow = builder.get();

Expand All @@ -150,9 +154,6 @@ public List<TypeFlow<?>> build() {
/* The retain reason is the sink from which it was reached. */
PointsToStats.registerTypeFlowRetainReason(bb, flow, (sinkBuilder.isBuildingAnActualParameter() ? "ActualParam=" : "") + ClassUtil.getUnqualifiedName(sinkBuilder.getFlowClass()));

/* Mark the builder as materialized. */
processed.add(builder);

/*
* Iterate over use and observer dependencies. Add them to the workQueue only if
* they have not been already processed.
Expand Down

0 comments on commit 6de5154

Please sign in to comment.