summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorKen Jin <kenjin@python.org>2022-06-16 14:02:07 (GMT)
committerGitHub <noreply@github.com>2022-06-16 14:02:07 (GMT)
commitab45c1dde0e46603342f751552f06b8deb294832 (patch)
tree1f44759763beb45e7e5ff4cff7852d184c438f62 /Python/ceval.c
parentd5be9a5dff6d86a531417d95fa5ee5297fc81b5c (diff)
downloadcpython-ab45c1dde0e46603342f751552f06b8deb294832.zip
cpython-ab45c1dde0e46603342f751552f06b8deb294832.tar.gz
cpython-ab45c1dde0e46603342f751552f06b8deb294832.tar.bz2
Fix BINARY_SUBSCR_GETITEM stats (GH-93903)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index f9ec640..ca3797c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2240,16 +2240,15 @@ handle_eval_breaker:
PyFunctionObject *getitem = (PyFunctionObject *)cached;
DEOPT_IF(getitem->func_version != cache->func_version, BINARY_SUBSCR);
PyCodeObject *code = (PyCodeObject *)getitem->func_code;
- size_t size = code->co_nlocalsplus + code->co_stacksize + FRAME_SPECIALS_SIZE;
assert(code->co_argcount == 2);
- _PyInterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
+ STAT_INC(BINARY_SUBSCR, hit);
+
+ Py_INCREF(getitem);
+ _PyInterpreterFrame *new_frame = _PyFrame_Push(tstate, getitem);
if (new_frame == NULL) {
goto error;
}
- CALL_STAT_INC(frames_pushed);
- Py_INCREF(getitem);
- _PyFrame_InitializeSpecials(new_frame, getitem,
- NULL, code->co_nlocalsplus);
+ CALL_STAT_INC(inlined_py_calls);
STACK_SHRINK(2);
new_frame->localsplus[0] = container;
new_frame->localsplus[1] = sub;