@@ -49,16 +49,15 @@ typedef struct _positional_argstack {
49
49
PyObject * PyTruffle_GetArg (positional_argstack * p , PyObject * kwds , char * * kwdnames , unsigned char keywords_only ) {
50
50
void * out = NULL ;
51
51
if (!keywords_only ) {
52
- int l = truffle_invoke_i ( PY_TRUFFLE_CEXT , "PyObject_LEN" , to_java (p -> argv ));
52
+ int l = UPCALL_CEXT_I ( "PyObject_LEN" , native_to_java (p -> argv ));
53
53
if (p -> argnum < l ) {
54
54
out = PyTuple_GetItem (p -> argv , p -> argnum );
55
55
}
56
56
}
57
57
if (out == NULL && p -> prev == NULL && kwdnames != NULL ) { // only the bottom argstack can have keyword names
58
58
const char * kwdname = kwdnames [p -> argnum ];
59
59
if (kwdname != NULL ) {
60
- PyObject * nameobj = to_sulong (truffle_read_string (kwdname ));
61
- out = PyDict_GetItem (kwds , nameobj );
60
+ out = PyDict_GetItemString (kwds , kwdname );
62
61
}
63
62
}
64
63
(p -> argnum )++ ;
@@ -328,7 +327,7 @@ int PyTruffle_Arg_ParseTupleAndKeywords(PyObject *argv, PyObject *kwds, const ch
328
327
case 'p' :
329
328
arg = PyTruffle_GetArg (v , kwds , kwdnames , rest_keywords_only );
330
329
PyTruffle_SkipOptionalArg (output_idx , arg , rest_optional );
331
- PyTruffle_WriteOut (output_idx , int , as_int ( truffle_invoke ( to_java (arg ), "__bool__" )));
330
+ PyTruffle_WriteOut (output_idx , int , ( UPCALL_I ( native_to_java (arg ), "__bool__" )));
332
331
break ;
333
332
case '(' :
334
333
arg = PyTruffle_GetArg (v , kwds , kwdnames , rest_keywords_only );
@@ -389,7 +388,7 @@ typedef struct _build_stack {
389
388
} build_stack ;
390
389
391
390
PyObject * _Py_BuildValue_SizeT (const char * format , ...) {
392
- # define ARG truffle_get_arg (value_idx)
391
+ # define ARG polyglot_get_arg (value_idx)
393
392
# define APPEND_VALUE (list , value ) PyList_Append(list, value); value_idx++
394
393
395
394
PyObject * (* converter )(void * ) = NULL ;
@@ -409,7 +408,7 @@ PyObject* _Py_BuildValue_SizeT(const char *format, ...) {
409
408
case 'z' :
410
409
case 'U' :
411
410
if (format [format_idx + 1 ] == '#' ) {
412
- int size = (int )truffle_get_arg (value_idx + 1 );
411
+ int size = (int )polyglot_get_arg (value_idx + 1 );
413
412
if (ARG == NULL ) {
414
413
APPEND_VALUE (list , Py_None );
415
414
} else {
@@ -427,7 +426,7 @@ PyObject* _Py_BuildValue_SizeT(const char *format, ...) {
427
426
break ;
428
427
case 'y' :
429
428
if (format [format_idx + 1 ] == '#' ) {
430
- int size = (int )truffle_get_arg (value_idx + 1 );
429
+ int size = (int )polyglot_get_arg (value_idx + 1 );
431
430
if (ARG == NULL ) {
432
431
APPEND_VALUE (list , Py_None );
433
432
} else {
@@ -488,7 +487,7 @@ PyObject* _Py_BuildValue_SizeT(const char *format, ...) {
488
487
break ;
489
488
case 'O' :
490
489
if (format [format_idx + 1 ] == '&' ) {
491
- converter = truffle_get_arg (value_idx + 1 );
490
+ converter = polyglot_get_arg (value_idx + 1 );
492
491
}
493
492
case 'S' :
494
493
case 'N' :
0 commit comments