Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5d0517

Browse files
authored
Add more FOR_ITER specialization stats (GH-32151)
1 parent9331087 commitc5d0517

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

‎Python/specialize.c‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ miss_counter_start(void) {
477477
#defineSPEC_FAIL_FOR_ITER_DICT_ITEMS 21
478478
#defineSPEC_FAIL_FOR_ITER_DICT_VALUES 22
479479
#defineSPEC_FAIL_FOR_ITER_ENUMERATE 23
480+
#defineSPEC_FAIL_FOR_ITER_MAP 24
481+
#defineSPEC_FAIL_FOR_ITER_ZIP 25
482+
#defineSPEC_FAIL_FOR_ITER_SEQ_ITER 26
483+
#defineSPEC_FAIL_FOR_ITER_REVERSED_LIST 27
484+
#defineSPEC_FAIL_FOR_ITER_CALLABLE 28
485+
#defineSPEC_FAIL_FOR_ITER_ASCII_STRING 29
480486

481487
// UNPACK_SEQUENCE
482488

@@ -2051,10 +2057,28 @@ int
20512057
if (t==&PyEnum_Type) {
20522058
returnSPEC_FAIL_FOR_ITER_ENUMERATE;
20532059
}
2054-
2055-
if (strncmp(t->tp_name,"itertools",8)==0) {
2060+
if (t==&PyMap_Type) {
2061+
returnSPEC_FAIL_FOR_ITER_MAP;
2062+
}
2063+
if (t==&PyZip_Type) {
2064+
returnSPEC_FAIL_FOR_ITER_ZIP;
2065+
}
2066+
if (t==&PySeqIter_Type) {
2067+
returnSPEC_FAIL_FOR_ITER_SEQ_ITER;
2068+
}
2069+
if (t==&PyListRevIter_Type) {
2070+
returnSPEC_FAIL_FOR_ITER_REVERSED_LIST;
2071+
}
2072+
if (t==&_PyUnicodeASCIIIter_Type) {
2073+
returnSPEC_FAIL_FOR_ITER_ASCII_STRING;
2074+
}
2075+
constchar*name=t->tp_name;
2076+
if (strncmp(name,"itertools",9)==0) {
20562077
returnSPEC_FAIL_FOR_ITER_ITERTOOLS;
20572078
}
2079+
if (strncmp(name,"callable_iterator",17)==0) {
2080+
returnSPEC_FAIL_FOR_ITER_CALLABLE;
2081+
}
20582082
returnSPEC_FAIL_OTHER;
20592083
}
20602084

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp