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-113710: Add a "globals to constants" pass#114592

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 16 commits intopython:mainfromfaster-cpython:globals-to-constants
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
3941620
Change optimizer API to provide more information
markshannonJan 18, 2024
665cc58
Add new uops for optimizing globals
markshannonJan 18, 2024
9d9bc24
Optimize LOAD_GLOBAL specializations in tier 2
markshannonJan 18, 2024
24b3533
Fix handling of call stack in trace generator
markshannonJan 18, 2024
35a92cc
Get globals to const pass working
markshannonJan 18, 2024
8c699a3
Minor tidying
markshannonJan 18, 2024
28dbecd
Merge branch 'main' into globals-to-constants
markshannonJan 18, 2024
99e38ca
Merge builtin watchers and limit re-optimizations
markshannonJan 19, 2024
e0eaea9
Add braces
markshannonJan 19, 2024
d3a2590
Use a few bits in the dict version tag to track deoptimizations
markshannonJan 19, 2024
b3f2418
Address review comments
markshannonFeb 1, 2024
0798207
Merge branch 'main' into globals-to-constants
markshannonFeb 1, 2024
e65dcf2
Tolerate default optimizer being called
markshannonFeb 2, 2024
f763e37
Fix compiler warning
markshannonFeb 2, 2024
5bdac7a
Reduce modification limits a bit.
markshannonFeb 2, 2024
3dc8907
Merge branch 'main' into globals-to-constants
markshannonFeb 2, 2024
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
PrevPrevious commit
NextNext commit
Minor tidying
  • Loading branch information
@markshannon
markshannon committedJan 18, 2024
commit8c699a324dd9b6b93d037b17226703deba7c4871
16 changes: 8 additions & 8 deletionsLib/test/test_capi/test_watchers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,6 +52,14 @@ def test_set_existing_item(self):
d["foo"] = "baz"
self.assert_events(["mod:foo:baz"])

def test_clone(self):
d = {}
d2 = {"foo": "bar"}
with self.watcher() as wid:
self.watch(wid, d)
d.update(d2)
self.assert_events(["clone"])

def test_no_event_if_not_watched(self):
d = {}
with self.watcher() as wid:
Expand All@@ -72,14 +80,6 @@ def test_pop(self):
d.pop("foo")
self.assert_events(["del:foo"])

def test_clone(self):
d = {}
d2 = {"foo": "bar"}
with self.watcher() as wid:
self.watch(wid, d)
d.update(d2)
self.assert_events(["clone"])

def test_clear(self):
d = {"foo": "bar"}
with self.watcher() as wid:
Expand Down
2 changes: 1 addition & 1 deletionObjects/dictobject.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5975,7 +5975,7 @@ PyDict_AddWatcher(PyDict_WatchCallback callback)
{
PyInterpreterState *interp = _PyInterpreterState_GET();

/* Start at 2, as 0 and 1as reserved for CPython */
/* Start at 2, as 0 and 1are reserved for CPython */
for (int i = 2; i < DICT_MAX_WATCHERS; i++) {
if (!interp->dict_state.watchers[i]) {
interp->dict_state.watchers[i] = callback;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp