FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. by markshannon · Pull Request #17754 · python/cpython · GitHub

/ cpython Public

bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. - #17754

Merged
markshannon merged 4 commits into
python:masterfrom
markshannon:breakup-compare-op
Jan 14, 2020
Merged

bpo-39156: Break up COMPARE_OP into four logically distinct opcodes.#17754
markshannon merged 4 commits into
python:masterfrom
markshannon:breakup-compare-op

Conversation

markshannon commented Dec 30, 2019
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Breaks 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.

This improves the clarity of the interpreter and should provide a modest speedup.

https://bugs.python.org/issue39156

ZackerySpytz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have some minor comments.

Comment thread Doc/library/dis.rst Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should be wrapped at 80 chars.

Comment thread Python/ceval.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think PyTuple_GET_SIZE() should be used here.

Comment thread Python/ceval.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i++

Comment thread Python/ceval.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMO, this check for res > 0 should not be included.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.
markshannon reopened this Jan 10, 2020
markshannon requested a review from a team as a code owner January 13, 2020 12:39
markshannon merged commit 9af0e47 into python:master Jan 14, 2020
markshannon deleted the breakup-compare-op branch January 14, 2020 10:12
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL