@@ -74,6 +74,12 @@ public static GetClassNode create() {
74
74
75
75
public abstract PythonClass execute (Object object );
76
76
77
+ @ Specialization (assumptions = "singleContextAssumption()" )
78
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) GetSetDescriptor object ,
79
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
80
+ return klass ;
81
+ }
82
+
77
83
@ Specialization
78
84
protected PythonClass getIt (@ SuppressWarnings ("unused" ) GetSetDescriptor object ) {
79
85
return getCore ().lookupType (PythonBuiltinClassType .GetSetDescriptor );
@@ -85,47 +91,95 @@ protected PythonClass getIt(PythonObject object,
85
91
return profile .profile (object .getPythonClass ());
86
92
}
87
93
94
+ @ Specialization (assumptions = "singleContextAssumption()" )
95
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) PNone object ,
96
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
97
+ return klass ;
98
+ }
99
+
88
100
@ Specialization
89
101
protected PythonClass getIt (@ SuppressWarnings ("unused" ) PNone object ) {
90
102
return getCore ().lookupType (PythonBuiltinClassType .PNone );
91
103
}
92
104
105
+ @ Specialization (assumptions = "singleContextAssumption()" )
106
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) PNotImplemented object ,
107
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
108
+ return klass ;
109
+ }
110
+
93
111
@ SuppressWarnings ("unused" )
94
112
@ Specialization
95
113
protected PythonClass getIt (PNotImplemented object ) {
96
114
return getCore ().lookupType (PythonBuiltinClassType .PNotImplemented );
97
115
}
98
116
117
+ @ Specialization (assumptions = "singleContextAssumption()" )
118
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) PEllipsis object ,
119
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
120
+ return klass ;
121
+ }
122
+
99
123
@ SuppressWarnings ("unused" )
100
124
@ Specialization
101
125
protected PythonClass getIt (PEllipsis object ) {
102
126
return getCore ().lookupType (PythonBuiltinClassType .PEllipsis );
103
127
}
104
128
129
+ @ Specialization (assumptions = "singleContextAssumption()" )
130
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) boolean object ,
131
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
132
+ return klass ;
133
+ }
134
+
105
135
@ SuppressWarnings ("unused" )
106
136
@ Specialization
107
137
protected PythonClass getIt (boolean object ) {
108
138
return getCore ().lookupType (PythonBuiltinClassType .Boolean );
109
139
}
110
140
141
+ @ Specialization (assumptions = "singleContextAssumption()" )
142
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) int object ,
143
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
144
+ return klass ;
145
+ }
146
+
111
147
@ SuppressWarnings ("unused" )
112
148
@ Specialization
113
149
protected PythonClass getIt (int object ) {
114
150
return getCore ().lookupType (PythonBuiltinClassType .PInt );
115
151
}
116
152
153
+ @ Specialization (assumptions = "singleContextAssumption()" )
154
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) long object ,
155
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
156
+ return klass ;
157
+ }
158
+
117
159
@ SuppressWarnings ("unused" )
118
160
@ Specialization
119
161
protected PythonClass getIt (long object ) {
120
162
return getCore ().lookupType (PythonBuiltinClassType .PInt );
121
163
}
122
164
165
+ @ Specialization (assumptions = "singleContextAssumption()" )
166
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) double object ,
167
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
168
+ return klass ;
169
+ }
170
+
123
171
@ SuppressWarnings ("unused" )
124
172
@ Specialization
125
173
protected PythonClass getIt (double object ) {
126
174
return getCore ().lookupType (PythonBuiltinClassType .PFloat );
127
175
}
128
176
177
+ @ Specialization (assumptions = "singleContextAssumption()" )
178
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) String object ,
179
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
180
+ return klass ;
181
+ }
182
+
129
183
@ SuppressWarnings ("unused" )
130
184
@ Specialization
131
185
protected PythonClass getIt (String object ) {
@@ -143,6 +197,12 @@ protected PythonClass getIt(PythonNativeObject object,
143
197
return getNativeClassNode .execute (object );
144
198
}
145
199
200
+ @ Specialization (guards = "isForeignObject(object)" , assumptions = "singleContextAssumption()" )
201
+ protected PythonClass getIt (@ SuppressWarnings ("unused" ) TruffleObject object ,
202
+ @ Cached ("getIt(object)" ) PythonClass klass ) {
203
+ return klass ;
204
+ }
205
+
146
206
@ SuppressWarnings ("unused" )
147
207
@ Specialization (guards = "isForeignObject(object)" )
148
208
protected PythonClass getIt (TruffleObject object ) {
0 commit comments