Skip to content

Commit c696d65

Browse files
committed
Remove PythonAbstractClass use from SuperBuiltins
1 parent c54141b commit c696d65

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/superobject/SuperBuiltins.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,17 @@ Object uncached(SuperObject self) {
123123
}
124124

125125
abstract static class GetObjectTypeNode extends Node {
126-
abstract PythonAbstractClass execute(SuperObject self);
126+
abstract Object execute(SuperObject self);
127127

128128
@Specialization(guards = "self == cachedSelf", assumptions = "cachedSelf.getNeverReinitializedAssumption()", limit = "1")
129-
PythonAbstractClass cached(@SuppressWarnings("unused") SuperObject self,
129+
Object cached(@SuppressWarnings("unused") SuperObject self,
130130
@SuppressWarnings("unused") @Cached("self") SuperObject cachedSelf,
131-
@Cached("self.getObjectType()") PythonAbstractClass type) {
131+
@Cached("self.getObjectType()") Object type) {
132132
return type;
133133
}
134134

135135
@Specialization(replaces = "cached")
136-
PythonAbstractClass uncached(SuperObject self) {
136+
Object uncached(SuperObject self) {
137137
return self.getObjectType();
138138
}
139139
}
@@ -426,7 +426,7 @@ private Object genericGetAttr(VirtualFrame frame, Object object, Object attr) {
426426

427427
@Specialization
428428
public Object get(VirtualFrame frame, SuperObject self, Object attr) {
429-
PythonAbstractClass startType = getObjectType.execute(self);
429+
Object startType = getObjectType.execute(self);
430430
if (startType == null) {
431431
return genericGetAttr(frame, self, attr);
432432
}
@@ -499,7 +499,7 @@ private boolean isSameType(Object execute, PythonAbstractClass abstractPythonCla
499499
return isSameTypeNode.execute(execute, abstractPythonClass);
500500
}
501501

502-
private PythonAbstractClass[] getMro(PythonAbstractClass clazz) {
502+
private PythonAbstractClass[] getMro(Object clazz) {
503503
if (getMroNode == null) {
504504
CompilerDirectives.transferToInterpreterAndInvalidate();
505505
getMroNode = insert(GetMroNode.create());
@@ -545,7 +545,7 @@ public abstract static class SelfClassNode extends PythonUnaryBuiltinNode {
545545

546546
@Specialization
547547
Object getClass(SuperObject self) {
548-
PythonAbstractClass objectType = getObjectType.execute(self);
548+
Object objectType = getObjectType.execute(self);
549549
if (objectType == null) {
550550
return PNone.NONE;
551551
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/superobject/SuperObject.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@
4141
package com.oracle.graal.python.builtins.objects.superobject;
4242

4343
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
44-
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
4544
import com.oracle.truffle.api.Assumption;
4645
import com.oracle.truffle.api.Truffle;
4746
import com.oracle.truffle.api.object.DynamicObject;
4847

4948
public class SuperObject extends PythonBuiltinObject {
5049
private final Assumption neverReinitialized = Truffle.getRuntime().createAssumption("super object was never reinitialized");
5150
private Object type;
52-
private PythonAbstractClass objecttype;
51+
private Object objecttype;
5352
private Object object;
5453

5554
public SuperObject(Object cls, DynamicObject storage) {
@@ -61,11 +60,11 @@ public void init(Object newType, Object newObjecttype, Object newObject) {
6160
neverReinitialized.invalidate();
6261
}
6362
this.type = newType;
64-
this.objecttype = PythonAbstractClass.cast(newObjecttype);
63+
this.objecttype = newObjecttype;
6564
this.object = newObject;
6665
}
6766

68-
public PythonAbstractClass getObjectType() {
67+
public Object getObjectType() {
6968
return objecttype;
7069
}
7170

0 commit comments

Comments
 (0)