@@ -215,12 +215,12 @@ PyObject* to_sulong(void *o) {
215215/** to be used from Java code only; reads native 'ob_type' field */
216216void* get_ob_type(PyObject* obj) {
217217 PyTypeObject* type = obj->ob_type;
218- if (truffle_is_handle_to_managed (type)) {
218+ if (!truffle_cannot_be_handle (type)) {
219219 return resolve_handle(cache, (uint64_t)type);
220220 } else {
221221 // we have stored a handle to the Java class in ob_refcnt
222222 void* handle = (void*)((PyObject*)type)->ob_refcnt;
223- if (truffle_is_handle_to_managed (handle)) {
223+ if (!truffle_cannot_be_handle (handle)) {
224224 return resolve_handle(cache, (uint64_t)handle);
225225 } else {
226226 // assume handle is a TruffleObject
@@ -248,15 +248,15 @@ uint64_t PyTruffle_Wchar_Size() {
248248}
249249
250250void* PyObjectHandle_ForJavaObject(void* cobj, unsigned long flags) {
251- if (truffle_is_handle_to_managed (cobj)) {
251+ if (truffle_cannot_be_handle (cobj)) {
252252 return truffle_deref_handle_for_managed(cobj);
253253 }
254254 return cobj;
255255}
256256
257257/** to be used from Java code only; only creates the deref handle */
258258void* PyObjectHandle_ForJavaType(void* ptype) {
259- if (truffle_is_handle_to_managed (ptype)) {
259+ if (truffle_cannot_be_handle (ptype)) {
260260 return truffle_deref_handle_for_managed(ptype);
261261 }
262262 return ptype;
0 commit comments