[Python-checkins] gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (#99461)

gvanrossum webhook-mailer at python.org
Tue Nov 15 12:54:15 EST 2022


https://github.com/python/cpython/commit/86a49e06733b6ae9fef8de0c7e6db93ee87a2e32
commit: 86a49e06733b6ae9fef8de0c7e6db93ee87a2e32
branch: main
author: Hood Chatham <roberthoodchatham at gmail.com>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2022-11-15T09:53:39-08:00
summary:

gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (#99461)

files:
M Python/bytecodes.c
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index da3ab9126eee..69ee741d5df0 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -3192,7 +3192,7 @@ dummy_func(
                 goto error;
             }
             PyObject *arg = TOP();
-            PyObject *res = cfunc(PyCFunction_GET_SELF(callable), arg);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, PyCFunction_GET_SELF(callable), arg);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
 
@@ -3393,7 +3393,7 @@ dummy_func(
             if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
                 goto error;
             }
-            PyObject *res = cfunc(self, arg);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, self, arg);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
             Py_DECREF(self);
@@ -3465,7 +3465,7 @@ dummy_func(
             if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
                 goto error;
             }
-            PyObject *res = cfunc(self, NULL);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, self, NULL);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
             Py_DECREF(self);
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 2ad7cc9e6578..552d0e6d0178 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -3201,7 +3201,7 @@
                 goto error;
             }
             PyObject *arg = TOP();
-            PyObject *res = cfunc(PyCFunction_GET_SELF(callable), arg);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, PyCFunction_GET_SELF(callable), arg);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
 
@@ -3402,7 +3402,7 @@
             if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
                 goto error;
             }
-            PyObject *res = cfunc(self, arg);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, self, arg);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
             Py_DECREF(self);
@@ -3474,7 +3474,7 @@
             if (_Py_EnterRecursiveCallTstate(tstate, " while calling a Python object")) {
                 goto error;
             }
-            PyObject *res = cfunc(self, NULL);
+            PyObject *res = _PyCFunction_TrampolineCall(cfunc, self, NULL);
             _Py_LeaveRecursiveCallTstate(tstate);
             assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
             Py_DECREF(self);



More information about the Python-checkins mailing list