Skip to content

Commit c4fe3ee

Browse files
committed
handle list-append case
1 parent c867ce3 commit c4fe3ee

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

Python/bytecodes.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4293,10 +4293,11 @@ dummy_func(
42934293
PyStackRef_CLOSE(callable);
42944294
ERROR_IF(err, error);
42954295
#if TIER_ONE
4296-
// Skip the following POP_TOP. This is done here in tier one, and
4296+
// Skip the following CHECK_PERIODIC and POP_TOP. This is done here in tier one, and
42974297
// during trace projection in tier two:
4298-
assert(next_instr->op.code == POP_TOP);
4299-
SKIP_OVER(1);
4298+
assert(next_instr->op.code == CHECK_PERIODIC);
4299+
assert((next_instr+1)->op.code == POP_TOP);
4300+
SKIP_OVER(2);
43004301
#endif
43014302
}
43024303

Python/executor_cases.c.h

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

Python/specialize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,8 @@ specialize_method_descriptor(PyMethodDescrObject *descr, _Py_CODEUNIT *instr,
20372037
}
20382038
PyInterpreterState *interp = _PyInterpreterState_GET();
20392039
PyObject *list_append = interp->callable_cache.list_append;
2040-
_Py_CODEUNIT next = instr[INLINE_CACHE_ENTRIES_CALL + 1];
2040+
assert(instr[INLINE_CACHE_ENTRIES_CALL + 1].op.code == CHECK_PERIODIC);
2041+
_Py_CODEUNIT next = instr[INLINE_CACHE_ENTRIES_CALL + 2];
20412042
bool pop = (next.op.code == POP_TOP);
20422043
int oparg = instr->op.arg;
20432044
if ((PyObject *)descr == list_append && oparg == 1 && pop) {

0 commit comments

Comments
 (0)