Skip to content

Commit a3a611b

Browse files
gh-134584: Revert partially GH-135860 (GH-142620)
1 parent e0bca09 commit a3a611b

File tree

10 files changed

+31
-51
lines changed

10 files changed

+31
-51
lines changed

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_capi/test_opt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,8 @@ def testfunc(n):
19381938
self.assertIsNotNone(ex)
19391939
uops = get_opnames(ex)
19401940
self.assertIn("_CALL_TUPLE_1", uops)
1941-
self.assertIn("_POP_TOP_NOP", uops)
1941+
# Re-enable later gh-134584
1942+
# self.assertIn("_POP_TOP_NOP", uops)
19421943

19431944
def test_call_str_1(self):
19441945
def testfunc(n):

Python/bytecodes.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,13 +4068,13 @@ dummy_func(
40684068
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
40694069
}
40704070

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

40744074
assert(oparg == 1);
40754075
STAT_INC(CALL, hit);
40764076
PyObject *res_o = PySequence_Tuple(arg_o);
4077-
a = arg;
4077+
PyStackRef_CLOSE(arg);
40784078
INPUTS_DEAD();
40794079
ERROR_IF(res_o == NULL);
40804080
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -4086,7 +4086,6 @@ dummy_func(
40864086
_GUARD_NOS_NULL +
40874087
_GUARD_CALLABLE_TUPLE_1 +
40884088
_CALL_TUPLE_1 +
4089-
POP_TOP +
40904089
_CHECK_PERIODIC_AT_END;
40914090

40924091
op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
@@ -5454,12 +5453,6 @@ dummy_func(
54545453
}
54555454
}
54565455

5457-
label(pop_3_error) {
5458-
stack_pointer -= 3;
5459-
assert(WITHIN_STACK_BOUNDS());
5460-
goto error;
5461-
}
5462-
54635456
label(pop_2_error) {
54645457
stack_pointer -= 2;
54655458
assert(WITHIN_STACK_BOUNDS());

Python/executor_cases.c.h

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 9 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/opcode_targets.h

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_bytecodes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ dummy_func(void) {
10971097
}
10981098
}
10991099

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

11131112
op(_GUARD_TOS_LIST, (tos -- tos)) {

Python/optimizer_cases.c.h

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)