diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-02-03 11:30:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 11:30:21 (GMT) |
commit | 04e06e20ee61f3c0d1d7a827b2feb4ed41bb198d (patch) | |
tree | 88cda5d765a9aaf51238aefe3eea308bd87aa75d /Python/opcode_metadata.h | |
parent | a52cc9853fed39b5cc90b7ffb6a64249307a990b (diff) | |
download | cpython-04e06e20ee61f3c0d1d7a827b2feb4ed41bb198d.zip cpython-04e06e20ee61f3c0d1d7a827b2feb4ed41bb198d.tar.gz cpython-04e06e20ee61f3c0d1d7a827b2feb4ed41bb198d.tar.bz2 |
gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516)
Diffstat (limited to 'Python/opcode_metadata.h')
-rw-r--r-- | Python/opcode_metadata.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index ca3dde3..256f81a 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -99,7 +99,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case GET_AWAITABLE: return 1; case SEND: - return -1; + return 2; case YIELD_VALUE: return 1; case POP_EXCEPT: @@ -259,7 +259,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case GET_ITER: return 1; case GET_YIELD_FROM_ITER: - return -1; + return 1; case FOR_ITER: return -1; case FOR_ITER_LIST: @@ -327,7 +327,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case MAKE_FUNCTION: return -1; case RETURN_GENERATOR: - return -1; + return 0; case BUILD_SLICE: return -1; case FORMAT_VALUE: @@ -445,7 +445,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case GET_AWAITABLE: return 1; case SEND: - return -1; + return ((!jump) ? 1 : 0) + 1; case YIELD_VALUE: return 1; case POP_EXCEPT: @@ -605,7 +605,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case GET_ITER: return 1; case GET_YIELD_FROM_ITER: - return -1; + return 1; case FOR_ITER: return -1; case FOR_ITER_LIST: @@ -673,7 +673,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case MAKE_FUNCTION: return -1; case RETURN_GENERATOR: - return -1; + return 0; case BUILD_SLICE: return -1; case FORMAT_VALUE: |