8000 bpo-46841: Inline cache for `BINARY_SUBSCR`. by markshannon · Pull Request #31618 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46841: Inline cache for BINARY_SUBSCR. #31618

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 11 commits into from
Mar 1, 2022
Prev Previous commit
Next Next commit
Tidy up
  • Loading branch information
markshannon committed Feb 28, 2022
commit a3305741b27de31d45da363046dbfd2bf7b7e691
18 changes: 4 additions & 14 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,13 @@ typedef struct {
} _PyBinaryOpCache;

#define INLINE_CACHE_ENTRIES_BINARY_OP CACHE_ENTRIES(_PyBinaryOpCache)

typedef struct {
_Py_CODEUNIT counter;
} _PyUnpackSequenceCache;









#define INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE \
CACHE_ENTRIES(_PyUnpackSequenceCache)

typedef struct {
_Py_CODEUNIT counter;
Expand All @@ -98,12 +93,7 @@ typedef struct {
_Py_CODEUNIT func_version;
} _PyBinarySubscrCache;


#define INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE \
(sizeof(_PyUnpackSequenceCache) / sizeof(_Py_CODEUNIT))

#define INLINE_CACHE_ENTRIES_BINARY_SUBSCR \
(sizeof(_PyBinarySubscrCache) / sizeof(_Py_CODEUNIT))
#define INLINE_CACHE_ENTRIES_BINARY_SUBSCR CACHE_ENTRIES(_PyBinarySubscrCache)

/* Maximum size of code to quicken, in code units. */
#define MAX_SIZE_TO_QUICKEN 5000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use inline cache for :opcode:`BINARY_SUBSCR`.
0