gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)

This commit is contained in:
Irit Katriel 2023-02-06 22:45:18 +00:00 committed by GitHub
parent 949c58f945
commit 38752760c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 22 deletions

View file

@ -333,11 +333,11 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
case FORMAT_VALUE:
return -1;
case COPY:
return -1;
return (oparg-1) + 1;
case BINARY_OP:
return 2;
case SWAP:
return -1;
return (oparg-2) + 2;
case EXTENDED_ARG:
return 0;
case CACHE:
@ -679,11 +679,11 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
case FORMAT_VALUE:
return -1;
case COPY:
return -1;
return (oparg-1) + 2;
case BINARY_OP:
return 1;
case SWAP:
return -1;
return (oparg-2) + 2;
case EXTENDED_ARG:
return 0;
case CACHE: