PyList_SET_ITEM(list, index, PyStackRef_AsPyObjectSteal(value));
assert(old_value != NULL);
UNLOCK_OBJECT(list); // unlock before decrefs!
- Py_DECREF(old_value);
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
DEAD(sub_st);
PyStackRef_CLOSE(list_st);
+ Py_DECREF(old_value);
}
inst(STORE_SUBSCR_DICT, (unused/1, value, dict_st, sub -- )) {
if (err == 0) {
err = PySet_Add(set_o, PyStackRef_AsPyObjectBorrow(values[i]));
}
- PyStackRef_CLOSE(values[i]);
}
- DEAD(values);
+ DECREF_INPUTS();
if (err != 0) {
Py_DECREF(set_o);
ERROR_IF(true, error);
_PyDictValues_AddToInsertionOrder(values, index);
}
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
+ Py_XDECREF(old_value);
}
macro(STORE_ATTR_INSTANCE_VALUE) =
// old_value should be DECREFed after GC track checking is done, if not, it could raise a segmentation fault,
// when dict only holds the strong reference to value in ep->me_value.
- Py_XDECREF(old_value);
STAT_INC(STORE_ATTR, hit);
PyStackRef_CLOSE(owner);
+ Py_XDECREF(old_value);
}
macro(STORE_ATTR_WITH_HINT) =
PyObject *old_value = *(PyObject **)addr;
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
+ Py_XDECREF(old_value);
}
macro(STORE_ATTR_SLOT) =
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
// Check if the call can be inlined or not
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, total_args, NULL, frame
+ arguments, total_args, NULL, frame
);
// Manipulate stack directly since we leave using DISPATCH_INLINED().
SYNC_SP();
DISPATCH_INLINED(new_frame);
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(true, error);
}
PyObject *res_o = PyObject_Vectorcall(
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
if (opcode == INSTRUMENTED_CALL) {
PyObject *arg = total_args == 0 ?
- &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(args[0]);
+ &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(arguments[0]);
if (res_o == NULL) {
_Py_call_instrumentation_exc2(
tstate, PY_MONITORING_EVENT_C_RAISE,
}
}
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
NULL);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
DECREF_INPUTS();
ERROR_IF(true, error);
}
- DEAD(self_or_null);
PyObject *res_o = tp->tp_vectorcall((PyObject *)tp, args_o, total_args, NULL);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
- DEAD(args);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
DECREF_INPUTS();
ERROR_IF(true, error);
}
- DEAD(self_or_null);
PyObject *res_o = ((PyCFunctionFast)(void(*)(void))cfunc)(
PyCFunction_GET_SELF(callable_o),
args_o,
total_args);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
-
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
- DEAD(args);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
DEOPT_IF(!PyCFunction_CheckExact(callable_o));
DEOPT_IF(PyCFunction_GET_FLAGS(callable_o) != (METH_FASTCALL | METH_KEYWORDS));
STAT_INC(CALL, hit);
- /* res = func(self, args, nargs, kwnames) */
+ /* res = func(self, arguments, nargs, kwnames) */
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))
PyCFunction_GET_FUNCTION(callable_o);
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
}
PyObject *res_o = cfunc(PyCFunction_GET_SELF(callable_o), args_o, total_args, NULL);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
-
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
-
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
PyMethodDef *meth = method->d_method;
EXIT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS));
PyTypeObject *d_type = method->d_common.d_type;
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
EXIT_IF(!Py_IS_TYPE(self, d_type));
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
PyObject *res_o = cfunc(self, (args_o + 1), nargs, NULL);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
-
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
EXIT_IF(!Py_IS_TYPE(method, &PyMethodDescr_Type));
PyMethodDef *meth = method->d_method;
EXIT_IF(meth->ml_flags != METH_FASTCALL);
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
PyObject *res_o = cfunc(self, (args_o + 1), nargs);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
-
- /* Clear the stack of the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
int positional_args = total_args - (int)PyTuple_GET_SIZE(kwnames_o);
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
PyStackRef_CLOSE(kwnames);
// Sync stack explicitly since we leave using DISPATCH_INLINED().
DISPATCH_INLINED(new_frame);
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
if (opcode == INSTRUMENTED_CALL_KW) {
PyObject *arg = total_args == 0 ?
- &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(args[0]);
+ &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(arguments[0]);
if (res_o == NULL) {
_Py_call_instrumentation_exc2(
tstate, PY_MONITORING_EVENT_C_RAISE,
}
}
}
- PyStackRef_CLOSE(kwnames);
- assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
PyStackRef_CLOSE(kwnames);
// The frame has stolen all the arguments from the stack,
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
PyStackRef_CLOSE(kwnames);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
- DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ DECREF_INPUTS();
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
res_o = PyObject_GetItem(PyStackRef_AsPyObjectBorrow(container), slice);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(slice);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += 2;
assert(WITHIN_STACK_BOUNDS());
}
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
err = PyObject_SetItem(PyStackRef_AsPyObjectBorrow(container), slice, PyStackRef_AsPyObjectBorrow(v));
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(slice);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += 2;
assert(WITHIN_STACK_BOUNDS());
}
PyList_SET_ITEM(list, index, PyStackRef_AsPyObjectSteal(value));
assert(old_value != NULL);
UNLOCK_OBJECT(list); // unlock before decrefs!
- Py_DECREF(old_value);
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
PyStackRef_CLOSE(list_st);
stack_pointer += -3;
assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_DECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
break;
}
"'async for' received an object from __aiter__ "
"that does not implement __anext__: %.100s",
Py_TYPE(iter_o)->tp_name);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(iter_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (true) JUMP_TO_ERROR();
}
iter = PyStackRef_FromPyObjectSteal(iter_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
JUMP_TO_ERROR();
}
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(oldobj);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
break;
}
err = PySet_Add(set_o, PyStackRef_AsPyObjectBorrow(values[i]));
stack_pointer = _PyFrame_GetStackPointer(frame);
}
- PyStackRef_CLOSE(values[i]);
+ }
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(values[_i]);
}
if (err != 0) {
+ stack_pointer += -oparg;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(set_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (true) JUMP_TO_ERROR();
}
set = PyStackRef_FromPyObjectSteal(set_o);
_PyFrame_SetStackPointer(frame, stack_pointer);
err = PyObject_SetItem(LOCALS(), &_Py_ID(__annotations__),
ann_dict);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(ann_dict);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (err) JUMP_TO_ERROR();
}
else {
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(ann_dict);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
break;
}
_PyDictValues_AddToInsertionOrder(values, index);
}
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
break;
}
UNLOCK_OBJECT(dict);
// old_value should be DECREFed after GC track checking is done, if not, it could raise a segmentation fault,
// when dict only holds the strong reference to value in ep->me_value.
- Py_XDECREF(old_value);
STAT_INC(STORE_ATTR, hit);
PyStackRef_CLOSE(owner);
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
break;
}
PyObject *old_value = *(PyObject **)addr;
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
break;
}
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
int res_bool = PyObject_IsTrue(res_o);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(res_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_bool < 0) JUMP_TO_ERROR();
res = res_bool ? PyStackRef_True : PyStackRef_False;
}
tb = Py_None;
}
else {
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(tb);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
assert(PyStackRef_LongCheck(lasti));
(void)lasti; // Shut up compiler warning if asserts are off
#endif
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
PyObject *res_o = tp->tp_vectorcall((PyObject *)tp, args_o, total_args, NULL);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
if (!PyCFunction_CheckExact(callable_o)) {
JUMP_TO_JUMP_TARGET();
}
STAT_INC(CALL, hit);
- /* res = func(self, args, nargs, kwnames) */
+ /* res = func(self, arguments, nargs, kwnames) */
_PyFrame_SetStackPointer(frame, stack_pointer);
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))
PyCFunction_GET_FUNCTION(callable_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
callable = &stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
JUMP_TO_JUMP_TARGET();
}
PyTypeObject *d_type = method->d_common.d_type;
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
if (!Py_IS_TYPE(self, d_type)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
callable = &stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
if (!Py_IS_TYPE(self, method->d_common.d_type)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Clear the stack of the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-2 - oparg] = res;
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
PyStackRef_CLOSE(kwnames);
#endif
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
PyStackRef_CLOSE(kwnames);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) JUMP_TO_ERROR();
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[-3 - oparg] = res;
case _START_EXECUTOR: {
PyObject *executor = (PyObject *)CURRENT_OPERAND0();
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(tstate->previous_executor);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
tstate->previous_executor = NULL;
#ifndef _Py_JIT
current_executor = (_PyExecutorObject*)executor;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
res_o = PyObject_GetItem(PyStackRef_AsPyObjectBorrow(container), slice);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(slice);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += 2;
assert(WITHIN_STACK_BOUNDS());
}
err = PySet_Add(set_o, PyStackRef_AsPyObjectBorrow(values[i]));
stack_pointer = _PyFrame_GetStackPointer(frame);
}
- PyStackRef_CLOSE(values[i]);
+ }
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(values[_i]);
}
if (err != 0) {
+ stack_pointer += -oparg;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(set_o);
- {
- stack_pointer += -oparg;
- assert(WITHIN_STACK_BOUNDS());
- goto error;
- }
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ goto error;
}
set = PyStackRef_FromPyObjectSteal(set_o);
stack_pointer[-oparg] = set;
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
// Check if the call can be inlined or not
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, total_args, NULL, frame
+ arguments, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
// Manipulate stack directly since we leave using DISPATCH_INLINED().
DISPATCH_INLINED(new_frame);
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
{
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
if (opcode == INSTRUMENTED_CALL) {
PyObject *arg = total_args == 0 ?
- &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(args[0]);
+ &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(arguments[0]);
if (res_o == NULL) {
_PyFrame_SetStackPointer(frame, stack_pointer);
_Py_call_instrumentation_exc2(
}
}
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
PyObject *res_o = tp->tp_vectorcall((PyObject *)tp, args_o, total_args, NULL);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(arguments[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
DEOPT_IF(!PyCFunction_CheckExact(callable_o), CALL);
DEOPT_IF(PyCFunction_GET_FLAGS(callable_o) != (METH_FASTCALL | METH_KEYWORDS), CALL);
STAT_INC(CALL, hit);
- /* res = func(self, args, nargs, kwnames) */
+ /* res = func(self, arguments, nargs, kwnames) */
_PyFrame_SetStackPointer(frame, stack_pointer);
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))
PyCFunction_GET_FUNCTION(callable_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
int positional_args = total_args - (int)PyTuple_GET_SIZE(kwnames_o);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
PyStackRef_CLOSE(kwnames);
DISPATCH_INLINED(new_frame);
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
if (opcode == INSTRUMENTED_CALL_KW) {
PyObject *arg = total_args == 0 ?
- &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(args[0]);
+ &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(arguments[0]);
if (res_o == NULL) {
_PyFrame_SetStackPointer(frame, stack_pointer);
_Py_call_instrumentation_exc2(
}
}
}
- PyStackRef_CLOSE(kwnames);
- assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
+ PyStackRef_CLOSE(kwnames);
if (res_o == NULL) {
stack_pointer += -3 - oparg;
assert(WITHIN_STACK_BOUNDS());
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
PyStackRef_CLOSE(kwnames);
#endif
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
PyStackRef_CLOSE(kwnames);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -3 - oparg;
assert(WITHIN_STACK_BOUNDS());
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, positional_args, kwnames_o, frame
+ arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
PyStackRef_CLOSE(kwnames);
callable = &stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
DEOPT_IF(!Py_IS_TYPE(method, &PyMethodDescr_Type), CALL);
PyMethodDef *meth = method->d_method;
DEOPT_IF(meth->ml_flags != METH_FASTCALL, CALL);
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
DEOPT_IF(!Py_IS_TYPE(self, method->d_common.d_type), CALL);
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Clear the stack of the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
callable = &stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
PyMethodDef *meth = method->d_method;
DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL);
PyTypeObject *d_type = method->d_common.d_type;
- PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
+ PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
DEOPT_IF(!Py_IS_TYPE(self, d_type), CALL);
STAT_INC(CALL, hit);
int nargs = total_args - 1;
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- /* Free the arguments. */
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
#endif
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable[0]);
PyStackRef_XCLOSE(self_or_null[0]);
stack_pointer = _PyFrame_GetStackPointer(frame);
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
int res_bool = PyObject_IsTrue(res_o);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(res_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_bool < 0) goto error;
res = res_bool ? PyStackRef_True : PyStackRef_False;
}
stack_pointer = _PyFrame_GetStackPointer(frame);
goto error;
}
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(oldobj);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
DISPATCH();
}
#ifndef Py_GIL_DISABLED
if (seq != NULL) {
it->it_seq = NULL;
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(seq);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
#endif
/* Jump forward oparg, then skip following END_FOR instruction */
if (seq == NULL || it->it_index >= PyTuple_GET_SIZE(seq)) {
if (seq != NULL) {
it->it_seq = NULL;
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(seq);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
/* Jump forward oparg, then skip following END_FOR instruction */
JUMPBY(oparg + 1);
"'async for' received an object from __aiter__ "
"that does not implement __anext__: %.100s",
Py_TYPE(iter_o)->tp_name);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(iter_o);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
goto error;
}
iter = PyStackRef_FromPyObjectSteal(iter_o);
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
+ _PyStackRef *arguments = args;
if (!PyStackRef_IsNull(self_or_null[0])) {
- args--;
+ arguments--;
total_args++;
}
// Check if the call can be inlined or not
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
tstate, callable[0], locals,
- args, total_args, NULL, frame
+ arguments, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
// Manipulate stack directly since we leave using DISPATCH_INLINED().
DISPATCH_INLINED(new_frame);
}
/* Callable is not a normal Python function */
- STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
+ STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
{
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
if (opcode == INSTRUMENTED_CALL) {
PyObject *arg = total_args == 0 ?
- &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(args[0]);
+ &_PyInstrumentation_MISSING : PyStackRef_AsPyObjectBorrow(arguments[0]);
if (res_o == NULL) {
_PyFrame_SetStackPointer(frame, stack_pointer);
_Py_call_instrumentation_exc2(
}
}
assert((res_o != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
- for (int i = 0; i < total_args; i++) {
- PyStackRef_CLOSE(args[i]);
- }
PyStackRef_CLOSE(callable[0]);
+ PyStackRef_XCLOSE(self_or_null[0]);
+ for (int _i = oparg; --_i >= 0;) {
+ PyStackRef_CLOSE(args[_i]);
+ }
if (res_o == NULL) {
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
PyObject *attr_o = PyObject_GetAttr(super, name);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(super);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (attr_o == NULL) goto error;
attr = PyStackRef_FromPyObjectSteal(attr_o);
null = PyStackRef_NULL;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyErr_SetString(tstate, PyExc_SystemError, "lasti is not an int");
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(exc);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
goto error;
}
stack_pointer += 1;
_PyFrame_SetStackPointer(frame, stack_pointer);
err = PyObject_SetItem(LOCALS(), &_Py_ID(__annotations__),
ann_dict);
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(ann_dict);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
if (err) goto error;
}
else {
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(ann_dict);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
DISPATCH();
}
_PyDictValues_AddToInsertionOrder(values, index);
}
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
+ stack_pointer += -2;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
- stack_pointer += -2;
- assert(WITHIN_STACK_BOUNDS());
DISPATCH();
}
PyObject *old_value = *(PyObject **)addr;
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
UNLOCK_OBJECT(owner_o);
- Py_XDECREF(old_value);
PyStackRef_CLOSE(owner);
+ stack_pointer += -2;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
- stack_pointer += -2;
- assert(WITHIN_STACK_BOUNDS());
DISPATCH();
}
UNLOCK_OBJECT(dict);
// old_value should be DECREFed after GC track checking is done, if not, it could raise a segmentation fault,
// when dict only holds the strong reference to value in ep->me_value.
- Py_XDECREF(old_value);
STAT_INC(STORE_ATTR, hit);
PyStackRef_CLOSE(owner);
+ stack_pointer += -2;
+ assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_XDECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
- stack_pointer += -2;
- assert(WITHIN_STACK_BOUNDS());
DISPATCH();
}
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
err = PyObject_SetItem(PyStackRef_AsPyObjectBorrow(container), slice, PyStackRef_AsPyObjectBorrow(v));
- stack_pointer = _PyFrame_GetStackPointer(frame);
Py_DECREF(slice);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += 2;
assert(WITHIN_STACK_BOUNDS());
}
PyList_SET_ITEM(list, index, PyStackRef_AsPyObjectSteal(value));
assert(old_value != NULL);
UNLOCK_OBJECT(list); // unlock before decrefs!
- Py_DECREF(old_value);
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
PyStackRef_CLOSE(list_st);
stack_pointer += -3;
assert(WITHIN_STACK_BOUNDS());
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ Py_DECREF(old_value);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
DISPATCH();
}
tb = Py_None;
}
else {
+ _PyFrame_SetStackPointer(frame, stack_pointer);
Py_DECREF(tb);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
}
assert(PyStackRef_LongCheck(lasti));
(void)lasti; // Shut up compiler warning if asserts are off
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and add tests!
}
else {
res = sym_new_type(ctx, &PyLong_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and add tests!
}
else {
res = sym_new_type(ctx, &PyLong_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and add tests!
}
else {
res = sym_new_type(ctx, &PyLong_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and update tests!
}
else {
res = sym_new_type(ctx, &PyFloat_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and update tests!
}
else {
res = sym_new_type(ctx, &PyFloat_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
// TODO gh-115506:
// replace opcode with constant propagated one and update tests!
}
else {
res = sym_new_type(ctx, &PyFloat_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer[-2] = res;
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
}
else {
res = sym_new_type(ctx, &PyUnicode_Type);
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
}
- stack_pointer[-2] = res;
- stack_pointer += -1;
- assert(WITHIN_STACK_BOUNDS());
+ stack_pointer[-1] = res;
break;
}
goto error;
}
res = sym_new_const(ctx, temp);
+ stack_pointer += -2;
+ assert(WITHIN_STACK_BOUNDS());
Py_DECREF(temp);
}
else {
res = sym_new_type(ctx, &PyUnicode_Type);
+ stack_pointer += -2;
+ assert(WITHIN_STACK_BOUNDS());
}
// _STORE_FAST:
GETLOCAL(this_instr->operand0) = res;
- stack_pointer += -2;
- assert(WITHIN_STACK_BOUNDS());
break;
}
"PyUnicode_READ_CHAR",
"Py_ARRAY_LENGTH",
"Py_CLEAR",
- "Py_DECREF",
"Py_FatalError",
"Py_INCREF",
"Py_IS_TYPE",
"Py_TYPE",
"Py_UNREACHABLE",
"Py_Unicode_GET_LENGTH",
- "Py_XDECREF",
"_PyCode_CODE",
"_PyDictValues_AddToInsertionOrder",
"_PyErr_Occurred",
"_PyUnicode_JoinArray",
"_Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY",
"_Py_DECREF_NO_DEALLOC",
- "_Py_DECREF_SPECIALIZED",
"_Py_EnterRecursiveCallTstateUnchecked",
"_Py_ID",
"_Py_IsImmortal",
"SAVE_STACK": self.save_stack,
"RELOAD_STACK": self.reload_stack,
"PyStackRef_CLOSE": self.stackref_close,
+ "PyStackRef_XCLOSE": self.stackref_close,
"PyStackRef_CLOSE_SPECIALIZED": self.stackref_close_specialized,
"PyStackRef_AsPyObjectSteal": self.stackref_steal,
"DISPATCH": self.dispatch,