Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -4451,8 +4451,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
assert(call_shape.kwnames == NULL);
#ifdef Py_STATS
extern int _PySpecialization_ClassifyCallable(PyObject *);
_py_stats.opcode_stats[PRECALL_FUNCTION].specialization.failure++;
_py_stats.opcode_stats[PRECALL_FUNCTION].specialization.failure_kinds[_PySpecialization_ClassifyCallable(call_shape.callable)]++;
SpecializationStats *stats =
&_py_stats.opcode_stats[PRECALL_FUNCTION].specialization;
stats->failure++;
int kind = _PySpecialization_ClassifyCallable(call_shape.callable);
stats->failure_kinds[kind]++;
#endif
DISPATCH();
}
Expand Down Expand Up @@ -4493,6 +4496,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr

call_shape.total_args = nargs;
assert(call_shape.kwnames == NULL);
#ifdef Py_STATS
extern int _PySpecialization_ClassifyCallable(PyObject *);
SpecializationStats *stats =
&_py_stats.opcode_stats[PRECALL_METHOD].specialization;
stats->failure++;
int kind = _PySpecialization_ClassifyCallable(call_shape.callable);
stats->failure_kinds[kind]++;
#endif
DISPATCH();
}

Expand Down
1 change: 1 addition & 0 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
* even though we don't specialize them yet. */
fprintf(out, " opcode[%d].specializable : 1\n", FOR_ITER);
fprintf(out, " opcode[%d].specializable : 1\n", PRECALL_FUNCTION);
fprintf(out, " opcode[%d].specializable : 1\n", PRECALL_METHOD);
fprintf(out, " opcode[%d].specializable : 1\n", UNPACK_SEQUENCE);
for (int i = 0; i < 256; i++) {
if (adaptive_opcodes[i]) {
Expand Down