Skip to content

Commit 2960f7f

Browse files
committed
remove now unnecessary function
1 parent cd58a47 commit 2960f7f

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ static void initialize_capi() {
148148
initialize_bufferprocs();
149149
}
150150

151-
152-
__attribute__((always_inline))
153-
inline PyObject* handle_exception_and_cast(void* val) {
154-
return val == ERROR_MARKER ? NULL : val;
155-
}
156-
157151
__attribute__((always_inline))
158152
inline void* handle_exception(void* val) {
159153
return val == ERROR_MARKER ? NULL : val;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PyAPI_DATA(PyTypeObject) _PyExc_BaseException;
8686
/* upcall macros for calling into Python */
8787

8888
/* Call function with return type 'PyObject *'; does polyglot cast and error handling */
89-
#define UPCALL_O(__recv__, __name__, ...) handle_exception_and_cast(PY_TRUFFLE_LANDING((__recv__), polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
89+
#define UPCALL_O(__recv__, __name__, ...) handle_exception(PY_TRUFFLE_LANDING((__recv__), polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
9090

9191
/* Call function with a primitive return; no polyglot cast but error handling */
9292
#define UPCALL_P(__recv__, __name__, ...) (PY_TRUFFLE_LANDING_L((__recv__), polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
@@ -98,13 +98,13 @@ PyAPI_DATA(PyTypeObject) _PyExc_BaseException;
9898
#define UPCALL_L(__recv__, __name__, ...) UPCALL_P(__recv__, __name__, ##__VA_ARGS__)
9999

100100
/* Call function with return type 'double'; no polyglot cast but error handling */
101-
#define UPCALL_D(__recv__, __name__, ...) handle_exception_and_cast(PY_TRUFFLE_LANDING_D((__recv__), polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
101+
#define UPCALL_D(__recv__, __name__, ...) handle_exception(PY_TRUFFLE_LANDING_D((__recv__), polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
102102

103103
/* Call function with return type 'void*'; no polyglot cast and no error handling */
104104
#define UPCALL_PTR(__name__, ...) (PY_TRUFFLE_LANDING_PTR(polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
105105

106106
/* Call function of 'python_cext' module with return type 'PyObject *'; does polyglot cast and error handling */
107-
#define UPCALL_CEXT_O(__name__, ...) handle_exception_and_cast(PY_TRUFFLE_CEXT_LANDING(polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
107+
#define UPCALL_CEXT_O(__name__, ...) handle_exception(PY_TRUFFLE_CEXT_LANDING(polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
108108

109109
/* Call void function of 'python_cext' module; no polyglot cast and no error handling */
110110
#define UPCALL_CEXT_VOID(__name__, ...) (PY_TRUFFLE_CEXT_LANDING(polyglot_from_string((__name__), SRC_CS), ##__VA_ARGS__))
@@ -139,7 +139,6 @@ PyAPI_DATA(PyTypeObject) _PyExc_BaseException;
139139
#define as_float(obj) ((float)as_double(obj))
140140

141141

142-
PyObject* handle_exception_and_cast(void* val);
143142
void* handle_exception(void* val);
144143
void* native_to_java(PyObject* obj);
145144
extern void* to_java(PyObject* obj);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ PyObject * PyUnicode_DecodeUTF32(const char *s, Py_ssize_t size, const char *err
228228
PyObject *result;
229229
void *jerrors = errors != NULL ? polyglot_from_string(errors, SRC_CS) : NULL;
230230
int bo = byteorder != NULL ? *byteorder : 0;
231-
return handle_exception_and_cast(polyglot_invoke(PY_TRUFFLE_CEXT, "PyTruffle_Unicode_DecodeUTF32", s, size, native_to_java(jerrors), bo, ERROR_MARKER));
231+
return handle_exception(polyglot_invoke(PY_TRUFFLE_CEXT, "PyTruffle_Unicode_DecodeUTF32", s, size, native_to_java(jerrors), bo, ERROR_MARKER));
232232
}
233233

234234
Py_ssize_t PyUnicode_AsWideChar(PyObject *unicode, wchar_t *w, Py_ssize_t size) {

0 commit comments

Comments
 (0)