Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3098,11 +3098,9 @@ dummy_func(
PUSH(result);
}

// stack effect: ( -- __0)
inst(COPY) {
assert(oparg != 0);
PyObject *peek = PEEK(oparg);
PUSH(Py_NewRef(peek));
inst(COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
assert(oparg > 0);
top = Py_NewRef(bottom);
}

inst(BINARY_OP, (unused/1, lhs, rhs -- res)) {
Expand All @@ -3126,12 +3124,9 @@ dummy_func(
ERROR_IF(res == NULL, error);
}

// stack effect: ( -- )
inst(SWAP) {
assert(oparg != 0);
PyObject *top = TOP();
SET_TOP(PEEK(oparg));
PEEK(oparg) = top;
inst(SWAP, (bottom, unused[oparg-2], top --
top, unused[oparg-2], bottom)) {
assert(oparg >= 2);
}

inst(EXTENDED_ARG, (--)) {
Expand Down
18 changes: 11 additions & 7 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Python/opcode_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down