Skip to content

Commit a30ffea

Browse files
cosminbascalukasstadler
authored andcommitted
remove @cached redundant fields
1 parent b7b8e25 commit a30ffea

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/attributes/LookupAttributeInMRONode.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public static LookupAttributeInMRONode create(String key) {
104104
public abstract Object execute(PythonClass klass);
105105

106106
final static class PythonClassAssumptionPair {
107-
public PythonClass cls;
108-
public Assumption assumption;
107+
public final PythonClass cls;
108+
public final Assumption assumption;
109109

110110
PythonClassAssumptionPair(PythonClass cls, Assumption assumption) {
111111
this.cls = cls;
@@ -131,16 +131,15 @@ protected PythonClassAssumptionPair findAttrClassAndAssumptionInMRO(PythonClass
131131
return new PythonClassAssumptionPair(null, attrAssumption);
132132
}
133133

134-
@Specialization(guards = {"klass == cachedKlass", "cachedAttrKlass != null"}, limit = "5", assumptions = {"lookupStable", "attributeInMROFinalAssumption"}, rewriteOn = IllegalStateException.class)
134+
@Specialization(guards = {"klass == cachedKlass", "cachedAttributeClassAssumptionPair.cls != null"}, limit = "5", assumptions = {"lookupStable",
135+
"cachedAttributeClassAssumptionPair.assumption"}, rewriteOn = IllegalStateException.class)
135136
protected Object lookupConstantMROCached(@SuppressWarnings("unused") PythonClass klass,
136137
@Cached("klass") @SuppressWarnings("unused") PythonClass cachedKlass,
137138
@Cached("cachedKlass.getLookupStableAssumption()") @SuppressWarnings("unused") Assumption lookupStable,
138139
@Cached("create()") ReadAttributeFromObjectNode readAttrNode,
139-
@Cached("findAttrClassAndAssumptionInMRO(cachedKlass)") @SuppressWarnings("unused") PythonClassAssumptionPair cachedPair,
140-
@Cached("cachedPair.cls") PythonClass cachedAttrKlass,
141-
@Cached("cachedPair.assumption") @SuppressWarnings("unused") Assumption attributeInMROFinalAssumption,
140+
@Cached("findAttrClassAndAssumptionInMRO(cachedKlass)") @SuppressWarnings("unused") PythonClassAssumptionPair cachedAttributeClassAssumptionPair,
142141
@Cached("createBinaryProfile()") ConditionProfile attributeDeletedProfile) {
143-
Object value = readAttrNode.execute(cachedAttrKlass, key);
142+
Object value = readAttrNode.execute(cachedAttributeClassAssumptionPair.cls, key);
144143
if (attributeDeletedProfile.profile(value == PNone.NO_VALUE)) {
145144
// in case the attribute was deleted
146145
throw new IllegalStateException();

0 commit comments

Comments
 (0)