summaryrefslogtreecommitdiffstats
path: root/Python/opcode_metadata.h
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 /Python/opcode_metadata.h
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 'Python/opcode_metadata.h')
-rw-r--r--Python/opcode_metadata.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h
index cbe3861..7c0cbdb 100644
--- a/Python/opcode_metadata.h
+++ b/Python/opcode_metadata.h
@@ -395,7 +395,9 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
case CALL_FUNCTION_EX:
return ((oparg & 1) ? 1 : 0) + 3;
case MAKE_FUNCTION:
- return ((oparg & MAKE_FUNCTION_DEFAULTS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_KWDEFAULTS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_ANNOTATIONS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_CLOSURE) ? 1 : 0) + 1;
+ return 1;
+ case SET_FUNCTION_ATTRIBUTE:
+ return 2;
case RETURN_GENERATOR:
return 0;
case BUILD_SLICE:
@@ -812,6 +814,8 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 1;
case MAKE_FUNCTION:
return 1;
+ case SET_FUNCTION_ATTRIBUTE:
+ return 1;
case RETURN_GENERATOR:
return 0;
case BUILD_SLICE:
@@ -1049,7 +1053,8 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[512] = {
[CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = { true, INSTR_FMT_IBC00 },
[INSTRUMENTED_CALL_FUNCTION_EX] = { true, INSTR_FMT_IX },
[CALL_FUNCTION_EX] = { true, INSTR_FMT_IB },
- [MAKE_FUNCTION] = { true, INSTR_FMT_IB },
+ [MAKE_FUNCTION] = { true, INSTR_FMT_IX },
+ [SET_FUNCTION_ATTRIBUTE] = { true, INSTR_FMT_IB },
[RETURN_GENERATOR] = { true, INSTR_FMT_IX },
[BUILD_SLICE] = { true, INSTR_FMT_IB },
[FORMAT_VALUE] = { true, INSTR_FMT_IB },