@@ -90,7 +90,27 @@ protected abstract static class PyNumberAddNode extends LookupAndCallNbNumbersBi
90
90
super (handlerFactory );
91
91
}
92
92
93
- @ Specialization
93
+ @ Specialization (guards = {"left.getClass() == cachedLeftClass" , "right.getClass() == cachedRightClass" }, limit = "5" )
94
+ Object addC (VirtualFrame frame , Object left , Object right ,
95
+ @ Bind ("this" ) Node node ,
96
+ @ SuppressWarnings ("unused" ) @ Cached ("left.getClass()" ) Class <?> cachedLeftClass ,
97
+ @ SuppressWarnings ("unused" ) @ Cached ("right.getClass()" ) Class <?> cachedRightClass ,
98
+ @ Cached InlinedGetClassNode getClassNode ,
99
+ @ Cached ("create(Add)" ) LookupSpecialMethodSlotNode getattr ,
100
+ @ Cached GetMethodsFlagsNode getMethodsFlagsNode ,
101
+ @ Cached InlinedGetClassNode getlClassNode ,
102
+ @ Cached InlinedGetClassNode getrClassNode ,
103
+ @ Cached InlinedConditionProfile p1 ,
104
+ @ Cached InlinedConditionProfile p2 ,
105
+ @ Cached InlinedConditionProfile p3 ,
106
+ @ Cached BinaryOp1Node binaryOp1Node ,
107
+ @ Cached Slot1BINFULLNode slot1BINFULLNode ) {
108
+ return add (frame , left , right , node , getClassNode , getattr , getMethodsFlagsNode ,
109
+ getlClassNode , getrClassNode , p1 , p2 , p3 ,
110
+ binaryOp1Node , slot1BINFULLNode );
111
+ }
112
+
113
+ @ Specialization (replaces = "addC" )
94
114
Object add (VirtualFrame frame , Object left , Object right ,
95
115
@ Bind ("this" ) Node node ,
96
116
@ Cached InlinedGetClassNode getClassNode ,
@@ -145,7 +165,26 @@ protected abstract static class PyNumberMultiplyNode extends LookupAndCallNbNumb
145
165
super (handlerFactory );
146
166
}
147
167
148
- @ Specialization
168
+ @ Specialization (guards = {"left.getClass() == cachedLeftClass" , "right.getClass() == cachedRightClass" }, limit = "5" )
169
+ Object mulC (VirtualFrame frame , Object left , Object right ,
170
+ @ Bind ("this" ) Node node ,
171
+ @ SuppressWarnings ("unused" ) @ Cached ("left.getClass()" ) Class <?> cachedLeftClass ,
172
+ @ SuppressWarnings ("unused" ) @ Cached ("right.getClass()" ) Class <?> cachedRightClass ,
173
+ @ Cached InlinedGetClassNode getClassNode ,
174
+ @ Cached ("create(Mul)" ) LookupSpecialMethodSlotNode getattr ,
175
+ @ Cached GetMethodsFlagsNode getMethodsFlagsNode ,
176
+ @ Cached InlinedGetClassNode getlClassNode ,
177
+ @ Cached InlinedGetClassNode getrClassNode ,
178
+ @ Cached InlinedConditionProfile p1 ,
179
+ @ Cached InlinedConditionProfile p2 ,
180
+ @ Cached InlinedConditionProfile p3 ,
181
+ @ Cached BinaryOp1Node binaryOp1Node ,
182
+ @ Cached Slot1BINFULLNode slot1BINFULLNode ) {
183
+ return mul (frame , left , right , node , getClassNode , getattr , getMethodsFlagsNode , getlClassNode ,
184
+ getrClassNode , p1 , p2 , p3 , binaryOp1Node , slot1BINFULLNode );
185
+ }
186
+
187
+ @ Specialization (replaces = "mulC" )
149
188
Object mul (VirtualFrame frame , Object left , Object right ,
150
189
@ Bind ("this" ) Node node ,
151
190
@ Cached InlinedGetClassNode getClassNode ,
@@ -209,7 +248,23 @@ protected abstract static class BinaryOpNode extends LookupAndCallNbNumbersBinar
209
248
this .rslot = rslot ;
210
249
}
211
250
212
- @ Specialization
251
+ @ Specialization (guards = {"left.getClass() == cachedLeftClass" , "right.getClass() == cachedRightClass" }, limit = "5" )
252
+ Object binaryOpC (VirtualFrame frame , Object left , Object right ,
253
+ @ Bind ("this" ) Node node ,
254
+ @ SuppressWarnings ("unused" ) @ Cached ("left.getClass()" ) Class <?> cachedLeftClass ,
255
+ @ SuppressWarnings ("unused" ) @ Cached ("right.getClass()" ) Class <?> cachedRightClass ,
256
+ @ Cached GetMethodsFlagsNode getMethodsFlagsNode ,
257
+ @ Cached InlinedGetClassNode getlClassNode ,
258
+ @ Cached InlinedGetClassNode getrClassNode ,
259
+ @ Cached InlinedConditionProfile p1 ,
260
+ @ Cached InlinedConditionProfile p2 ,
261
+ @ Cached BinaryOp1Node binaryOp1Node ,
262
+ @ Cached Slot1BINFULLNode slot1BINFULLNode ) {
263
+ return binaryOp (frame , left , right , node , getMethodsFlagsNode , getlClassNode , getrClassNode , p1 , p2 ,
264
+ binaryOp1Node , slot1BINFULLNode );
265
+ }
266
+
267
+ @ Specialization (replaces = "binaryOpC" )
213
268
Object binaryOp (VirtualFrame frame , Object left , Object right ,
214
269
@ Bind ("this" ) Node node ,
215
270
@ Cached GetMethodsFlagsNode getMethodsFlagsNode ,
0 commit comments