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

gh-119180: Add LOAD_COMMON_CONSTANT opcode by JelleZijlstra · Pull Request #119321 · python/cpython · GitHub

Repository navigation

gh-119180: Add LOAD_COMMON_CONSTANT opcode - #119321

Merged
JelleZijlstra merged 7 commits into
python:mainfrom
JelleZijlstra:pep649-loadcommon
May 22, 2024
Merged

JelleZijlstra merged 7 commits into
python:mainfrom
JelleZijlstra:pep649-loadcommon

Conversation

JelleZijlstra commented May 21, 2024 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.


📚 Documentation preview 📚: https://cpython-previews--119321.org.readthedocs.build/

The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.
Comment thread Python/ceval_macros.h Outdated
Comment thread Python/ceval.c Outdated
JelleZijlstra and others added 3 commits May 21, 2024 13:10
…e-119180.UNDUb9.rst

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Copy link
Copy Markdown
Member Author

The previous version broke the JIT. @brandtbucher helped figure out that this is because the common_constants array is empty when the JIT is being compiled. Since there didn't seem to be a simple way to make this work correctly, we decided to simply use a switch in the interpreter code instead.

gvanrossum left a comment

Copy link
Copy Markdown
Member

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

Here you go!

Comment thread Lib/importlib/_bootstrap_external.py Outdated
Comment thread Python/bytecodes.c Outdated
Comment thread Python/ceval.c Outdated

gvanrossum left a comment

Copy link
Copy Markdown
Member

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

Yay!

JelleZijlstra enabled auto-merge (squash) May 21, 2024 20:31
JelleZijlstra merged commit 98e855f into python:main May 22, 2024
JelleZijlstra deleted the pep649-loadcommon branch May 22, 2024 12:26
JelleZijlstra added a commit that referenced this pull request May 25, 2024
PR #119321 added a comment about the magic number bump
but did not actually apply the new magic number.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
PR python#119321 added a comment about the magic number bump
but did not actually apply the new magic number.
JelleZijlstra restored the pep649-loadcommon branch September 10, 2024 23:37
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