summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-06-13 08:51:05 (GMT)
committerGitHub <noreply@github.com>2023-06-13 08:51:05 (GMT)
commit09ffa69e2e84950751739ab500f820725e00a3dd (patch)
treeaec7308298f61cd813a9baa1d81e2c1348160e64 /Include
parent217589d4f3246d67c6ef0eb0be2b1c33987cf260 (diff)
downloadcpython-09ffa69e2e84950751739ab500f820725e00a3dd.zip
cpython-09ffa69e2e84950751739ab500f820725e00a3dd.tar.gz
cpython-09ffa69e2e84950751739ab500f820725e00a3dd.tar.bz2
GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_opcode.h32
-rw-r--r--Include/opcode.h85
2 files changed, 59 insertions, 58 deletions
diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h
index 450ae8f..d706b85 100644
--- a/Include/internal/pycore_opcode.h
+++ b/Include/internal/pycore_opcode.h
@@ -214,6 +214,7 @@ const uint8_t _PyOpcode_Deopt[256] = {
[SEND_GEN] = SEND,
[SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS,
[SET_ADD] = SET_ADD,
+ [SET_FUNCTION_ATTRIBUTE] = SET_FUNCTION_ATTRIBUTE,
[SET_UPDATE] = SET_UPDATE,
[STORE_ATTR] = STORE_ATTR,
[STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR,
@@ -269,20 +270,21 @@ static const char *const _PyOpcode_OpName[267] = {
[BINARY_SUBSCR_LIST_INT] = "BINARY_SUBSCR_LIST_INT",
[BINARY_SUBSCR_TUPLE_INT] = "BINARY_SUBSCR_TUPLE_INT",
[CALL_PY_EXACT_ARGS] = "CALL_PY_EXACT_ARGS",
- [CALL_PY_WITH_DEFAULTS] = "CALL_PY_WITH_DEFAULTS",
+ [MAKE_FUNCTION] = "MAKE_FUNCTION",
[BINARY_SUBSCR] = "BINARY_SUBSCR",
[BINARY_SLICE] = "BINARY_SLICE",
[STORE_SLICE] = "STORE_SLICE",
+ [CALL_PY_WITH_DEFAULTS] = "CALL_PY_WITH_DEFAULTS",
[CALL_BOUND_METHOD_EXACT_ARGS] = "CALL_BOUND_METHOD_EXACT_ARGS",
- [CALL_BUILTIN_CLASS] = "CALL_BUILTIN_CLASS",
[GET_LEN] = "GET_LEN",
[MATCH_MAPPING] = "MATCH_MAPPING",
[MATCH_SEQUENCE] = "MATCH_SEQUENCE",
[MATCH_KEYS] = "MATCH_KEYS",
- [CALL_BUILTIN_FAST_WITH_KEYWORDS] = "CALL_BUILTIN_FAST_WITH_KEYWORDS",
+ [CALL_BUILTIN_CLASS] = "CALL_BUILTIN_CLASS",
[PUSH_EXC_INFO] = "PUSH_EXC_INFO",
[CHECK_EXC_MATCH] = "CHECK_EXC_MATCH",
[CHECK_EG_MATCH] = "CHECK_EG_MATCH",
+ [CALL_BUILTIN_FAST_WITH_KEYWORDS] = "CALL_BUILTIN_FAST_WITH_KEYWORDS",
[CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = "CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS",
[CALL_NO_KW_BUILTIN_FAST] = "CALL_NO_KW_BUILTIN_FAST",
[CALL_NO_KW_BUILTIN_O] = "CALL_NO_KW_BUILTIN_O",
@@ -293,7 +295,6 @@ static const char *const _PyOpcode_OpName[267] = {
[CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = "CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS",
[CALL_NO_KW_METHOD_DESCRIPTOR_O] = "CALL_NO_KW_METHOD_DESCRIPTOR_O",
[CALL_NO_KW_STR_1] = "CALL_NO_KW_STR_1",
- [CALL_NO_KW_TUPLE_1] = "CALL_NO_KW_TUPLE_1",
[WITH_EXCEPT_START] = "WITH_EXCEPT_START",
[GET_AITER] = "GET_AITER",
[GET_ANEXT] = "GET_ANEXT",
@@ -301,39 +302,39 @@ static const char *const _PyOpcode_OpName[267] = {
[BEFORE_WITH] = "BEFORE_WITH",
[END_ASYNC_FOR] = "END_ASYNC_FOR",
[CLEANUP_THROW] = "CLEANUP_THROW",
+ [CALL_NO_KW_TUPLE_1] = "CALL_NO_KW_TUPLE_1",
[CALL_NO_KW_TYPE_1] = "CALL_NO_KW_TYPE_1",
[COMPARE_OP_FLOAT] = "COMPARE_OP_FLOAT",
[COMPARE_OP_INT] = "COMPARE_OP_INT",
- [COMPARE_OP_STR] = "COMPARE_OP_STR",
[STORE_SUBSCR] = "STORE_SUBSCR",
[DELETE_SUBSCR] = "DELETE_SUBSCR",
+ [COMPARE_OP_STR] = "COMPARE_OP_STR",
[FOR_ITER_LIST] = "FOR_ITER_LIST",
[FOR_ITER_TUPLE] = "FOR_ITER_TUPLE",
[FOR_ITER_RANGE] = "FOR_ITER_RANGE",
[FOR_ITER_GEN] = "FOR_ITER_GEN",
[LOAD_SUPER_ATTR_ATTR] = "LOAD_SUPER_ATTR_ATTR",
- [LOAD_SUPER_ATTR_METHOD] = "LOAD_SUPER_ATTR_METHOD",
[GET_ITER] = "GET_ITER",
[GET_YIELD_FROM_ITER] = "GET_YIELD_FROM_ITER",
- [LOAD_ATTR_CLASS] = "LOAD_ATTR_CLASS",
+ [LOAD_SUPER_ATTR_METHOD] = "LOAD_SUPER_ATTR_METHOD",
[LOAD_BUILD_CLASS] = "LOAD_BUILD_CLASS",
+ [LOAD_ATTR_CLASS] = "LOAD_ATTR_CLASS",
[LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = "LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN",
- [LOAD_ATTR_INSTANCE_VALUE] = "LOAD_ATTR_INSTANCE_VALUE",
[LOAD_ASSERTION_ERROR] = "LOAD_ASSERTION_ERROR",
[RETURN_GENERATOR] = "RETURN_GENERATOR",
+ [LOAD_ATTR_INSTANCE_VALUE] = "LOAD_ATTR_INSTANCE_VALUE",
[LOAD_ATTR_MODULE] = "LOAD_ATTR_MODULE",
[LOAD_ATTR_PROPERTY] = "LOAD_ATTR_PROPERTY",
[LOAD_ATTR_SLOT] = "LOAD_ATTR_SLOT",
[LOAD_ATTR_WITH_HINT] = "LOAD_ATTR_WITH_HINT",
[LOAD_ATTR_METHOD_LAZY_DICT] = "LOAD_ATTR_METHOD_LAZY_DICT",
[LOAD_ATTR_METHOD_NO_DICT] = "LOAD_ATTR_METHOD_NO_DICT",
- [LOAD_ATTR_METHOD_WITH_VALUES] = "LOAD_ATTR_METHOD_WITH_VALUES",
[RETURN_VALUE] = "RETURN_VALUE",
- [LOAD_GLOBAL_BUILTIN] = "LOAD_GLOBAL_BUILTIN",
+ [LOAD_ATTR_METHOD_WITH_VALUES] = "LOAD_ATTR_METHOD_WITH_VALUES",
[SETUP_ANNOTATIONS] = "SETUP_ANNOTATIONS",
- [LOAD_GLOBAL_MODULE] = "LOAD_GLOBAL_MODULE",
+ [LOAD_GLOBAL_BUILTIN] = "LOAD_GLOBAL_BUILTIN",
[LOAD_LOCALS] = "LOAD_LOCALS",
- [STORE_ATTR_INSTANCE_VALUE] = "STORE_ATTR_INSTANCE_VALUE",
+ [LOAD_GLOBAL_MODULE] = "LOAD_GLOBAL_MODULE",
[POP_EXCEPT] = "POP_EXCEPT",
[STORE_NAME] = "STORE_NAME",
[DELETE_NAME] = "DELETE_NAME",
@@ -356,9 +357,9 @@ static const char *const _PyOpcode_OpName[267] = {
[IMPORT_NAME] = "IMPORT_NAME",
[IMPORT_FROM] = "IMPORT_FROM",
[JUMP_FORWARD] = "JUMP_FORWARD",
+ [STORE_ATTR_INSTANCE_VALUE] = "STORE_ATTR_INSTANCE_VALUE",
[STORE_ATTR_SLOT] = "STORE_ATTR_SLOT",
[STORE_ATTR_WITH_HINT] = "STORE_ATTR_WITH_HINT",
- [STORE_SUBSCR_DICT] = "STORE_SUBSCR_DICT",
[POP_JUMP_IF_FALSE] = "POP_JUMP_IF_FALSE",
[POP_JUMP_IF_TRUE] = "POP_JUMP_IF_TRUE",
[LOAD_GLOBAL] = "LOAD_GLOBAL",
@@ -377,7 +378,7 @@ static const char *const _PyOpcode_OpName[267] = {
[POP_JUMP_IF_NONE] = "POP_JUMP_IF_NONE",
[RAISE_VARARGS] = "RAISE_VARARGS",
[GET_AWAITABLE] = "GET_AWAITABLE",
- [MAKE_FUNCTION] = "MAKE_FUNCTION",
+ [STORE_SUBSCR_DICT] = "STORE_SUBSCR_DICT",
[BUILD_SLICE] = "BUILD_SLICE",
[JUMP_BACKWARD_NO_INTERRUPT] = "JUMP_BACKWARD_NO_INTERRUPT",
[MAKE_CELL] = "MAKE_CELL",
@@ -422,7 +423,7 @@ static const char *const _PyOpcode_OpName[267] = {
[CALL_INTRINSIC_2] = "CALL_INTRINSIC_2",
[LOAD_FROM_DICT_OR_GLOBALS] = "LOAD_FROM_DICT_OR_GLOBALS",
[LOAD_FROM_DICT_OR_DEREF] = "LOAD_FROM_DICT_OR_DEREF",
- [177] = "<177>",
+ [SET_FUNCTION_ATTRIBUTE] = "SET_FUNCTION_ATTRIBUTE",
[178] = "<178>",
[179] = "<179>",
[180] = "<180>",
@@ -520,7 +521,6 @@ static const char *const _PyOpcode_OpName[267] = {
case 161: \
case 166: \
case 167: \
- case 177: \
case 178: \
case 179: \
case 180: \
diff --git a/Include/opcode.h b/Include/opcode.h
index 7f69fd6..be53899 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -19,6 +19,7 @@ extern "C" {
#define UNARY_NOT 12
#define UNARY_INVERT 15
#define RESERVED 17
+#define MAKE_FUNCTION 24
#define BINARY_SUBSCR 25
#define BINARY_SLICE 26
#define STORE_SLICE 27
@@ -87,7 +88,6 @@ extern "C" {
#define POP_JUMP_IF_NONE 129
#define RAISE_VARARGS 130
#define GET_AWAITABLE 131
-#define MAKE_FUNCTION 132
#define BUILD_SLICE 133
#define JUMP_BACKWARD_NO_INTERRUPT 134
#define MAKE_CELL 135
@@ -123,6 +123,7 @@ extern "C" {
#define CALL_INTRINSIC_2 174
#define LOAD_FROM_DICT_OR_GLOBALS 175
#define LOAD_FROM_DICT_OR_DEREF 176
+#define SET_FUNCTION_ATTRIBUTE 177
#define ENTER_EXECUTOR 230
#define MIN_INSTRUMENTED_OPCODE 237
#define INSTRUMENTED_LOAD_SUPER_ATTR 237
@@ -169,47 +170,47 @@ extern "C" {
#define BINARY_SUBSCR_LIST_INT 21
#define BINARY_SUBSCR_TUPLE_INT 22
#define CALL_PY_EXACT_ARGS 23
-#define CALL_PY_WITH_DEFAULTS 24
-#define CALL_BOUND_METHOD_EXACT_ARGS 28
-#define CALL_BUILTIN_CLASS 29
-#define CALL_BUILTIN_FAST_WITH_KEYWORDS 34
-#define CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 38
-#define CALL_NO_KW_BUILTIN_FAST 39
-#define CALL_NO_KW_BUILTIN_O 40
-#define CALL_NO_KW_ISINSTANCE 41
-#define CALL_NO_KW_LEN 42
-#define CALL_NO_KW_LIST_APPEND 43
-#define CALL_NO_KW_METHOD_DESCRIPTOR_FAST 44
-#define CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS 45
-#define CALL_NO_KW_METHOD_DESCRIPTOR_O 46
-#define CALL_NO_KW_STR_1 47
-#define CALL_NO_KW_TUPLE_1 48
-#define CALL_NO_KW_TYPE_1 56
-#define COMPARE_OP_FLOAT 57
-#define COMPARE_OP_INT 58
-#define COMPARE_OP_STR 59
-#define FOR_ITER_LIST 62
-#define FOR_ITER_TUPLE 63
-#define FOR_ITER_RANGE 64
-#define FOR_ITER_GEN 65
-#define LOAD_SUPER_ATTR_ATTR 66
-#define LOAD_SUPER_ATTR_METHOD 67
-#define LOAD_ATTR_CLASS 70
-#define LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN 72
-#define LOAD_ATTR_INSTANCE_VALUE 73
-#define LOAD_ATTR_MODULE 76
-#define LOAD_ATTR_PROPERTY 77
-#define LOAD_ATTR_SLOT 78
-#define LOAD_ATTR_WITH_HINT 79
-#define LOAD_ATTR_METHOD_LAZY_DICT 80
-#define LOAD_ATTR_METHOD_NO_DICT 81
-#define LOAD_ATTR_METHOD_WITH_VALUES 82
-#define LOAD_GLOBAL_BUILTIN 84
-#define LOAD_GLOBAL_MODULE 86
-#define STORE_ATTR_INSTANCE_VALUE 88
-#define STORE_ATTR_SLOT 111
-#define STORE_ATTR_WITH_HINT 112
-#define STORE_SUBSCR_DICT 113
+#define CALL_PY_WITH_DEFAULTS 28
+#define CALL_BOUND_METHOD_EXACT_ARGS 29
+#define CALL_BUILTIN_CLASS 34
+#define CALL_BUILTIN_FAST_WITH_KEYWORDS 38
+#define CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 39
+#define CALL_NO_KW_BUILTIN_FAST 40
+#define CALL_NO_KW_BUILTIN_O 41
+#define CALL_NO_KW_ISINSTANCE 42
+#define CALL_NO_KW_LEN 43
+#define CALL_NO_KW_LIST_APPEND 44
+#define CALL_NO_KW_METHOD_DESCRIPTOR_FAST 45
+#define CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS 46
+#define CALL_NO_KW_METHOD_DESCRIPTOR_O 47
+#define CALL_NO_KW_STR_1 48
+#define CALL_NO_KW_TUPLE_1 56
+#define CALL_NO_KW_TYPE_1 57
+#define COMPARE_OP_FLOAT 58
+#define COMPARE_OP_INT 59
+#define COMPARE_OP_STR 62
+#define FOR_ITER_LIST 63
+#define FOR_ITER_TUPLE 64
+#define FOR_ITER_RANGE 65
+#define FOR_ITER_GEN 66
+#define LOAD_SUPER_ATTR_ATTR 67
+#define LOAD_SUPER_ATTR_METHOD 70
+#define LOAD_ATTR_CLASS 72
+#define LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN 73
+#define LOAD_ATTR_INSTANCE_VALUE 76
+#define LOAD_ATTR_MODULE 77
+#define LOAD_ATTR_PROPERTY 78
+#define LOAD_ATTR_SLOT 79
+#define LOAD_ATTR_WITH_HINT 80
+#define LOAD_ATTR_METHOD_LAZY_DICT 81
+#define LOAD_ATTR_METHOD_NO_DICT 82
+#define LOAD_ATTR_METHOD_WITH_VALUES 84
+#define LOAD_GLOBAL_BUILTIN 86
+#define LOAD_GLOBAL_MODULE 88
+#define STORE_ATTR_INSTANCE_VALUE 111
+#define STORE_ATTR_SLOT 112
+#define STORE_ATTR_WITH_HINT 113
+#define STORE_SUBSCR_DICT 132
#define STORE_SUBSCR_LIST_INT 148
#define UNPACK_SEQUENCE_LIST 153
#define UNPACK_SEQUENCE_TUPLE 154