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-133672: Allow LOAD_FAST to be optimized to LOAD_FAST_BORROW#133721

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

Open
ljfp wants to merge10 commits intopython:main
base:main
Choose a base branch
Loading
fromljfp:fix-issue-133672
Open
Changes from1 commit
Commits
Show all changes
10 commits
Select commitHold shift + click to select a range
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
Update test_peepholer.py to reflect the new changes made to flowgraph.c
  • Loading branch information
@ljfp
ljfp committedMay 14, 2025
commit695a9283e091748c1928b68958e23497c4771cc8
19 changes: 7 additions & 12 deletionsLib/test/test_peepholer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2430,14 +2430,14 @@ def test_optimized(self):
]
self.check(insts, expected)

deftest_optimize_unconsumed_when_is_safe(self):
deftest_unoptimized_if_unconsumed(self):
insts = [
("LOAD_FAST", 0, 1),
("LOAD_FAST", 1, 2),
("POP_TOP", None, 3),
]
expected = [
("LOAD_FAST_BORROW", 0, 1),
("LOAD_FAST", 0, 1),
("LOAD_FAST_BORROW", 1, 2),
("POP_TOP", None, 3),
]
Expand All@@ -2449,7 +2449,7 @@ def test_optimize_unconsumed_when_is_safe(self):
("POP_TOP", None, 3),
]
expected = [
("LOAD_FAST_BORROW", 0, 1),
("LOAD_FAST", 0, 1),
("NOP", None, 2),
("NOP", None, 3),
]
Expand DownExpand Up@@ -2509,12 +2509,7 @@ def test_consume_some_inputs_no_outputs(self):
("GET_LEN", None, 2),
("LIST_APPEND", 0, 3),
]
expected = [
("LOAD_FAST_BORROW", 0, 1),
("GET_LEN", None, 2),
("LIST_APPEND", 0, 3),
]
self.check(insts, expected)
self.check(insts, insts)

def test_check_exc_match(self):
insts = [
Expand All@@ -2523,7 +2518,7 @@ def test_check_exc_match(self):
("CHECK_EXC_MATCH", None, 3)
]
expected = [
("LOAD_FAST_BORROW", 0, 1),
("LOAD_FAST", 0, 1),
("LOAD_FAST_BORROW", 1, 2),
("CHECK_EXC_MATCH", None, 3)
]
Expand DownExpand Up@@ -2573,7 +2568,7 @@ def test_load_attr(self):
("LOAD_ATTR", 1, 2),
]
expected = [
("LOAD_FAST_BORROW", 0, 1),
("LOAD_FAST", 0, 1),
("LOAD_ATTR", 1, 2),
]
self.check(insts, expected)
Expand DownExpand Up@@ -2603,7 +2598,7 @@ def test_super_attr(self):
expected = [
("LOAD_FAST_BORROW", 0, 1),
("LOAD_FAST_BORROW", 1, 2),
("LOAD_FAST_BORROW", 2, 3),
("LOAD_FAST", 2, 3),
("LOAD_SUPER_ATTR", 1, 4),
]
self.check(insts, expected)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp