mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)
This commit is contained in:
parent
949c58f945
commit
38752760c9
3 changed files with 21 additions and 22 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue