59
59
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
60
60
import com .oracle .graal .python .builtins .objects .referencetype .PReferenceType ;
61
61
import com .oracle .graal .python .builtins .objects .referencetype .PReferenceType .WeakRefStorage ;
62
- import com .oracle .graal .python .builtins .objects .type .LazyPythonClass ;
63
62
import com .oracle .graal .python .nodes .ErrorMessages ;
64
63
import com .oracle .graal .python .nodes .PGuards ;
65
64
import com .oracle .graal .python .nodes .attributes .ReadAttributeFromObjectNode ;
@@ -136,12 +135,13 @@ public abstract static class ReferenceTypeNode extends PythonBuiltinNode {
136
135
@ Child private CExtNodes .GetTypeMemberNode getTpWeaklistoffsetNode ;
137
136
138
137
@ 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 ) {
140
139
return factory ().createReferenceType (cls , object , null , getWeakReferenceQueue ());
141
140
}
142
141
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 ) {
145
145
if (callback instanceof PNone ) {
146
146
return factory ().createReferenceType (cls , object , null , getWeakReferenceQueue ());
147
147
} else {
@@ -150,7 +150,7 @@ public PReferenceType refType(LazyPythonClass cls, Object object, Object callbac
150
150
}
151
151
152
152
@ Specialization (limit = "2" )
153
- public PReferenceType refType (LazyPythonClass cls , PythonAbstractNativeObject pythonObject , Object callback ,
153
+ public PReferenceType refType (Object cls , PythonAbstractNativeObject pythonObject , Object callback ,
154
154
@ CachedLibrary ("pythonObject" ) PythonObjectLibrary lib ,
155
155
@ Cached IsBuiltinClassProfile profile ) {
156
156
Object actualCallback = callback instanceof PNone ? null : callback ;
0 commit comments