281
281
import com .oracle .truffle .api .profiles .ConditionProfile ;
282
282
import com .oracle .truffle .api .profiles .ValueProfile ;
283
283
import com .oracle .truffle .api .utilities .CyclicAssumption ;
284
- import com .oracle .truffle .llvm .spi .ReferenceLibrary ;
285
284
286
285
@ CoreFunctions (defineModule = PythonCextBuiltins .PYTHON_CEXT )
287
286
@ GenerateNodeFactory
@@ -3276,10 +3275,10 @@ public Object varArgExecute(VirtualFrame frame, Object self, Object[] arguments,
3276
3275
return execute (frame , self , arguments , PKeyword .EMPTY_KEYWORDS );
3277
3276
}
3278
3277
3279
- public static int doConvert (CExtContext nativeContext , Object nativeNull , Object argv , Object nativeKwds , Object nativeFormat , Object nativeKwdnames , Object nativeVarargs ,
3280
- ReferenceLibrary kwdsRefLib ,
3281
- ReferenceLibrary kwdnamesRefLib ,
3282
- ValueProfile kwdsProfile ,
3278
+ public static int doConvert (CExtContext nativeContext , Object argv , Object nativeKwds , Object nativeFormat , Object nativeKwdnames , Object nativeVarargs ,
3279
+ InteropLibrary kwdsRefLib ,
3280
+ InteropLibrary kwdnamesRefLib ,
3281
+ ConditionProfile kwdsProfile ,
3283
3282
ConditionProfile kwdnamesProfile ,
3284
3283
ConditionProfile functionNameProfile ,
3285
3284
CExtAsPythonObjectNode kwdsToJavaNode ,
@@ -3308,16 +3307,16 @@ public static int doConvert(CExtContext nativeContext, Object nativeNull, Object
3308
3307
3309
3308
// sort out if kwds is native NULL
3310
3309
Object kwds ;
3311
- if (kwdsRefLib .isSame (nativeKwds , nativeNull )) {
3310
+ if (kwdsProfile . profile ( kwdsRefLib .isNull (nativeKwds ) )) {
3312
3311
kwds = null ;
3313
3312
} else {
3314
3313
kwds = kwdsToJavaNode .execute (nativeContext , nativeKwds );
3315
3314
}
3316
3315
3317
3316
// sort out if kwdnames is native NULL
3318
- Object kwdnames = kwdnamesProfile .profile (kwdnamesRefLib .isSame (nativeKwdnames , nativeNull )) ? null : nativeKwdnames ;
3317
+ Object kwdnames = kwdnamesProfile .profile (kwdnamesRefLib .isNull (nativeKwdnames )) ? null : nativeKwdnames ;
3319
3318
3320
- return parseTupleAndKeywordsNode .execute (functionName , argv , kwdsProfile . profile ( kwds ) , format , kwdnames , nativeVarargs , nativeContext );
3319
+ return parseTupleAndKeywordsNode .execute (functionName , argv , kwds , format , kwdnames , nativeVarargs , nativeContext );
3321
3320
}
3322
3321
3323
3322
static Object getKwds (Object [] arguments ) {
@@ -3334,23 +3333,20 @@ static Object getKwdnames(Object[] arguments) {
3334
3333
abstract static class ParseTupleAndKeywordsNode extends ParseTupleAndKeywordsBaseNode {
3335
3334
3336
3335
@ Specialization (guards = "arguments.length == 5" , limit = "2" )
3337
- static int doConvert (Object cextModule , Object [] arguments , @ SuppressWarnings ("unused" ) PKeyword [] keywords ,
3336
+ static int doConvert (Object self , Object [] arguments , @ SuppressWarnings ("unused" ) PKeyword [] keywords ,
3338
3337
@ CachedContext (PythonLanguage .class ) PythonContext context ,
3339
- @ CachedLibrary ("getKwds(arguments)" ) ReferenceLibrary kwdsRefLib ,
3340
- @ CachedLibrary ("getKwdnames(arguments)" ) ReferenceLibrary kwdnamesRefLib ,
3341
- @ Cached ("createIdentityProfile ()" ) ValueProfile kwdsProfile ,
3338
+ @ CachedLibrary ("getKwds(arguments)" ) InteropLibrary kwdsInteropLib ,
3339
+ @ CachedLibrary ("getKwdnames(arguments)" ) InteropLibrary kwdnamesRefLib ,
3340
+ @ Cached ("createBinaryProfile ()" ) ConditionProfile kwdsProfile ,
3342
3341
@ Cached ("createBinaryProfile()" ) ConditionProfile kwdnamesProfile ,
3343
3342
@ Cached ("createBinaryProfile()" ) ConditionProfile functionNameProfile ,
3344
3343
@ Cached CExtNodes .AsPythonObjectNode argvToJavaNode ,
3345
3344
@ Cached CExtNodes .AsPythonObjectNode kwdsToJavaNode ,
3346
3345
@ Cached CastToJavaStringNode castToStringNode ,
3347
- @ Cached CExtNodes .ToSulongNode nativeNullToSulongNode ,
3348
- @ Cached GetNativeNullNode getNativeNullNode ,
3349
3346
@ Cached CExtParseArgumentsNode .ParseTupleAndKeywordsNode parseTupleAndKeywordsNode ) {
3350
3347
CExtContext nativeContext = context .getCApiContext ();
3351
3348
Object argv = argvToJavaNode .execute (arguments [0 ]);
3352
- Object nativeNull = nativeNullToSulongNode .execute (getNativeNullNode .execute (cextModule ));
3353
- return ParseTupleAndKeywordsBaseNode .doConvert (nativeContext , nativeNull , argv , arguments [1 ], arguments [2 ], arguments [3 ], arguments [4 ], kwdsRefLib , kwdnamesRefLib , kwdsProfile ,
3349
+ return ParseTupleAndKeywordsBaseNode .doConvert (nativeContext , argv , arguments [1 ], arguments [2 ], arguments [3 ], arguments [4 ], kwdsInteropLib , kwdnamesRefLib , kwdsProfile ,
3354
3350
kwdnamesProfile , functionNameProfile , kwdsToJavaNode , castToStringNode , parseTupleAndKeywordsNode );
3355
3351
}
3356
3352
@@ -3361,25 +3357,22 @@ static int doConvert(Object cextModule, Object[] arguments, @SuppressWarnings("u
3361
3357
abstract static class ParseTupleAndKeywordsVaListNode extends ParseTupleAndKeywordsBaseNode {
3362
3358
3363
3359
@ Specialization (guards = "arguments.length == 5" , limit = "2" )
3364
- static int doConvert (Object cextModule , Object [] arguments , @ SuppressWarnings ("unused" ) PKeyword [] keywords ,
3360
+ static int doConvert (Object self , Object [] arguments , @ SuppressWarnings ("unused" ) PKeyword [] keywords ,
3365
3361
@ CachedContext (PythonLanguage .class ) PythonContext context ,
3366
- @ CachedLibrary ("getKwds(arguments)" ) ReferenceLibrary kwdsRefLib ,
3367
- @ CachedLibrary ("getKwdnames(arguments)" ) ReferenceLibrary kwdnamesRefLib ,
3368
- @ Cached ("createIdentityProfile ()" ) ValueProfile kwdsProfile ,
3362
+ @ CachedLibrary ("getKwds(arguments)" ) InteropLibrary kwdsRefLib ,
3363
+ @ CachedLibrary ("getKwdnames(arguments)" ) InteropLibrary kwdnamesRefLib ,
3364
+ @ Cached ("createBinaryProfile ()" ) ConditionProfile kwdsProfile ,
3369
3365
@ Cached ("createBinaryProfile()" ) ConditionProfile kwdnamesProfile ,
3370
3366
@ Cached ("createBinaryProfile()" ) ConditionProfile functionNameProfile ,
3371
3367
@ Cached PCallCExtFunction callMallocOutVarPtr ,
3372
3368
@ Cached CExtNodes .AsPythonObjectNode argvToJavaNode ,
3373
3369
@ Cached CExtNodes .AsPythonObjectNode kwdsToJavaNode ,
3374
3370
@ Cached CastToJavaStringNode castToStringNode ,
3375
- @ Cached CExtNodes .ToSulongNode nativeNullToSulongNode ,
3376
- @ Cached GetNativeNullNode getNativeNullNode ,
3377
3371
@ Cached CExtParseArgumentsNode .ParseTupleAndKeywordsNode parseTupleAndKeywordsNode ) {
3378
3372
CExtContext nativeContext = context .getCApiContext ();
3379
- Object nativeNull = nativeNullToSulongNode .execute (getNativeNullNode .execute (cextModule ));
3380
3373
Object argv = argvToJavaNode .execute (arguments [0 ]);
3381
3374
VaListWrapper varargs = new VaListWrapper (nativeContext , arguments [4 ], callMallocOutVarPtr .call (nativeContext , NativeCAPISymbols .FUN_ALLOCATE_OUTVAR ));
3382
- return ParseTupleAndKeywordsBaseNode .doConvert (nativeContext , nativeNull , argv , arguments [1 ], arguments [2 ], arguments [3 ], varargs , kwdsRefLib , kwdnamesRefLib , kwdsProfile , kwdnamesProfile ,
3375
+ return ParseTupleAndKeywordsBaseNode .doConvert (nativeContext , argv , arguments [1 ], arguments [2 ], arguments [3 ], varargs , kwdsRefLib , kwdnamesRefLib , kwdsProfile , kwdnamesProfile ,
3383
3376
functionNameProfile , kwdsToJavaNode , castToStringNode , parseTupleAndKeywordsNode );
3384
3377
}
3385
3378
}
0 commit comments