8000 bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. by ericsnowcurrently · Pull Request #26396 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. #26396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 7, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Drop _Py_MAX_OPARG (and add a note about max oparg size).
  • Loading branch information
ericsnowcurrently committed Jun 7, 2021
commit 1a8400e74e845874afd1ef75e9af50bdba8f8e49
11 changes: 9 additions & 2 deletions Include/cpython/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
# error "this header file must not be included directly"
#endif

/* Each instruction in a code object is a fixed-width value,
* currently 2 bytes: 1-byte opcode + 1-byte oparg. The EXTENDED_ARG
* opcode allows for larger values but the current limit is 3 uses
* of EXTENDED_ARG (see Python/wordcode_helpers.h), for a maximum
* 32-bit value. This aligns with the note in Python/compile.c
* (compiler_addop_i_line) indicating that the max oparg value is
* 2**32 - 1, rather than INT_MAX.
*/

typedef uint16_t _Py_CODEUNIT;
// Each oparg must fit in the second half of _Py_CODEUNIT, hence 8 bits.
#define _Py_MAX_OPARG 255

#ifdef WORDS_BIGENDIAN
# define _Py_OPCODE(word) ((word) >> 8)
Expand Down
0