Skip to content

Commit 3b02881

Browse files
committed
fix review idea
Signed-off-by: Manjusaka <me@manjusaka.me>
1 parent 420510b commit 3b02881

File tree

6 files changed

+41
-29
lines changed

6 files changed

+41
-29
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ def testfunc(n):
22552255
self.assertEqual(res, TIER2_THRESHOLD)
22562256
uops = get_opnames(ex)
22572257
self.assertIn("_CALL_LIST_APPEND", uops)
2258-
self.assertIn("_POP_TOP", uops)
2258+
self.assertIn("_POP_TOP_NOP", uops)
22592259

22602260
def test_call_isinstance_is_true(self):
22612261
def testfunc(n):

Python/bytecodes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// See Tools/cases_generator/README.md for more information.
88

99
#include "Python.h"
10-
#include "opcode_ids.h"
1110
#include "pycore_abstract.h" // _PyIndex_Check()
1211
#include "pycore_audit.h" // _PySys_Audit()
1312
#include "pycore_backoff.h"
@@ -4373,8 +4372,8 @@ dummy_func(
43734372
if (err) {
43744373
ERROR_NO_POP();
43754374
}
4376-
s = self;
43774375
c = callable;
4376+
s = self;
43784377
INPUTS_DEAD();
43794378
#if TIER_ONE
43804379
// Skip the following POP_TOP. This is done here in tier one, and

Python/executor_cases.c.h

Lines changed: 16 additions & 16 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: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_bytecodes.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,12 @@ dummy_func(void) {
10051005
sym_set_const(flag, Py_True);
10061006
}
10071007

1008+
op(_CALL_LIST_APPEND, (callable, self, arg -- c, s)) {
1009+
(void)(callable);
1010+
c = arg;
1011+
s = self;
1012+
}
1013+
10081014
op(_GUARD_IS_FALSE_POP, (flag -- )) {
10091015
if (sym_is_const(ctx, flag)) {
10101016
PyObject *value = sym_get_const(ctx, flag);

Python/optimizer_cases.c.h

Lines changed: 12 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)