bpo-42093: Add opcode cache for LOAD_ATTR (GH-22803)

This commit is contained in:
Pablo Galindo 2020-10-20 06:22:44 +01:00 committed by GitHub
parent 871934d4cf
commit 109826c850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 296 additions and 7 deletions

View file

@ -10,9 +10,16 @@ typedef struct {
uint64_t builtins_ver; /* ma_version of builtin dict */
} _PyOpcache_LoadGlobal;
typedef struct {
PyTypeObject *type;
Py_ssize_t hint;
unsigned int tp_version_tag;
} _PyOpCodeOpt_LoadAttr;
struct _PyOpcache {
union {
_PyOpcache_LoadGlobal lg;
_PyOpCodeOpt_LoadAttr la;
} u;
char optimized;
};