Skip to content

Commit 19e27bd

Browse files
committed
Cache points-to option in analysis policy.
1 parent f51c027 commit 19e27bd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public abstract class AnalysisPolicy {
7070
protected final int maxHeapContextDepth;
7171
protected final boolean limitObjectArrayLength;
7272
protected final int maxObjectSetSize;
73+
protected final boolean hybridStaticContext;
7374

7475
public AnalysisPolicy(OptionValues options) {
7576
this.options = options;
@@ -82,7 +83,7 @@ public AnalysisPolicy(OptionValues options) {
8283
maxHeapContextDepth = PointstoOptions.MaxHeapContextDepth.getValue(options);
8384
limitObjectArrayLength = PointstoOptions.LimitObjectArrayLength.getValue(options);
8485
maxObjectSetSize = PointstoOptions.MaxObjectSetSize.getValue(options);
85-
86+
hybridStaticContext = PointstoOptions.HybridStaticContext.getValue(options);
8687
}
8788

8889
public abstract boolean isContextSensitiveAnalysis();
@@ -115,6 +116,10 @@ public int maxObjectSetSize() {
115116
return maxObjectSetSize;
116117
}
117118

119+
public boolean useHybridStaticContext() {
120+
return hybridStaticContext;
121+
}
122+
118123
public abstract MethodTypeFlow createMethodTypeFlow(PointsToAnalysisMethod method);
119124

120125
/**

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/context/bytecode/BytecodeAnalysisContextPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public BytecodeAnalysisContext staticCalleeContext(PointsToAnalysis bb, Bytecode
117117
* the invoke location, otherwise just reuse the caller context.
118118
*/
119119

120-
if (!PointstoOptions.HybridStaticContext.getValue(bb.getOptions())) {
120+
if (!bb.analysisPolicy().useHybridStaticContext()) {
121121
return callerContext;
122122
}
123123

0 commit comments

Comments
 (0)