File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Original file line number Diff line number Diff line change @@ -4607,8 +4607,21 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
4607
4607
kwnames = NULL ;
4608
4608
postcall_shrink = 1 ;
4609
4609
call_function :
4610
- // Check if the call can be inlined or not
4611
4610
function = PEEK (oparg + 1 );
4611
+ if (Py_TYPE (function ) == & PyMethod_Type ) {
4612
+ PyObject * meth = ((PyMethodObject * )function )-> im_func ;
4613
+ PyObject * self = ((PyMethodObject * )function )-> im_self ;
4614
+ Py_INCREF (meth );
4615
+ Py_INCREF (self );
4616
+ PEEK (oparg + 1 ) = self ;
4617
+ Py_DECREF (function );
4618
+ function = meth ;
4619
+ oparg ++ ;
4620
+ nargs ++ ;
4621
+ assert (postcall_shrink >= 1 );
4622
+ postcall_shrink -- ;
4623
+ }
4624
+ // Check if the call can be inlined or not
4612
4625
if (Py_TYPE (function ) == & PyFunction_Type && tstate -> interp -> eval_frame == NULL ) {
4613
4626
int code_flags = ((PyCodeObject * )PyFunction_GET_CODE (function ))-> co_flags ;
4614
4627
int is_generator = code_flags & (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR );
You can’t perform that action at this time.
0 commit comments