Skip to content

Commit 72bf0c1

Browse files
committed
Moved Shape creation to PythonLanguage
1 parent 8086856 commit 72bf0c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,10 @@ public Shape getShapeForClass(PythonManagedClass klass) {
681681
}
682682
}
683683

684+
public static Shape getShapeForClassWithoutDict(PythonManagedClass klass) {
685+
return Shape.newBuilder(klass.getInstanceShape()).shapeFlags(PythonObject.HAS_SLOTS_BUT_NO_DICT_FLAG).build();
686+
}
687+
684688
public Shape getBuiltinTypeInstanceShape(PythonBuiltinClassType type) {
685689
int ordinal = type.ordinal();
686690
Shape shape = builtinTypeInstanceShapes[ordinal];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public static PythonManagedClass cast(Object object) {
360360
*/
361361
@TruffleBoundary
362362
public void setHasSlotsButNoDictFlag() {
363-
instanceShape = Shape.newBuilder(instanceShape).shapeFlags(PythonObject.HAS_SLOTS_BUT_NO_DICT_FLAG).build();
363+
instanceShape = PythonLanguage.getShapeForClassWithoutDict(this);
364364
}
365365

366366
@ExportMessage

0 commit comments

Comments
 (0)