-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. #17754
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
Conversation
3f4e3d4 to
2ee4c16
Compare
ZackerySpytz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some minor comments.
Doc/library/dis.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be wrapped at 80 chars.
Python/ceval.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think PyTuple_GET_SIZE() should be used here.
Python/ceval.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i++
Python/ceval.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, this check for res > 0 should not be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
COMPARE_OP for rich comparisons IS_OP for 'is' and 'is not' tests CONTAINS_OP for 'in' and 'is not' tests JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
3e24674 to
8dbef33
Compare
8dbef33 to
1486559
Compare
8f56c51 to
449cb17
Compare
449cb17 to
5c9a327
Compare
…ythonGH-17754) Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
Breaks up COMPARE_OP into four logically distinct opcodes:
This improves the clarity of the interpreter and should provide a modest speedup.
https://bugs.python.org/issue39156