@@ -268,7 +268,7 @@ public Object bytearray(Object cls, @SuppressWarnings("unused") PNone source, @S
268
268
269
269
@ Specialization (guards = {"lib.canBeIndex(capObj)" , "isNoValue(encoding)" , "isNoValue(errors)" })
270
270
public Object bytearray (VirtualFrame frame , Object cls , Object capObj , @ SuppressWarnings ("unused" ) PNone encoding , @ SuppressWarnings ("unused" ) PNone errors ,
271
- @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "1 " ) PythonObjectLibrary lib ) {
271
+ @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "5 " ) PythonObjectLibrary lib ) {
272
272
int cap = lib .asSizeWithState (capObj , PArguments .getThreadState (frame ));
273
273
return create (cls , BytesUtils .fromSize (getCore (), cap ));
274
274
}
@@ -302,13 +302,13 @@ public Object bytearray(Object cls, PByteArray iterable, @SuppressWarnings("unus
302
302
return create (cls , (byte []) ((ByteSequenceStorage ) iterable .getSequenceStorage ()).getCopyOfInternalArrayObject ());
303
303
}
304
304
305
- @ Specialization (guards = {"!lib.canBeIndex(iterable)" , "!isNoValue(iterable)" , "isNoValue(encoding)" , "isNoValue(errors)" }, limit = "1" )
305
+ @ Specialization (guards = {"!lib.canBeIndex(iterable)" , "!isNoValue(iterable)" , "isNoValue(encoding)" , "isNoValue(errors)" })
306
306
public Object bytearray (VirtualFrame frame , Object cls , Object iterable , @ SuppressWarnings ("unused" ) PNone encoding , @ SuppressWarnings ("unused" ) PNone errors ,
307
307
@ Cached ("create()" ) GetIteratorNode getIteratorNode ,
308
308
@ Cached ("create()" ) GetNextNode getNextNode ,
309
309
@ Cached ("create()" ) IsBuiltinClassProfile stopIterationProfile ,
310
310
@ Cached ("create()" ) CastToByteNode castToByteNode ,
311
- @ SuppressWarnings ("unused" ) @ CachedLibrary ("iterable " ) PythonObjectLibrary lib ) {
311
+ @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "3 " ) PythonObjectLibrary lib ) {
312
312
313
313
Object it = getIteratorNode .executeWith (frame , iterable );
314
314
byte [] arr = new byte [16 ];
@@ -887,7 +887,7 @@ public PythonObject reversed(Object cls, String value) {
887
887
return factory ().createStringReverseIterator (cls , value );
888
888
}
889
889
890
- @ Specialization (guards = {"!isString(sequence)" , "!isPRange(sequence)" }, limit = "3 " )
890
+ @ Specialization (guards = {"!isString(sequence)" , "!isPRange(sequence)" }, limit = "4 " )
891
891
public Object reversed (VirtualFrame frame , Object cls , Object sequence ,
892
892
@ CachedLibrary ("sequence" ) PythonObjectLibrary lib ,
893
893
@ Cached ("create(__REVERSED__)" ) LookupSpecialMethodNode reversedNode ,
@@ -1602,7 +1602,7 @@ Object fail(Object cls, Object arg, Object base) {
1602
1602
throw raise (TypeError , ErrorMessages .INT_CANT_CONVERT_STRING_WITH_EXPL_BASE );
1603
1603
}
1604
1604
1605
- @ Specialization (guards = {"isNoValue(base)" , "!isNoValue(obj)" , "!isHandledType(obj)" }, limit = "2 " )
1605
+ @ Specialization (guards = {"isNoValue(base)" , "!isNoValue(obj)" , "!isHandledType(obj)" }, limit = "5 " )
1606
1606
Object createIntGeneric (VirtualFrame frame , Object cls , Object obj , @ SuppressWarnings ("unused" ) PNone base ,
1607
1607
@ CachedLibrary ("obj" ) PythonObjectLibrary lib ) {
1608
1608
// This method (together with callInt and callIndex) reflects the logic of PyNumber_Long
@@ -3105,20 +3105,19 @@ protected static boolean isPFrame(Object obj) {
3105
3105
public abstract static class CodeTypeNode extends PythonBuiltinNode {
3106
3106
3107
3107
// limit is 2 because we expect PBytes or String
3108
- @ Specialization (guards = {"codestringBufferLib .isBuffer(codestring)" , "lnotabBufferLib .isBuffer(lnotab)" }, limit = "2" , rewriteOn = UnsupportedMessageException .class )
3108
+ @ Specialization (guards = {"bufferLib .isBuffer(codestring)" , "bufferLib .isBuffer(lnotab)" }, rewriteOn = UnsupportedMessageException .class )
3109
3109
Object call (VirtualFrame frame , Object cls , int argcount ,
3110
3110
int posonlyargcount , int kwonlyargcount ,
3111
3111
int nlocals , int stacksize , int flags ,
3112
3112
Object codestring , PTuple constants , PTuple names ,
3113
3113
PTuple varnames , Object filename , Object name ,
3114
3114
int firstlineno , Object lnotab ,
3115
3115
PTuple freevars , PTuple cellvars ,
3116
- @ CachedLibrary ("codestring" ) PythonObjectLibrary codestringBufferLib ,
3117
- @ CachedLibrary ("lnotab" ) PythonObjectLibrary lnotabBufferLib ,
3116
+ @ CachedLibrary (limit = "2" ) PythonObjectLibrary bufferLib ,
3118
3117
@ Cached CodeNodes .CreateCodeNode createCodeNode ,
3119
3118
@ Cached GetObjectArrayNode getObjectArrayNode ) throws UnsupportedMessageException {
3120
- byte [] codeBytes = codestringBufferLib .getBufferBytes (codestring );
3121
- byte [] lnotabBytes = lnotabBufferLib .getBufferBytes (lnotab );
3119
+ byte [] codeBytes = bufferLib .getBufferBytes (codestring );
3120
+ byte [] lnotabBytes = bufferLib .getBufferBytes (lnotab );
3122
3121
3123
3122
Object [] constantsArr = getObjectArrayNode .execute (constants );
3124
3123
Object [] namesArr = getObjectArrayNode .execute (names );
@@ -3134,21 +3133,20 @@ Object call(VirtualFrame frame, Object cls, int argcount,
3134
3133
lnotabBytes );
3135
3134
}
3136
3135
3137
- @ Specialization (guards = {"codestringBufferLib .isBuffer(codestring)" , "lnotabBufferLib .isBuffer(lnotab)" }, limit = "2" , rewriteOn = UnsupportedMessageException .class )
3136
+ @ Specialization (guards = {"bufferLib .isBuffer(codestring)" , "bufferLib .isBuffer(lnotab)" }, rewriteOn = UnsupportedMessageException .class )
3138
3137
Object call (VirtualFrame frame , Object cls , Object argcount ,
3139
3138
int posonlyargcount , Object kwonlyargcount ,
3140
3139
Object nlocals , Object stacksize , Object flags ,
3141
3140
Object codestring , PTuple constants , PTuple names ,
3142
3141
PTuple varnames , Object filename , Object name ,
3143
3142
Object firstlineno , Object lnotab ,
3144
3143
PTuple freevars , PTuple cellvars ,
3145
- @ CachedLibrary ("codestring" ) PythonObjectLibrary codestringBufferLib ,
3146
- @ CachedLibrary ("lnotab" ) PythonObjectLibrary lnotabBufferLib ,
3144
+ @ CachedLibrary (limit = "2" ) PythonObjectLibrary bufferLib ,
3147
3145
@ CachedLibrary (limit = "2" ) PythonObjectLibrary objectLibrary ,
3148
3146
@ Cached CodeNodes .CreateCodeNode createCodeNode ,
3149
3147
@ Cached GetObjectArrayNode getObjectArrayNode ) throws UnsupportedMessageException {
3150
- byte [] codeBytes = codestringBufferLib .getBufferBytes (codestring );
3151
- byte [] lnotabBytes = lnotabBufferLib .getBufferBytes (lnotab );
3148
+ byte [] codeBytes = bufferLib .getBufferBytes (codestring );
3149
+ byte [] lnotabBytes = bufferLib .getBufferBytes (lnotab );
3152
3150
3153
3151
Object [] constantsArr = getObjectArrayNode .execute (constants );
3154
3152
Object [] namesArr = getObjectArrayNode .execute (names );
0 commit comments