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

gh-91432: Specialize FOR_ITER#91713

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
markshannon merged 44 commits intopython:mainfromsweeneyde:special_for_iter2
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
44 commits
Select commitHold shift + click to select a range
3a7f8df
initial attempt
sweeneydeApr 17, 2022
3b5ce1e
bump magic
sweeneydeApr 17, 2022
b21b5f4
Merge remote-tracking branch 'upstream/main' into special_for_iter2
sweeneydeApr 18, 2022
37269cf
NOTRACE_DISPATCH_SAME_OPARG
sweeneydeApr 18, 2022
ea0a7ee
Update mark_stacks
sweeneydeApr 18, 2022
0751228
comment out assertions
sweeneydeApr 19, 2022
dc80fda
Merge branch 'main' into special_for_iter2
sweeneydeApr 19, 2022
e429410
Make FOR_ITER_RANGE mutate the local
sweeneydeApr 19, 2022
1cb2de7
Merge remote-tracking branch 'upstream/main' into special_for_iter2
sweeneydeApr 19, 2022
73fa01c
Fix overflow
sweeneydeApr 19, 2022
4213582
fix test
sweeneydeApr 19, 2022
bf58358
fix dis
sweeneydeApr 19, 2022
bd7575e
Add more tests, add more casts
sweeneydeApr 19, 2022
db8754b
Merge branch 'main' into special_for_iter2
sweeneydeApr 20, 2022
2050c4e
merge with main
sweeneydeApr 24, 2022
824e966
Fix stats, take out some PREDICT
sweeneydeApr 24, 2022
6b16772
📜🤖 Added by blurb_it.
blurb-it[bot]Apr 24, 2022
c2a75a5
merge with main
sweeneydeApr 28, 2022
6696384
remove PREDEICTED(STORE_FAST)
sweeneydeApr 28, 2022
d297091
assert no tracing
sweeneydeApr 28, 2022
22635a6
Merge branch 'special_for_iter2' of https://github.com/sweeneyde/cpyt…
sweeneydeApr 28, 2022
f360d65
remove unnecessary cast
sweeneydeApr 28, 2022
81e0500
merge with main
sweeneydeMay 3, 2022
c2eab68
regen
sweeneydeMay 3, 2022
25689c3
merge and bump magic
sweeneydeMay 4, 2022
b5df047
merge with main
sweeneydeMay 8, 2022
2b1c170
Merge remote-tracking branch 'upstream/main' into special_for_iter2
sweeneydeMay 10, 2022
91d280c
Fix test_dis
sweeneydeMay 10, 2022
eba5e60
merge with main
sweeneydeMay 12, 2022
5b153d7
Merge branch 'main' into special_for_iter2
sweeneydeMay 12, 2022
76f9a74
merge with main
sweeneydeMay 20, 2022
0565a68
Merge branch 'special_for_iter2' of https://github.com/sweeneyde/cpyt…
sweeneydeMay 20, 2022
9ba5b79
merge with main
sweeneydeJun 9, 2022
6cdf0e4
Add comment about re-using the old PyLongObject
sweeneydeJun 9, 2022
03dde6a
Merge branch 'main' of https://github.com/python/cpython into special…
sweeneydeJun 10, 2022
f1e2d39
update test_dis.py
sweeneydeJun 10, 2022
463c3b9
Merge remote-tracking branch 'upstream/main' into special_for_iter2
sweeneydeJun 14, 2022
ed29777
use the new exponential backoff
sweeneydeJun 14, 2022
188b357
merge with main
sweeneydeJun 18, 2022
36d0999
revert using sdigits, add _PyLong_AssignValue
sweeneydeJun 19, 2022
ad2e969
revert test_sys sizeof check
sweeneydeJun 19, 2022
d55868f
revert test_range changes
sweeneydeJun 19, 2022
2d6ee26
add comment and use Py_ssize_t
sweeneydeJun 20, 2022
db21da1
Add comment: only positive
sweeneydeJun 20, 2022
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
NextNext commit
initial attempt
  • Loading branch information
@sweeneyde
sweeneyde committedApr 17, 2022
commit3a7f8dfb96028b4739df1c45590de71cb9c8c77e
7 changes: 7 additions & 0 deletionsInclude/internal/pycore_code.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -92,6 +92,12 @@ typedef struct {

#define INLINE_CACHE_ENTRIES_STORE_SUBSCR CACHE_ENTRIES(_PyStoreSubscrCache)

typedef struct {
_Py_CODEUNIT counter;
} _PyForIterCache;

#define INLINE_CACHE_ENTRIES_FOR_ITER CACHE_ENTRIES(_PyForIterCache)

#define QUICKENING_WARMUP_DELAY 8

/* We want to compare to zero for efficiency, so we offset values accordingly */
Expand DownExpand Up@@ -270,6 +276,7 @@ extern void _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs,
_Py_CODEUNIT *instr, int oparg);
extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr,
int oparg);
extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr);

/* Deallocator function for static codeobjects used in deepfreeze.py */
extern void _PyStaticCode_Dealloc(PyCodeObject *co);
Expand Down
6 changes: 6 additions & 0 deletionsInclude/internal/pycore_list.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,6 +56,12 @@ _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
return _PyList_AppendTakeRefListResize(self, newitem);
}

typedef struct {
PyObject_HEAD
Py_ssize_t it_index;
PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
} _PyListIterObject;

#ifdef __cplusplus
}
#endif
Expand Down
22 changes: 22 additions & 0 deletionsInclude/internal/pycore_range.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
#ifndef Py_INTERNAL_RANGE_H
#define Py_INTERNAL_RANGE_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif

typedef struct {
PyObject_HEAD
long index;
long start;
long step;
long len;
} _PyRangeIterObject;

#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_RANGE_H */
167 changes: 87 additions & 80 deletionsInclude/opcode.h
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

7 changes: 6 additions & 1 deletionLib/opcode.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,7 +111,7 @@ def jabs_op(name, op, entries=0):
name_op('STORE_NAME', 90) # Index in name list
name_op('DELETE_NAME', 91) # ""
def_op('UNPACK_SEQUENCE', 92, 1) # Number of tuple items
jrel_op('FOR_ITER', 93)
jrel_op('FOR_ITER', 93, 1)
def_op('UNPACK_EX', 94)
name_op('STORE_ATTR', 95, 4) # Index in name list
name_op('DELETE_ATTR', 96) # ""
Expand DownExpand Up@@ -264,6 +264,11 @@ def jabs_op(name, op, entries=0):
"COMPARE_OP_INT_JUMP",
"COMPARE_OP_STR_JUMP",
],
"FOR_ITER": [
"FOR_ITER_ADAPTIVE",
"FOR_ITER_LIST",
"FOR_ITER_RANGE",
],
"JUMP_BACKWARD": [
"JUMP_BACKWARD_QUICK",
],
Expand Down
1 change: 1 addition & 0 deletionsMakefile.pre.in
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1612,6 +1612,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_pylifecycle.h \
$(srcdir)/Include/internal/pycore_pymem.h \
$(srcdir)/Include/internal/pycore_pystate.h \
$(srcdir)/Include/internal/pycore_range.h \
$(srcdir)/Include/internal/pycore_runtime.h \
$(srcdir)/Include/internal/pycore_runtime_init.h \
$(srcdir)/Include/internal/pycore_sliceobject.h \
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp