mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516)
This commit is contained in:
parent
a52cc9853f
commit
04e06e20ee
3 changed files with 41 additions and 43 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue