gh-98831: rewrite GET_LEN, GET_ITER, BEFORE_WITH and a few simple opcodes in the instruction definition DSL (#101443)

This commit is contained in:
Irit Katriel 2023-01-31 10:23:15 +00:00 committed by GitHub
parent 909a674693
commit 29a858b85f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 69 deletions

View file

@ -245,9 +245,9 @@ _PyOpcode_num_popped(int opcode, int oparg) {
case JUMP_IF_TRUE_OR_POP:
return -1;
case JUMP_BACKWARD_NO_INTERRUPT:
return -1;
return 0;
case GET_LEN:
return -1;
return 1;
case MATCH_CLASS:
return 3;
case MATCH_MAPPING:
@ -257,7 +257,7 @@ _PyOpcode_num_popped(int opcode, int oparg) {
case MATCH_KEYS:
return 2;
case GET_ITER:
return -1;
return 1;
case GET_YIELD_FROM_ITER:
return -1;
case FOR_ITER:
@ -273,7 +273,7 @@ _PyOpcode_num_popped(int opcode, int oparg) {
case BEFORE_ASYNC_WITH:
return -1;
case BEFORE_WITH:
return -1;
return 1;
case WITH_EXCEPT_START:
return 4;
case PUSH_EXC_INFO:
@ -287,7 +287,7 @@ _PyOpcode_num_popped(int opcode, int oparg) {
case CALL_BOUND_METHOD_EXACT_ARGS:
return -1;
case KW_NAMES:
return -1;
return 0;
case CALL:
return -1;
case CALL_PY_EXACT_ARGS:
@ -339,9 +339,9 @@ _PyOpcode_num_popped(int opcode, int oparg) {
case SWAP:
return -1;
case EXTENDED_ARG:
return -1;
return 0;
case CACHE:
return -1;
return 0;
default:
Py_UNREACHABLE();
}
@ -591,9 +591,9 @@ _PyOpcode_num_pushed(int opcode, int oparg) {
case JUMP_IF_TRUE_OR_POP:
return -1;
case JUMP_BACKWARD_NO_INTERRUPT:
return -1;
return 0;
case GET_LEN:
return -1;
return 2;
case MATCH_CLASS:
return 1;
case MATCH_MAPPING:
@ -603,7 +603,7 @@ _PyOpcode_num_pushed(int opcode, int oparg) {
case MATCH_KEYS:
return 3;
case GET_ITER:
return -1;
return 1;
case GET_YIELD_FROM_ITER:
return -1;
case FOR_ITER:
@ -619,7 +619,7 @@ _PyOpcode_num_pushed(int opcode, int oparg) {
case BEFORE_ASYNC_WITH:
return -1;
case BEFORE_WITH:
return -1;
return 2;
case WITH_EXCEPT_START:
return 5;
case PUSH_EXC_INFO:
@ -633,7 +633,7 @@ _PyOpcode_num_pushed(int opcode, int oparg) {
case CALL_BOUND_METHOD_EXACT_ARGS:
return -1;
case KW_NAMES:
return -1;
return 0;
case CALL:
return -1;
case CALL_PY_EXACT_ARGS:
@ -685,9 +685,9 @@ _PyOpcode_num_pushed(int opcode, int oparg) {
case SWAP:
return -1;
case EXTENDED_ARG:
return -1;
return 0;
case CACHE:
return -1;
return 0;
default:
Py_UNREACHABLE();
}