|
3835 | 3835 | assert(self != NULL); |
3836 | 3836 | STAT_INC(CALL, hit); |
3837 | 3837 | _PyFrame_SetStackPointer(frame, stack_pointer); |
| 3838 | + PyCFunctionFast cfunc = _PyCFunctionFast_CAST(method->d_method->ml_meth); |
3838 | 3839 | PyObject *res_o = _PyCallMethodDescriptorFast_StackRefSteal( |
3839 | 3840 | callable, |
3840 | | - method->d_method, |
| 3841 | + cfunc, |
3841 | 3842 | self, |
3842 | 3843 | arguments, |
3843 | 3844 | total_args |
|
3931 | 3932 | assert(self != NULL); |
3932 | 3933 | STAT_INC(CALL, hit); |
3933 | 3934 | _PyFrame_SetStackPointer(frame, stack_pointer); |
| 3935 | + PyCFunctionFastWithKeywords cfunc = _PyCFunctionFastWithKeywords_CAST(method->d_method->ml_meth); |
3934 | 3936 | PyObject *res_o = _PyCallMethodDescriptorFastWithKeywords_StackRefSteal( |
3935 | 3937 | callable, |
3936 | | - method->d_method, |
| 3938 | + cfunc, |
3937 | 3939 | self, |
3938 | 3940 | arguments, |
3939 | 3941 | total_args |
|
4012 | 4014 | JUMP_TO_PREDICTED(CALL); |
4013 | 4015 | } |
4014 | 4016 | } |
| 4017 | + // _CHECK_RECURSION_LIMIT |
| 4018 | + { |
| 4019 | + if (_Py_ReachedRecursionLimit(tstate)) { |
| 4020 | + UPDATE_MISS_STATS(CALL); |
| 4021 | + assert(_PyOpcode_Deopt[opcode] == (CALL)); |
| 4022 | + JUMP_TO_PREDICTED(CALL); |
| 4023 | + } |
| 4024 | + } |
4015 | 4025 | // _CALL_METHOD_DESCRIPTOR_NOARGS |
4016 | 4026 | { |
4017 | 4027 | PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); |
|
4022 | 4032 | } |
4023 | 4033 | _PyStackRef self_stackref = args[0]; |
4024 | 4034 | PyObject *self = PyStackRef_AsPyObjectBorrow(self_stackref); |
4025 | | - if (_Py_ReachedRecursionLimit(tstate)) { |
4026 | | - UPDATE_MISS_STATS(CALL); |
4027 | | - assert(_PyOpcode_Deopt[opcode] == (CALL)); |
4028 | | - JUMP_TO_PREDICTED(CALL); |
4029 | | - } |
4030 | 4035 | STAT_INC(CALL, hit); |
4031 | 4036 | PyCFunction cfunc = method->d_method->ml_meth; |
4032 | 4037 | _PyFrame_SetStackPointer(frame, stack_pointer); |
|
4117 | 4122 | JUMP_TO_PREDICTED(CALL); |
4118 | 4123 | } |
4119 | 4124 | } |
| 4125 | + // _CHECK_RECURSION_LIMIT |
| 4126 | + { |
| 4127 | + if (_Py_ReachedRecursionLimit(tstate)) { |
| 4128 | + UPDATE_MISS_STATS(CALL); |
| 4129 | + assert(_PyOpcode_Deopt[opcode] == (CALL)); |
| 4130 | + JUMP_TO_PREDICTED(CALL); |
| 4131 | + } |
| 4132 | + } |
4120 | 4133 | // _CALL_METHOD_DESCRIPTOR_O |
4121 | 4134 | { |
4122 | 4135 | PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); |
|
4125 | 4138 | if (!PyStackRef_IsNull(self_or_null)) { |
4126 | 4139 | arguments--; |
4127 | 4140 | } |
4128 | | - if (_Py_ReachedRecursionLimit(tstate)) { |
4129 | | - UPDATE_MISS_STATS(CALL); |
4130 | | - assert(_PyOpcode_Deopt[opcode] == (CALL)); |
4131 | | - JUMP_TO_PREDICTED(CALL); |
4132 | | - } |
4133 | | - _PyStackRef arg_stackref = arguments[1]; |
4134 | | - _PyStackRef self_stackref = arguments[0]; |
4135 | 4141 | STAT_INC(CALL, hit); |
4136 | 4142 | PyCFunction cfunc = method->d_method->ml_meth; |
| 4143 | + PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]); |
| 4144 | + PyObject *arg = PyStackRef_AsPyObjectBorrow(arguments[1]); |
4137 | 4145 | _PyFrame_SetStackPointer(frame, stack_pointer); |
4138 | | - PyObject *res_o = _PyCFunction_TrampolineCall(cfunc, |
4139 | | - PyStackRef_AsPyObjectBorrow(self_stackref), |
4140 | | - PyStackRef_AsPyObjectBorrow(arg_stackref)); |
| 4146 | + PyObject *res_o = _PyCFunction_TrampolineCall(cfunc, self, arg); |
4141 | 4147 | stack_pointer = _PyFrame_GetStackPointer(frame); |
4142 | 4148 | _Py_LeaveRecursiveCallTstate(tstate); |
4143 | 4149 | assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); |
|
5615 | 5621 | PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); |
5616 | 5622 | PyObject *dict_o = PyStackRef_AsPyObjectBorrow(dict); |
5617 | 5623 | PyObject *update_o = PyStackRef_AsPyObjectBorrow(update); |
| 5624 | + PyObject *dupkey = NULL; |
5618 | 5625 | _PyFrame_SetStackPointer(frame, stack_pointer); |
5619 | | - int err = _PyDict_MergeEx(dict_o, update_o, 2); |
| 5626 | + int err = _PyDict_MergeUniq(dict_o, update_o, &dupkey); |
5620 | 5627 | stack_pointer = _PyFrame_GetStackPointer(frame); |
5621 | 5628 | if (err < 0) { |
5622 | 5629 | _PyFrame_SetStackPointer(frame, stack_pointer); |
5623 | | - _PyEval_FormatKwargsError(tstate, callable_o, update_o); |
| 5630 | + _PyEval_FormatKwargsError(tstate, callable_o, update_o, dupkey); |
| 5631 | + Py_XDECREF(dupkey); |
5624 | 5632 | stack_pointer = _PyFrame_GetStackPointer(frame); |
5625 | 5633 | JUMP_TO_LABEL(error); |
5626 | 5634 | } |
|
9424 | 9432 | INSTRUCTION_STATS(LIST_EXTEND); |
9425 | 9433 | _PyStackRef list_st; |
9426 | 9434 | _PyStackRef iterable_st; |
9427 | | - iterable_st = stack_pointer[-1]; |
9428 | | - list_st = stack_pointer[-2 - (oparg-1)]; |
9429 | | - PyObject *list = PyStackRef_AsPyObjectBorrow(list_st); |
9430 | | - PyObject *iterable = PyStackRef_AsPyObjectBorrow(iterable_st); |
9431 | | - _PyFrame_SetStackPointer(frame, stack_pointer); |
9432 | | - PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); |
9433 | | - stack_pointer = _PyFrame_GetStackPointer(frame); |
9434 | | - if (none_val == NULL) { |
| 9435 | + _PyStackRef i; |
| 9436 | + _PyStackRef value; |
| 9437 | + // _LIST_EXTEND |
| 9438 | + { |
| 9439 | + iterable_st = stack_pointer[-1]; |
| 9440 | + list_st = stack_pointer[-2 - (oparg-1)]; |
| 9441 | + PyObject *list = PyStackRef_AsPyObjectBorrow(list_st); |
| 9442 | + PyObject *iterable = PyStackRef_AsPyObjectBorrow(iterable_st); |
9435 | 9443 | _PyFrame_SetStackPointer(frame, stack_pointer); |
9436 | | - int matches = _PyErr_ExceptionMatches(tstate, PyExc_TypeError); |
| 9444 | + PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); |
9437 | 9445 | stack_pointer = _PyFrame_GetStackPointer(frame); |
9438 | | - if (matches && |
9439 | | - (Py_TYPE(iterable)->tp_iter == NULL && !PySequence_Check(iterable))) |
9440 | | - { |
| 9446 | + if (none_val == NULL) { |
9441 | 9447 | _PyFrame_SetStackPointer(frame, stack_pointer); |
9442 | | - _PyErr_Clear(tstate); |
9443 | | - _PyErr_Format(tstate, PyExc_TypeError, |
| 9448 | + int matches = _PyErr_ExceptionMatches(tstate, PyExc_TypeError); |
| 9449 | + stack_pointer = _PyFrame_GetStackPointer(frame); |
| 9450 | + if (matches && |
| 9451 | + (Py_TYPE(iterable)->tp_iter == NULL && !PySequence_Check(iterable))) |
| 9452 | + { |
| 9453 | + _PyFrame_SetStackPointer(frame, stack_pointer); |
| 9454 | + _PyErr_Clear(tstate); |
| 9455 | + _PyErr_Format(tstate, PyExc_TypeError, |
9444 | 9456 | "Value after * must be an iterable, not %.200s", |
9445 | 9457 | Py_TYPE(iterable)->tp_name); |
9446 | | - stack_pointer = _PyFrame_GetStackPointer(frame); |
| 9458 | + stack_pointer = _PyFrame_GetStackPointer(frame); |
| 9459 | + } |
| 9460 | + JUMP_TO_LABEL(error); |
9447 | 9461 | } |
| 9462 | + assert(Py_IsNone(none_val)); |
| 9463 | + i = iterable_st; |
| 9464 | + } |
| 9465 | + // _POP_TOP |
| 9466 | + { |
| 9467 | + value = i; |
9448 | 9468 | stack_pointer += -1; |
9449 | 9469 | ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
9450 | 9470 | _PyFrame_SetStackPointer(frame, stack_pointer); |
9451 | | - PyStackRef_CLOSE(iterable_st); |
| 9471 | + PyStackRef_XCLOSE(value); |
9452 | 9472 | stack_pointer = _PyFrame_GetStackPointer(frame); |
9453 | | - JUMP_TO_LABEL(error); |
9454 | 9473 | } |
9455 | | - assert(Py_IsNone(none_val)); |
9456 | | - stack_pointer += -1; |
9457 | | - ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
9458 | | - _PyFrame_SetStackPointer(frame, stack_pointer); |
9459 | | - PyStackRef_CLOSE(iterable_st); |
9460 | | - stack_pointer = _PyFrame_GetStackPointer(frame); |
9461 | 9474 | DISPATCH(); |
9462 | 9475 | } |
9463 | 9476 |
|
|
0 commit comments