Skip to content

Commit b6fc315

Browse files
committed
use type when accessing dict in extraivars()
1 parent 12af00f commit b6fc315

File tree

1 file changed

+5
-5
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+5
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeNodes.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ protected Object exec(Object type,
10101010
@Cached CallBinaryMethodNode callGetAttr,
10111011
@Cached GetDictStorageNode getDictStorageNode,
10121012
@CachedLibrary(limit = "4") HashingStorageLibrary storageLibrary,
1013-
@CachedLibrary(limit = "4") PythonObjectLibrary objectLibrary) {
1013+
@CachedLibrary(limit = "6") PythonObjectLibrary objectLibrary) {
10141014
return solidBase(type, getBaseClassNode, context, lookupGetAttribute, callGetAttr, getDictStorageNode, storageLibrary, objectLibrary);
10151015
}
10161016

@@ -1034,8 +1034,8 @@ private Object solidBase(Object type, GetBaseClassNode getBaseClassNode, PythonC
10341034

10351035
private boolean extraivars(Object type, Object base, LookupSpecialMethodNode.Dynamic lookupGetAttribute, CallBinaryMethodNode callGetAttr,
10361036
GetDictStorageNode getDictStorageNode, HashingStorageLibrary storageLibrary, PythonObjectLibrary objectLibrary) {
1037-
Object typeSlots = getSlotsFromDict(type, lookupGetAttribute, callGetAttr, getDictStorageNode, storageLibrary);
1038-
Object baseSlots = getSlotsFromDict(base, lookupGetAttribute, callGetAttr, getDictStorageNode, storageLibrary);
1037+
Object typeSlots = getSlotsFromDict(type, lookupGetAttribute, callGetAttr, getDictStorageNode, objectLibrary, storageLibrary);
1038+
Object baseSlots = getSlotsFromDict(base, lookupGetAttribute, callGetAttr, getDictStorageNode, objectLibrary, storageLibrary);
10391039

10401040
if (typeSlots == null && baseSlots != null && objectLibrary.length(baseSlots) != 0 ||
10411041
baseSlots == null && typeSlots != null && objectLibrary.length(typeSlots) != 0) {
@@ -1051,8 +1051,8 @@ private boolean extraivars(Object type, Object base, LookupSpecialMethodNode.Dyn
10511051
}
10521052

10531053
protected Object getSlotsFromDict(Object type, LookupSpecialMethodNode.Dynamic lookupGetAttribute, CallBinaryMethodNode callGetAttr,
1054-
GetDictStorageNode getDictStorageNode, HashingStorageLibrary lib) {
1055-
Object getAttr = lookupGetAttribute.execute(type, __GETATTRIBUTE__, type, false);
1054+
GetDictStorageNode getDictStorageNode, PythonObjectLibrary objectLibrary, HashingStorageLibrary lib) {
1055+
Object getAttr = lookupGetAttribute.execute(objectLibrary.getLazyPythonClass(type), __GETATTRIBUTE__, type, false);
10561056
Object dict = callGetAttr.executeObject(getAttr, type, __DICT__);
10571057
if (dict != PNone.NO_VALUE) {
10581058
if (dict instanceof PMappingproxy) {

0 commit comments

Comments
 (0)