Skip to content

Commit 690551d

Browse files
author
Stefan Anzinger
committed
[GR-26977] Pass MroSequenceStorage to DynamicObjectStorage when getting type.__dict__.
PullRequest: graalpython/1350
2 parents 8ee5b68 + 5a8abd8 commit 690551d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Object doManaged(PythonManagedClass self,
695695
@CachedLibrary("self") PythonObjectLibrary lib) {
696696
PDict dict = lib.getDict(self);
697697
if (dict == null) {
698-
dict = factory().createDictFixedStorage(self);
698+
dict = factory().createDictFixedStorage(self, self.getMethodResolutionOrder());
699699
// The mapping is unmodifiable, so we don't have to assign it back
700700
}
701701
return factory().createMappingproxy(dict);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/object/PythonObjectFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
import com.oracle.graal.python.runtime.sequence.storage.EmptySequenceStorage;
138138
import com.oracle.graal.python.runtime.sequence.storage.IntSequenceStorage;
139139
import com.oracle.graal.python.runtime.sequence.storage.LongSequenceStorage;
140+
import com.oracle.graal.python.runtime.sequence.storage.MroSequenceStorage;
140141
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
141142
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorageFactory;
142143
import com.oracle.graal.python.util.PythonUtils;
@@ -206,7 +207,7 @@ protected static AllocationReporter getAllocationReporter(ContextReference<Pytho
206207
return contextRef.get().getEnv().lookup(AllocationReporter.class);
207208
}
208209

209-
private final PythonLanguage getLanguage() {
210+
private PythonLanguage getLanguage() {
210211
return executeGetLanguage(true, 0.0);
211212
}
212213

@@ -574,6 +575,10 @@ public PDict createDict(DynamicObject dynamicObject) {
574575
return createDict(new DynamicObjectStorage(dynamicObject));
575576
}
576577

578+
public PDict createDictFixedStorage(PythonObject pythonObject, MroSequenceStorage mroSequenceStorage) {
579+
return createDict(new DynamicObjectStorage(pythonObject.getStorage(), mroSequenceStorage));
580+
}
581+
577582
public PDict createDictFixedStorage(PythonObject pythonObject) {
578583
return createDict(new DynamicObjectStorage(pythonObject.getStorage()));
579584
}

0 commit comments

Comments
 (0)