Skip to content
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,8 +1938,7 @@ def testfunc(n):
self.assertIsNotNone(ex)
uops = get_opnames(ex)
self.assertIn("_CALL_TUPLE_1", uops)
# Re-enable later gh-134584
# self.assertIn("_POP_TOP_NOP", uops)
self.assertIn("_POP_TOP_NOP", uops)

def test_call_str_1(self):
def testfunc(n):
Expand Down
9 changes: 6 additions & 3 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -4068,15 +4068,17 @@ dummy_func(
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
}

op(_CALL_TUPLE_1, (callable, null, arg -- res)) {
op(_CALL_TUPLE_1, (callable, null, arg -- res, a)) {
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);

assert(oparg == 1);
STAT_INC(CALL, hit);
PyObject *res_o = PySequence_Tuple(arg_o);
PyStackRef_CLOSE(arg);
if (res_o == NULL) {
ERROR_NO_POP();
}
a = arg;
INPUTS_DEAD();
ERROR_IF(res_o == NULL);
res = PyStackRef_FromPyObjectSteal(res_o);
}

Expand All @@ -4086,6 +4088,7 @@ dummy_func(
_GUARD_NOS_NULL +
_GUARD_CALLABLE_TUPLE_1 +
_CALL_TUPLE_1 +
POP_TOP +
_CHECK_PERIODIC_AT_END;

op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
Expand Down
17 changes: 6 additions & 11 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ dummy_func(void) {
}
}

op(_CALL_TUPLE_1, (callable, null, arg -- res)) {
op(_CALL_TUPLE_1, (callable, null, arg -- res, a)) {
if (sym_matches_type(arg, &PyTuple_Type)) {
// e.g. tuple((1, 2)) or tuple(foo) where foo is known to be a tuple
// Note: we must strip the reference information because it goes
Expand All @@ -1107,6 +1107,7 @@ dummy_func(void) {
else {
res = sym_new_type(ctx, &PyTuple_Type);
}
a = arg;
}

op(_GUARD_TOS_LIST, (tos -- tos)) {
Expand Down
7 changes: 5 additions & 2 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.