gh-98831: rewrite SEND, GET_YIELD_FROM_ITER, RETURN_GENERATOR in the instruction definition DSL (#101516)

This commit is contained in:
Irit Katriel 2023-02-03 11:30:21 +00:00 committed by GitHub
parent a52cc9853f
commit 04e06e20ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 43 deletions

View file

@ -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: