summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_opcode_metadata.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-06-17 13:40:11 (GMT)
committerGitHub <noreply@github.com>2024-06-17 13:40:11 (GMT)
commit274f844830898355f14d6edb6e71894a2f37e53c (patch)
tree0f6ef2d7e7fd30f42fe83bbc05859314ac1c230a /Include/internal/pycore_opcode_metadata.h
parent79e09e60d865b7b3fcde9ccee86a502da82bb2b3 (diff)
downloadcpython-274f844830898355f14d6edb6e71894a2f37e53c.zip
cpython-274f844830898355f14d6edb6e71894a2f37e53c.tar.gz
cpython-274f844830898355f14d6edb6e71894a2f37e53c.tar.bz2
GH-120619: Clean up `RETURN_VALUE` instruction (GH-120624)
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
Diffstat (limited to 'Include/internal/pycore_opcode_metadata.h')
-rw-r--r--Include/internal/pycore_opcode_metadata.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h
index 0b83523..1e9c619 100644
--- a/Include/internal/pycore_opcode_metadata.h
+++ b/Include/internal/pycore_opcode_metadata.h
@@ -831,11 +831,11 @@ int _PyOpcode_num_pushed(int opcode, int oparg) {
case RESUME_CHECK:
return 0;
case RETURN_CONST:
- return 0;
+ return 1;
case RETURN_GENERATOR:
return 1;
case RETURN_VALUE:
- return 0;
+ return 1;
case SEND:
return 2;
case SEND_GEN:
@@ -1346,9 +1346,9 @@ _PyOpcode_macro_expansion[256] = {
[PUSH_EXC_INFO] = { .nuops = 1, .uops = { { _PUSH_EXC_INFO, 0, 0 } } },
[PUSH_NULL] = { .nuops = 1, .uops = { { _PUSH_NULL, 0, 0 } } },
[RESUME_CHECK] = { .nuops = 1, .uops = { { _RESUME_CHECK, 0, 0 } } },
- [RETURN_CONST] = { .nuops = 2, .uops = { { _LOAD_CONST, 0, 0 }, { _POP_FRAME, 0, 0 } } },
+ [RETURN_CONST] = { .nuops = 2, .uops = { { _LOAD_CONST, 0, 0 }, { _RETURN_VALUE, 0, 0 } } },
[RETURN_GENERATOR] = { .nuops = 1, .uops = { { _RETURN_GENERATOR, 0, 0 } } },
- [RETURN_VALUE] = { .nuops = 1, .uops = { { _POP_FRAME, 0, 0 } } },
+ [RETURN_VALUE] = { .nuops = 1, .uops = { { _RETURN_VALUE, 0, 0 } } },
[SETUP_ANNOTATIONS] = { .nuops = 1, .uops = { { _SETUP_ANNOTATIONS, 0, 0 } } },
[SET_ADD] = { .nuops = 1, .uops = { { _SET_ADD, 0, 0 } } },
[SET_FUNCTION_ATTRIBUTE] = { .nuops = 1, .uops = { { _SET_FUNCTION_ATTRIBUTE, 0, 0 } } },