]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Wed, 22 May 2024 00:46:39 +0000 (20:46 -0400)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 00:46:39 +0000 (00:46 +0000)
commit98e855fcc1f1d490c803565e84cb611b3f057e45
tree53f19fb0244fa8c43e53534c31842adf5b65ebc2
parent506b1a3ff66a41c72d205c8e4cba574e439d8e76
gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)

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>
22 files changed:
Doc/library/dis.rst
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_opcode_utils.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Include/opcode_ids.h
Lib/_opcode_metadata.py
Lib/dis.py
Lib/importlib/_bootstrap_external.py
Lib/opcode.py
Lib/test/test_code.py
Lib/test/test_compile.py
Lib/test/test_dis.py
Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issue-119180.UNDUb9.rst [new file with mode: 0644]
Objects/codeobject.c
Programs/test_frozenmain.h
Python/bytecodes.c
Python/compile.c
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/opcode_targets.h
Python/optimizer_cases.c.h