8000 Add more FOR_ITER specialization stats by sweeneyde · Pull Request #32151 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Add more FOR_ITER specialization stats #32151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 13, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove a few failure kinds
  • Loading branch information
sweeneyde committed Mar 30, 2022
commit dfc25f9a7dde78da1c25b7809833f29d6a1c0bc7
30 changes: 3 additions & 27 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,6 @@ initial_counter_value(void) {
#define SPEC_FAIL_COMPARE_OP_EXTENDED_ARG 24

/* FOR_ITER */
#define SPEC_FAIL_FOR_ITER_REVERSED 4
#define SPEC_FAIL_FOR_ITER_SQLITE 5
#define SPEC_FAIL_FOR_ITER_IO 6
#define SPEC_FAIL_FOR_ITER_CALLABLE 7
#define SPEC_FAIL_FOR_ITER_FILTER 8
#define SPEC_FAIL_FOR_ITER_ELEMENTTREE 9
#define SPEC_FAIL_FOR_ITER_GENERATOR 10
#define SPEC_FAIL_FOR_ITER_COROUTINE 11
#define SPEC_FAIL_FOR_ITER_ASYNC_GENERATOR 12
Expand All @@ -475,8 +469,8 @@ initial_counter_value(void) {
#define SPEC_FAIL_FOR_ITER_MAP 24
#define SPEC_FAIL_FOR_ITER_ZIP 25
#define SPEC_FAIL_FOR_ITER_SEQ_ITER 26
#define SPEC_FAIL_FOR_ITER_LIST_REVERSED 27
#define SPEC_FAIL_FOR_ITER_BYTEARRAY 28
#define SPEC_FAIL_FOR_ITER_REVERSED_LIST 27
#define SPEC_FAIL_FOR_ITER_CALLABLE 28

// UNPACK_SEQUENCE

Expand Down Expand Up @@ -2058,33 +2052,15 @@ int
return SPEC_FAIL_FOR_ITER_SEQ_ITER;
}
if (t == &PyListRevIter_Type) {
return SPEC_FAIL_FOR_ITER_LIST_REVERSED;
}
if (t == &PyByteArrayIter_Type) {
return SPEC_FAIL_FOR_ITER_BYTEARRAY;
}
if (t == &PyFilter_Type) {
return SPEC_FAIL_FOR_ITER_FILTER;
}
if (t == &PyReversed_Type) {
return SPEC_FAIL_FOR_ITER_REVERSED;
return SPEC_FAIL_FOR_ITER_REVERSED_LIST;
}
const char *name = t->tp_name;
if (strncmp(name, "_elementtree", 12) == 0) {
return SPEC_FAIL_FOR_ITER_ELEMENTTREE;
}
if (strncmp(name, "itertools", 9) == 0) {
return SPEC_FAIL_FOR_ITER_ITERTOOLS;
}
if (strncmp(name, "_io.", 4) == 0) {
return SPEC_FAIL_FOR_ITER_IO;
}
if (strncmp(name, "callable_iterator", 17) == 0) {
return SPEC_FAIL_FOR_ITER_CALLABLE;
}
if (strncmp(name, "sqlite3.", 8) == 0) {
return SPEC_FAIL_FOR_ITER_SQLITE;
}
return SPEC_FAIL_OTHER;
}

Expand Down
0