bpo-46841: Use inline caching for attribute accesses (GH-31640)

This commit is contained in:
Brandt Bucher 2022-03-03 15:31:00 -08:00 committed by GitHub
parent 65b92ccdec
commit 05a8bc1c94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 292 additions and 270 deletions

View file

@ -390,6 +390,8 @@ _code_type = type(_write_atomic.__code__)
# Python 3.11a5 3481 (Use inline cache for BINARY_OP)
# Python 3.11a5 3482 (Use inline caching for UNPACK_SEQUENCE and LOAD_GLOBAL)
# Python 3.11a5 3483 (Use inline caching for COMPARE_OP and BINARY_SUBSCR)
# Python 3.11a5 3484 (Use inline caching for LOAD_ATTR, LOAD_METHOD, and
# STORE_ATTR)
# Python 3.12 will start with magic number 3500
@ -404,7 +406,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
MAGIC_NUMBER = (3483).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3484).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'