@@ -256,8 +256,8 @@ private static void initCodecClasses(PythonModule codecsTruffleModule, PythonMod
256
256
// return _codecs.__truffle_decode__(input, self.encoding, errors, True)
257
257
codecsTruffleBuiltins .truffleCodecClass = initClass (T_TRUFFLE_CODEC , (PythonClass ) codecsModule .getAttribute (T_CODEC ),
258
258
new BuiltinDescr []{
259
- new BuiltinDescr (() -> EncodeNodeGen . create () , EncodeNode .class , false ),
260
- new BuiltinDescr (() -> CodecDecodeNodeGen . create () , CodecDecodeNode .class , true )},
259
+ new BuiltinDescr (EncodeNodeGen :: create , EncodeNode .class , false ),
260
+ new BuiltinDescr (CodecDecodeNodeGen :: create , CodecDecodeNode .class , true )},
261
261
codecsTruffleModule , language , factory );
262
262
263
263
// class TruffleIncrementalEncoder(codecs.IncrementalEncoder):
@@ -268,8 +268,8 @@ private static void initCodecClasses(PythonModule codecsTruffleModule, PythonMod
268
268
// return _codecs.__truffle_encode__(input, self.encoding, self.errors)[0]
269
269
codecsTruffleBuiltins .truffleIncrementalEncoderClass = initClass (T_TRUFFLE_INCREMENTAL_ENCODER , T_INCREMENTAL_ENCODER ,
270
270
new BuiltinDescr []{
271
- new BuiltinDescr (() -> CodecInitNodeGen . create () , CodecInitNode .class , false ),
272
- new BuiltinDescr (() -> IncrementalEncodeNodeGen . create () , IncrementalEncodeNode .class , true )},
271
+ new BuiltinDescr (CodecInitNodeGen :: create , CodecInitNode .class , false ),
272
+ new BuiltinDescr (IncrementalEncodeNodeGen :: create , IncrementalEncodeNode .class , true )},
273
273
codecsTruffleModule , codecsModule , language , factory );
274
274
275
275
// class TruffleIncrementalDecoder(codecs.BufferedIncrementalDecoder):
@@ -280,8 +280,8 @@ private static void initCodecClasses(PythonModule codecsTruffleModule, PythonMod
280
280
// return _codecs.__truffle_decode__(input, self.encoding, errors, final)
281
281
codecsTruffleBuiltins .truffleIncrementalDecoderClass = initClass (T_TRUFFLE_INCREMENTAL_DECODER , T_BUFFERED_INCREMENTAL_DECODER ,
282
282
new BuiltinDescr []{
283
- new BuiltinDescr (() -> CodecInitNodeGen . create () , CodecInitNode .class , false ),
284
- new BuiltinDescr (() -> IncrementalDecodeNodeGen . create () , IncrementalDecodeNode .class , true )},
283
+ new BuiltinDescr (CodecInitNodeGen :: create , CodecInitNode .class , false ),
284
+ new BuiltinDescr (IncrementalDecodeNodeGen :: create , IncrementalDecodeNode .class , true )},
285
285
codecsTruffleModule , codecsModule , language , factory );
286
286
287
287
// class TruffleStreamWriter(codecs.StreamWriter):
@@ -292,8 +292,8 @@ private static void initCodecClasses(PythonModule codecsTruffleModule, PythonMod
292
292
// return _codecs.__truffle_encode__(input, self.encoding, errors)
293
293
codecsTruffleBuiltins .truffleStreamWriterClass = initClass (T_TRUFFLE_STREAM_WRITER , T_STREAM_WRITER ,
294
294
new BuiltinDescr []{
295
- new BuiltinDescr (() -> CodecInitNodeGen . create () , CodecInitNode .class , false ),
296
- new BuiltinDescr (() -> EncodeNodeGen . create () , EncodeNode .class , true )},
295
+ new BuiltinDescr (CodecInitNodeGen :: create , CodecInitNode .class , false ),
296
+ new BuiltinDescr (EncodeNodeGen :: create , EncodeNode .class , true )},
297
297
codecsTruffleModule , codecsModule , language , factory );
298
298
299
299
// class TruffleStreamReader(codecs.StreamReader):
@@ -304,16 +304,16 @@ private static void initCodecClasses(PythonModule codecsTruffleModule, PythonMod
304
304
// return _codecs.__truffle_decode__(input, self.encoding, errors)
305
305
codecsTruffleBuiltins .truffleStreamReaderClass = initClass (T_TRUFFLE_STREAM_READER , T_STREAM_READER ,
306
306
new BuiltinDescr []{
307
- new BuiltinDescr (() -> CodecInitNodeGen . create () , CodecInitNode .class , false ),
308
- new BuiltinDescr (() -> StreamDecodeNodeGen . create () , StreamDecodeNode .class , true )},
307
+ new BuiltinDescr (CodecInitNodeGen :: create , CodecInitNode .class , false ),
308
+ new BuiltinDescr (StreamDecodeNodeGen :: create , StreamDecodeNode .class , true )},
309
309
codecsTruffleModule , codecsModule , language , factory );
310
310
311
311
// serves as factory function for CodecInfo-s incrementalencoder/decode and streamwriter/reader
312
312
// class apply_encoding:
313
313
// def __call__(self, *args, **kwargs):
314
314
// return self.fn(self.encoding, *args, **kwargs)
315
315
codecsTruffleBuiltins .applyEncodingClass = initClass (T_APPLY_ENCODING , context .lookupType (PythonBuiltinClassType .PythonObject ),
316
- new BuiltinDescr []{new BuiltinDescr (() -> CallApplyNodeGen . create () , CallApplyNode .class , false )},
316
+ new BuiltinDescr []{new BuiltinDescr (CallApplyNodeGen :: create , CallApplyNode .class , false )},
317
317
codecsTruffleModule , language , factory );
318
318
}
319
319
// @formatter:on
@@ -360,7 +360,7 @@ Object call(VirtualFrame frame, PythonObject self, Object[] args, PKeyword[] kw,
360
360
}
361
361
}
362
362
363
- @ Builtin (name = J_ENCODE , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 3 )
363
+ @ Builtin (name = J_ENCODE , minNumOfPositionalArgs = 2 , parameterNames = { "self" , "input" , "errors" } )
364
364
protected abstract static class EncodeNode extends PythonTernaryBuiltinNode {
365
365
@ Specialization
366
366
Object encode (VirtualFrame frame , PythonObject self , Object input , Object errors ,
@@ -370,7 +370,7 @@ Object encode(VirtualFrame frame, PythonObject self, Object input, Object errors
370
370
}
371
371
}
372
372
373
- @ Builtin (name = J_DECODE , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 3 )
373
+ @ Builtin (name = J_DECODE , minNumOfPositionalArgs = 1 , parameterNames = { "self" , "input" , "errors" } )
374
374
protected abstract static class CodecDecodeNode extends PythonTernaryBuiltinNode {
375
375
@ Specialization
376
376
Object decode (VirtualFrame frame , PythonObject self , Object input , Object errors ,
@@ -380,7 +380,7 @@ Object decode(VirtualFrame frame, PythonObject self, Object input, Object errors
380
380
}
381
381
}
382
382
383
- @ Builtin (name = J_ENCODE , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 3 )
383
+ @ Builtin (name = J_ENCODE , minNumOfPositionalArgs = 2 , parameterNames = { "self" , "input" , "final" } )
384
384
protected abstract static class IncrementalEncodeNode extends PythonTernaryBuiltinNode {
385
385
@ Specialization
386
386
Object encode (VirtualFrame frame , PythonObject self , Object input , @ SuppressWarnings ("unused" ) Object ffinal ,
@@ -392,7 +392,7 @@ Object encode(VirtualFrame frame, PythonObject self, Object input, @SuppressWarn
392
392
}
393
393
}
394
394
395
- @ Builtin (name = J_BUFFER_DECODE , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 4 )
395
+ @ Builtin (name = J_BUFFER_DECODE , minNumOfPositionalArgs = 1 , parameterNames = { "self" , "input" , "errors" , "final" } )
396
396
protected abstract static class IncrementalDecodeNode extends PythonQuaternaryBuiltinNode {
397
397
@ Specialization
398
398
Object decode (VirtualFrame frame , PythonObject self , Object input , Object errors , Object ffinal ,
@@ -402,13 +402,13 @@ Object decode(VirtualFrame frame, PythonObject self, Object input, Object errors
402
402
}
403
403
}
404
404
405
- @ Builtin (name = J_DECODE , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 4 )
406
- protected abstract static class StreamDecodeNode extends PythonQuaternaryBuiltinNode {
405
+ @ Builtin (name = J_DECODE , minNumOfPositionalArgs = 1 , parameterNames = { "self" , "input" , "errors" } )
406
+ protected abstract static class StreamDecodeNode extends PythonTernaryBuiltinNode {
407
407
@ Specialization
408
- Object decode (VirtualFrame frame , PythonObject self , Object input , Object errors , Object ffinal ,
408
+ Object decode (VirtualFrame frame , PythonObject self , Object input , Object errors ,
409
409
@ Cached PyObjectGetAttr getAttrNode ,
410
410
@ Cached CodecsDecodeNode decode ) {
411
- return decode .execute (frame , input , getAttrNode .execute (frame , self , T_ATTR_ENCODING ), errors , ffinal );
411
+ return decode .execute (frame , input , getAttrNode .execute (frame , self , T_ATTR_ENCODING ), errors , false );
412
412
}
413
413
}
414
414
0 commit comments