Skip to content

Commit f51c027

Browse files
committed
Get the typeId already cached in the AnalysisObject.
1 parent 82b362c commit f51c027

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ public TypeState doUnion(PointsToAnalysis bb, MultiTypeState state1, SingleTypeS
540540
return result;
541541
} else {
542542
AnalysisObject[] resultObjects;
543-
if (s2.exactType().getId() < s1.firstType().getId()) {
543+
if (s2.exactType().getId() < s1.firstTypeId()) {
544544
resultObjects = TypeStateUtils.concat(so2, so1);
545-
} else if (s2.exactType().getId() > s1.lastType().getId()) {
545+
} else if (s2.exactType().getId() > s1.lastTypeId()) {
546546
resultObjects = TypeStateUtils.concat(so1, so2);
547547
} else {
548548

@@ -599,7 +599,7 @@ private TypeState doUnion0(PointsToAnalysis bb, ContextSensitiveMultiTypeState s
599599

600600
/* Speculate that s1 and s2 are distinct sets. */
601601

602-
if (s1.lastType().getId() < s2.firstType().getId()) {
602+
if (s1.lastTypeId() < s2.firstTypeId()) {
603603
/* Speculate that objects in s2 follow after objects in s1. */
604604

605605
/* Concatenate the objects. */
@@ -613,7 +613,7 @@ private TypeState doUnion0(PointsToAnalysis bb, ContextSensitiveMultiTypeState s
613613
PointsToStats.registerUnionOperation(bb, s1, s2, result);
614614
return result;
615615

616-
} else if (s2.lastType().getId() < s1.firstType().getId()) {
616+
} else if (s2.lastTypeId() < s1.firstTypeId()) {
617617
/* Speculate that objects in s1 follow after objects in s2. */
618618

619619
/* Concatenate the objects. */

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,18 @@ protected Iterator<AnalysisObject> objectsIterator(BigBang bb) {
111111
return Arrays.asList(objects).iterator();
112112
}
113113

114-
/** Get the type of the first object group. */
115-
public AnalysisType firstType() {
116-
return objects[0].type();
114+
/**
115+
* Get the type of the first object group.
116+
*/
117+
public int firstTypeId() {
118+
return objects[0].getTypeId();
117119
}
118120

119-
/** Get the type of the last object group. */
120-
public AnalysisType lastType() {
121-
return objects[objects.length - 1].type();
121+
/**
122+
* Get the type of the last object group.
123+
*/
124+
public int lastTypeId() {
125+
return objects[objects.length - 1].getTypeId();
122126
}
123127

124128
@Override

0 commit comments

Comments
 (0)