Skip to content

Commit f1a1edb

Browse files
committed
Remove duplicate specialization
1 parent 90e32c2 commit f1a1edb

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
package com.oracle.graal.python.nodes.attributes;
4242

4343
import com.oracle.graal.python.builtins.objects.getsetdescriptor.HiddenPythonKey;
44-
import com.oracle.graal.python.builtins.objects.object.PythonObject;
45-
import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
4644
import com.oracle.graal.python.nodes.PGuards;
4745
import com.oracle.graal.python.nodes.PNodeWithContext;
4846
import com.oracle.graal.python.nodes.util.CannotCastException;
@@ -64,10 +62,6 @@ protected static Object attrKey(Object key, CastToJavaStringNode castNode) {
6462
}
6563
}
6664

67-
protected static boolean hasBuiltinDict(PythonObject object, PythonObjectLibrary lib) {
68-
return lib.getDict(object) != null;
69-
}
70-
7165
protected static Location getLocationOrNull(Property prop) {
7266
return prop == null ? null : prop.getLocation();
7367
}

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,11 @@ protected static Object readFromBuiltinModuleDict(PythonModule object, String ke
144144
}
145145
}
146146

147-
// read from a builtin dict
148-
@Specialization(guards = {"!isHiddenKey(key)", "hasBuiltinDict(object, lib)"})
149-
protected static Object readFromBuiltinDict(PythonObject object, String key,
150-
@CachedLibrary(limit = "MAX_DICT_TYPES") PythonObjectLibrary lib,
151-
@Cached HashingCollectionNodes.GetDictStorageNode getDictStorageNode,
152-
// limit 2: string only or mixed dict
153-
@CachedLibrary(limit = "MAX_DICT_TYPES") HashingStorageLibrary hlib) {
154-
Object value = hlib.getItem(getDictStorageNode.execute(lib.getDict(object)), key);
155-
if (value == null) {
156-
return PNone.NO_VALUE;
157-
} else {
158-
return value;
159-
}
160-
}
161-
162147
// read from the Dict
163148
@Specialization(guards = {
164149
"!isHiddenKey(key)",
165150
"lib.hasDict(object)"
166-
}, replaces = {"readFromBuiltinDict", "readFromBuiltinModuleDict"})
151+
}, replaces = "readFromBuiltinModuleDict")
167152
protected static Object readFromDict(PythonObject object, Object key,
168153
@CachedLibrary(limit = "MAX_DICT_TYPES") PythonObjectLibrary lib,
169154
@Cached HashingCollectionNodes.GetDictStorageNode getDictStorage,

0 commit comments

Comments
 (0)