mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-42093: Add opcode cache for LOAD_ATTR (GH-22803)
This commit is contained in:
parent
871934d4cf
commit
109826c850
7 changed files with 296 additions and 7 deletions
|
@ -301,8 +301,8 @@ _PyCode_InitOpcache(PyCodeObject *co)
|
|||
unsigned char opcode = _Py_OPCODE(opcodes[i]);
|
||||
i++; // 'i' is now aligned to (next_instr - first_instr)
|
||||
|
||||
// TODO: LOAD_METHOD, LOAD_ATTR
|
||||
if (opcode == LOAD_GLOBAL) {
|
||||
// TODO: LOAD_METHOD
|
||||
if (opcode == LOAD_GLOBAL || opcode == LOAD_ATTR) {
|
||||
opts++;
|
||||
co->co_opcache_map[i] = (unsigned char)opts;
|
||||
if (opts > 254) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue