summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_uop_metadata.h
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2024-05-22 00:46:39 (GMT)
committerGitHub <noreply@github.com>2024-05-22 00:46:39 (GMT)
commit98e855fcc1f1d490c803565e84cb611b3f057e45 (patch)
tree53f19fb0244fa8c43e53534c31842adf5b65ebc2 /Include/internal/pycore_uop_metadata.h
parent506b1a3ff66a41c72d205c8e4cba574e439d8e76 (diff)
downloadcpython-98e855fcc1f1d490c803565e84cb611b3f057e45.zip
cpython-98e855fcc1f1d490c803565e84cb611b3f057e45.tar.gz
cpython-98e855fcc1f1d490c803565e84cb611b3f057e45.tar.bz2
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>
Diffstat (limited to 'Include/internal/pycore_uop_metadata.h')
-rw-r--r--Include/internal/pycore_uop_metadata.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h
index 470e95e..f555824 100644
--- a/Include/internal/pycore_uop_metadata.h
+++ b/Include/internal/pycore_uop_metadata.h
@@ -93,7 +93,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
[_GET_AWAITABLE] = HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_YIELD_VALUE] = HAS_ARG_FLAG | HAS_ESCAPES_FLAG,
[_POP_EXCEPT] = HAS_ESCAPES_FLAG,
- [_LOAD_ASSERTION_ERROR] = 0,
+ [_LOAD_COMMON_CONSTANT] = HAS_ARG_FLAG,
[_LOAD_BUILD_CLASS] = HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_STORE_NAME] = HAS_ARG_FLAG | HAS_NAME_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
[_DELETE_NAME] = HAS_ARG_FLAG | HAS_NAME_FLAG | HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG,
@@ -400,7 +400,6 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
[_JUMP_TO_TOP] = "_JUMP_TO_TOP",
[_LIST_APPEND] = "_LIST_APPEND",
[_LIST_EXTEND] = "_LIST_EXTEND",
- [_LOAD_ASSERTION_ERROR] = "_LOAD_ASSERTION_ERROR",
[_LOAD_ATTR] = "_LOAD_ATTR",
[_LOAD_ATTR_CLASS] = "_LOAD_ATTR_CLASS",
[_LOAD_ATTR_CLASS_0] = "_LOAD_ATTR_CLASS_0",
@@ -419,6 +418,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
[_LOAD_ATTR_SLOT_1] = "_LOAD_ATTR_SLOT_1",
[_LOAD_ATTR_WITH_HINT] = "_LOAD_ATTR_WITH_HINT",
[_LOAD_BUILD_CLASS] = "_LOAD_BUILD_CLASS",
+ [_LOAD_COMMON_CONSTANT] = "_LOAD_COMMON_CONSTANT",
[_LOAD_CONST] = "_LOAD_CONST",
[_LOAD_CONST_INLINE] = "_LOAD_CONST_INLINE",
[_LOAD_CONST_INLINE_BORROW] = "_LOAD_CONST_INLINE_BORROW",
@@ -662,7 +662,7 @@ int _PyUop_num_popped(int opcode, int oparg)
return 1;
case _POP_EXCEPT:
return 1;
- case _LOAD_ASSERTION_ERROR:
+ case _LOAD_COMMON_CONSTANT:
return 0;
case _LOAD_BUILD_CLASS:
return 0;