Skip to content
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

[SOT][3.12] Support POP_JUMP_IF_NONE and POP_JUMP_IF_NOT_NONE opcode in Python 3.12 #62120

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1396,11 +1396,13 @@ def JUMP_IF_TRUE_OR_POP(self, instr: Instruction):

POP_JUMP_FORWARD_IF_NONE = pop_jump_if_op_wrapper([operator_is_none])
POP_JUMP_BACKWARD_IF_NONE = POP_JUMP_FORWARD_IF_NONE
POP_JUMP_IF_NONE = POP_JUMP_FORWARD_IF_NONE

POP_JUMP_FORWARD_IF_NOT_NONE = pop_jump_if_op_wrapper(
[operator_is_not_none]
)
POP_JUMP_BACKWARD_IF_NOT_NONE = POP_JUMP_FORWARD_IF_NOT_NONE
POP_JUMP_IF_NOT_NONE = POP_JUMP_FORWARD_IF_NOT_NONE

@call_break_graph_decorator(push_n=lambda arg: arg)
def UNPACK_SEQUENCE(self, instr: Instruction):
Expand Down
2 changes: 0 additions & 2 deletions test/sot/skip_files_py312
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
./test_11_jumps.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOAD_FAST_CHECK还没支持先不开吧

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你的 PR 里是不是支持了 LOAD_FAST_CHECK 并解决了 POP_JUMP_FORWARD_IF_FALSE 生成问题?可以将这些拆到一个独立的 PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个还没有,改回来了,昨晚没看清楚改错了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,我说 @gouzil 的 PR

./test_12_for_loop.py
./test_21_global.py
./test_break_graph.py
./test_builtin_zip.py
./test_guard_user_defined_fn.py
./test_inplace_api.py
./test_min_graph_size.py
./test_side_effects.py
Expand Down