Skip to content

Commit a35b05c

Browse files
committed
[GR-64675] Introduce TypeFlow.flowState
PullRequest: graal/20751
2 parents b637f7f + e1c9a9c commit a35b05c

File tree

7 files changed

+119
-84
lines changed

7 files changed

+119
-84
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public abstract class AnalysisPolicy {
7070
protected final int maxObjectSetSize;
7171
protected final boolean hybridStaticContext;
7272
protected final boolean useConservativeUnsafeAccess;
73+
private final int parsingContextMaxDepth;
74+
private final boolean trackAccessChain;
7375

7476
public AnalysisPolicy(OptionValues options) {
7577
this.options = options;
@@ -84,6 +86,8 @@ public AnalysisPolicy(OptionValues options) {
8486
maxObjectSetSize = PointstoOptions.MaxObjectSetSize.getValue(options);
8587
hybridStaticContext = PointstoOptions.HybridStaticContext.getValue(options);
8688
useConservativeUnsafeAccess = PointstoOptions.UseConservativeUnsafeAccess.getValue(options);
89+
trackAccessChain = PointstoOptions.TrackAccessChain.getValue(options);
90+
parsingContextMaxDepth = PointstoOptions.ParsingContextMaxDepth.getValue(options);
8791
}
8892

8993
public abstract boolean isContextSensitiveAnalysis();
@@ -124,6 +128,14 @@ public boolean useConservativeUnsafeAccess() {
124128
return useConservativeUnsafeAccess;
125129
}
126130

131+
public boolean trackAccessChain() {
132+
return trackAccessChain;
133+
}
134+
135+
public int parsingContextMaxDepth() {
136+
return parsingContextMaxDepth;
137+
}
138+
127139
public abstract MethodTypeFlow createMethodTypeFlow(PointsToAnalysisMethod method);
128140

129141
/**

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,8 @@ public void registerUnsafeStore(UnsafeStoreTypeFlow unsafeStore) {
216216
/**
217217
* Force update of the unsafe loads and unsafe store type flows when a field is registered as
218218
* unsafe accessed 'on the fly', i.e., during the analysis.
219-
*
220-
* @param field the newly unsafe registered field. We use its declaring type to filter the
221-
* unsafe access flows that need to be updated.
222219
*/
223-
public void forceUnsafeUpdate(AnalysisField field) {
220+
public void forceUnsafeUpdate() {
224221
if (analysisPolicy.useConservativeUnsafeAccess()) {
225222
return;
226223
}
@@ -239,7 +236,7 @@ public void forceUnsafeUpdate(AnalysisField field) {
239236
* update; an update of the receiver object flow will trigger an updated of the
240237
* observers, i.e., of the unsafe load.
241238
*/
242-
if (unsafeLoad.receiver().isFlowEnabled()) {
239+
if (unsafeLoad.receiver().isActive()) {
243240
this.postFlow(unsafeLoad.receiver());
244241
}
245242
}
@@ -254,7 +251,7 @@ public void forceUnsafeUpdate(AnalysisField field) {
254251
* update; an update of the receiver object flow will trigger an updated of the
255252
* observers, i.e., of the unsafe store.
256253
*/
257-
if (unsafeStore.receiver().isFlowEnabled()) {
254+
if (unsafeStore.receiver().isActive()) {
258255
this.postFlow(unsafeStore.receiver());
259256
}
260257
}

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/DynamicNewInstanceTypeFlow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public TypeFlow<BytecodePosition> copy(PointsToAnalysis bb, MethodFlowsGraph met
6767

6868
@Override
6969
public void initFlow(PointsToAnalysis bb) {
70-
assert !bb.usePredicates() || newTypeFlow.getPredicate() != null || MethodFlowsGraph.nonMethodFlow(newTypeFlow) : "Missing predicate for the flow " + newTypeFlow + ", which is input for " +
71-
this;
70+
assert !bb.usePredicates() || newTypeFlow.getPredicate() != null || MethodFlowsGraph.nonMethodFlow(newTypeFlow) || newTypeFlow.isFlowEnabled() : "Missing predicate for the flow " +
71+
newTypeFlow + ", which is input for " + this;
7272
newTypeFlow.addObserver(bb, this);
7373
}
7474

0 commit comments

Comments
 (0)