10000 gh-91432: Specialize FOR_ITER by sweeneyde · Pull Request #91713 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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

61 changes: 30 additions & 31 deletions Include/opcode.h

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

1 change: 1 addition & 0 deletions Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
BINARY_OP = opmap['BINARY_OP']
JUMP_BACKWARD = opmap['JUMP_BACKWARD']
FOR_ITER = opmap['FOR_ITER']
LOAD_ATTR = opmap['LOAD_ATTR']

CACHE = opmap["CACHE"]

Expand Down
5 changes: 3 additions & 2 deletions Lib/importlib/_bootstrap_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.12a1 3501 (YIELD_VALUE oparg == stack_depth)
# Python 3.12a1 3502 (LOAD_FAST_CHECK, no NULL-check in LOAD_FAST)
# Python 3.12a1 3503 (Shrink LOAD_METHOD cache)
# Python 3.12a1 3504 (Specialization/Cache for FOR_ITER)
# Python 3.12a1 3504 (Merge LOAD_METHOD back into LOAD_ATTR)
# Python 3.12a1 3505 (Specialization/Cache for FOR_ITER)

# Python 3.13 will start with 3550

Expand All @@ -421,7 +422,7 @@ def _write_atomic(path, data, mode=0o666):
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.

MAGIC_NUMBER = (3504).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3505).to_bytes(2, 'little') + b'\r\n'

_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c

Expand Down
6 changes: 4 additions & 2 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,10 @@ def test_show_caches(self):
caches = list(self.get_cached_values(quickened, adaptive))
for cache in caches:
self.assertRegex(cache, pattern)
self.assertEqual(caches.count(""), 8)
self.assertEqual(len(caches), 23)
total_caches = 23
empty_caches = 8 if adaptive and quickened else total_caches
self.assertEqual(caches.count(""), empty_caches)
self.assertEqual(len(caches), total_caches)


class DisWithFileTests(DisTests):
Expand Down
70 changes: 36 additions & 34 deletions Programs/test_frozenmain.h

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

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0