Skip to content

Commit 1fc66cb

Browse files
committed
Remove remaining 'truffle_invoke' usages.
1 parent bb87415 commit 1fc66cb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

graalpython/com.oracle.graal.python.cext/include/Python.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@
107107
#include "pyfpe.h"
108108
#include "memoryobject.h"
109109

110-
#undef Py_NoValue
111-
#define Py_NoValue truffle_invoke(PY_TRUFFLE_CEXT, "Py_NoValue")
110+
#define PY_TRUFFLE_CEXT ((void*)polyglot_import("python_cext"))
111+
#define PY_BUILTIN ((void*)polyglot_import("python_builtins"))
112112

113-
#define PY_TRUFFLE_CEXT ((void*)truffle_import_cached("python_cext"))
114-
#define PY_BUILTIN ((void*)truffle_import_cached("python_builtins"))
113+
#undef Py_NoValue
114+
#define Py_NoValue UPCALL_CEXT_O("Py_NoValue")
115115

116116
// TODO: we must extend the refcounting behavior to support handles to managed objects
117117
#undef Py_DECREF

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ inline PyObject* explicit_cast(PyObject* cobj) {
200200
}
201201

202202
PyObject* to_sulong(void *o) {
203-
return explicit_cast(truffle_invoke(PY_TRUFFLE_CEXT, "to_sulong", o));
203+
return explicit_cast(polyglot_invoke(PY_TRUFFLE_CEXT, "to_sulong", o));
204204
}
205205

206206
/** to be used from Java code only; reads native 'ob_type' field */
@@ -414,7 +414,7 @@ PyObject* WriteULongMember(PyObject* object, PyObject* offset, PyObject* value)
414414
}
415415

416416
PyObject* WriteBoolMember(PyObject* object, PyObject* offset, PyObject* value) {
417-
WriteMember(object, offset, truffle_invoke(to_java(value), "__bool__") == Py_True ? (char)1 : (char)0, char);
417+
WriteMember(object, offset, UPCALL_O(native_to_java(value), "__bool__") == Py_True ? (char)1 : (char)0, char);
418418
return value;
419419
}
420420

@@ -451,7 +451,7 @@ PyObject marker_struct = {
451451
#undef WriteMember
452452

453453
int PyTruffle_Debug(void *arg) {
454-
truffle_invoke(PY_TRUFFLE_CEXT, "PyTruffle_Debug", arg);
454+
polyglot_invoke(PY_TRUFFLE_CEXT, "PyTruffle_Debug", arg);
455455
return 0;
456456
}
457457

graalpython/com.oracle.graal.python.cext/src/pyhash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "capi.h"
4040

4141
Py_hash_t _Py_HashDouble(double value) {
42-
return truffle_invoke_l(PY_BUILTIN, "hash", value);
42+
return UPCALL_L(PY_BUILTIN, "hash", value);
4343
}
4444

4545
long _PyHASH_INF;

0 commit comments

Comments
 (0)