Skip to content

Commit 617424b

Browse files
Record cache hit earlier
1 parent b28d85c commit 617424b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/ceval.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,6 +4807,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48074807

48084808
PyObject *callable = SECOND();
48094809
DEOPT_IF(callable != cache1->obj, CALL_FUNCTION);
4810+
record_cache_hit(cache0);
4811+
STAT_INC(CALL_FUNCTION, hit);
48104812

48114813
Py_ssize_t len_i = PyObject_Length(TOP());
48124814
if (len_i < 0) {
@@ -4819,8 +4821,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48194821
Py_DECREF(POP());
48204822
Py_DECREF(callable);
48214823
SET_TOP(res);
4822-
record_cache_hit(cache0);
4823-
STAT_INC(CALL_FUNCTION, hit);
48244824
if (res == NULL) {
48254825
goto error;
48264826
}
@@ -4837,6 +4837,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48374837

48384838
PyObject *callable = THIRD();
48394839
DEOPT_IF(callable != cache1->obj, CALL_FUNCTION);
4840+
record_cache_hit(cache0);
4841+
STAT_INC(CALL_FUNCTION, hit);
48404842

48414843
int retval = PyObject_IsInstance(SECOND(), TOP());
48424844
if (retval < 0) {
@@ -4849,8 +4851,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48494851
Py_DECREF(POP());
48504852
Py_DECREF(POP());
48514853
Py_DECREF(callable);
4852-
SET_TOP(res);
4853-
record_cache_hit(cache0);
48544854
STAT_INC(CALL_FUNCTION, hit);
48554855
if (res == NULL) {
48564856
goto error;

0 commit comments

Comments
 (0)