Skip to content

Commit a6cc74b

Browse files
committed
[GR-69633] Refactor StrengthenGraph.
PullRequest: graal/22122
2 parents cd08f59 + 3136574 commit a6cc74b

File tree

8 files changed

+1109
-903
lines changed

8 files changed

+1109
-903
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/AbstractAnalysisEngine.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public abstract class AbstractAnalysisEngine implements BigBang {
8080
protected final int maxConstantObjectsPerType;
8181
protected final boolean profileConstantObjects;
8282
protected final boolean optimizeReturnedParameter;
83+
protected final boolean useExperimentalReachabilityAnalysis;
8384

8485
protected final OptionValues options;
8586
protected final DebugContext debug;
@@ -124,6 +125,8 @@ public AbstractAnalysisEngine(OptionValues options, AnalysisUniverse universe, H
124125
maxConstantObjectsPerType = PointstoOptions.MaxConstantObjectsPerType.getValue(options);
125126
profileConstantObjects = PointstoOptions.ProfileConstantObjects.getValue(options);
126127
optimizeReturnedParameter = PointstoOptions.OptimizeReturnedParameter.getValue(options);
128+
useExperimentalReachabilityAnalysis = PointstoOptions.UseExperimentalReachabilityAnalysis.getValue(options);
129+
127130
this.snippetReflectionProvider = snippetReflectionProvider;
128131
this.constantReflectionProvider = constantReflectionProvider;
129132
this.wordTypes = wordTypes;
@@ -250,6 +253,11 @@ public boolean optimizeReturnedParameter() {
250253
return optimizeReturnedParameter;
251254
}
252255

256+
@Override
257+
public boolean isPointsToAnalysis() {
258+
return !useExperimentalReachabilityAnalysis;
259+
}
260+
253261
public void profileConstantObject(AnalysisType type) {
254262
if (profileConstantObjects) {
255263
PointsToAnalysis.ConstantObjectsProfiler.registerConstant(type);

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/BigBang.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public interface BigBang extends ReachabilityAnalysis {
6262

6363
UnsupportedFeatures getUnsupportedFeatures();
6464

65+
boolean isPointsToAnalysis();
66+
6567
/**
6668
* Checks if all user defined limitations such as the number of types are satisfied.
6769
*/

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ public Set<AnalysisMethod> getCallers() {
577577
/** Get the list of all invoke locations for this method, as inferred by the static analysis. */
578578
public abstract List<BytecodePosition> getInvokeLocations();
579579

580+
/** Get the node markers used to store per-node mappings to metadata for encoded nodes. */
581+
public abstract Iterable<EncodedGraph.EncodedNodeReference> getEncodedNodeReferences();
582+
580583
/**
581584
* Returns true if this method is a native entrypoint, i.e. it may be called from the host
582585
* environment.

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/PointsToAnalysisMethod.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.oracle.graal.pointsto.util.ConcurrentLightHashMap;
4444
import com.oracle.svm.common.meta.MultiMethod;
4545

46+
import jdk.graal.compiler.nodes.EncodedGraph;
4647
import jdk.vm.ci.code.BytecodePosition;
4748
import jdk.vm.ci.meta.JavaKind;
4849
import jdk.vm.ci.meta.ResolvedJavaMethod;
@@ -125,6 +126,11 @@ public static Object unwrapInvokeReason(Object reason) {
125126
return reason;
126127
}
127128

129+
@Override
130+
public Iterable<EncodedGraph.EncodedNodeReference> getEncodedNodeReferences() {
131+
return typeFlow.getMethodFlowsGraph().getNodeFlows().getKeys();
132+
}
133+
128134
@Override
129135
public List<BytecodePosition> getInvokeLocations() {
130136
List<BytecodePosition> locations = new ArrayList<>();

0 commit comments

Comments
 (0)