Skip to content

Commit cf1538d

Browse files
committed
Remove LazyPythonClass use from WeakRefModuleBuiltins
1 parent 1b42925 commit cf1538d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/WeakRefModuleBuiltins.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
6060
import com.oracle.graal.python.builtins.objects.referencetype.PReferenceType;
6161
import com.oracle.graal.python.builtins.objects.referencetype.PReferenceType.WeakRefStorage;
62-
import com.oracle.graal.python.builtins.objects.type.LazyPythonClass;
6362
import com.oracle.graal.python.nodes.ErrorMessages;
6463
import com.oracle.graal.python.nodes.PGuards;
6564
import com.oracle.graal.python.nodes.attributes.ReadAttributeFromObjectNode;
@@ -136,12 +135,13 @@ public abstract static class ReferenceTypeNode extends PythonBuiltinNode {
136135
@Child private CExtNodes.GetTypeMemberNode getTpWeaklistoffsetNode;
137136

138137
@Specialization(guards = "!isNativeObject(object)")
139-
public PReferenceType refType(LazyPythonClass cls, Object object, @SuppressWarnings("unused") PNone none) {
138+
public PReferenceType refType(Object cls, Object object, @SuppressWarnings("unused") PNone none) {
140139
return factory().createReferenceType(cls, object, null, getWeakReferenceQueue());
141140
}
142141

143-
@Specialization(guards = "!isNativeObject(object)")
144-
public PReferenceType refType(LazyPythonClass cls, Object object, Object callback) {
142+
@Specialization(guards = {"lib.isLazyPythonClass(cls)", "!isNativeObject(object)"})
143+
public PReferenceType refType(Object cls, Object object, Object callback,
144+
@SuppressWarnings("unused") @CachedLibrary(limit = "2") PythonObjectLibrary lib) {
145145
if (callback instanceof PNone) {
146146
return factory().createReferenceType(cls, object, null, getWeakReferenceQueue());
147147
} else {
@@ -150,7 +150,7 @@ public PReferenceType refType(LazyPythonClass cls, Object object, Object callbac
150150
}
151151

152152
@Specialization(limit = "2")
153-
public PReferenceType refType(LazyPythonClass cls, PythonAbstractNativeObject pythonObject, Object callback,
153+
public PReferenceType refType(Object cls, PythonAbstractNativeObject pythonObject, Object callback,
154154
@CachedLibrary("pythonObject") PythonObjectLibrary lib,
155155
@Cached IsBuiltinClassProfile profile) {
156156
Object actualCallback = callback instanceof PNone ? null : callback;

0 commit comments

Comments
 (0)