mirror of
https://github.com/python/cpython.git
synced 2025-09-02 15:07:53 +00:00
bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595)
* Specialize LOAD_ATTR with LOAD_ATTR_SLOT and LOAD_ATTR_SPLIT_KEYS * Move dict-common.h to internal/pycore_dict.h * Add LOAD_ATTR_WITH_HINT specialized opcode. * Quicken in function if loopy * Specialize LOAD_ATTR for module attributes. * Add specialization stats
This commit is contained in:
parent
309ab61602
commit
e117c02837
14 changed files with 511 additions and 221 deletions
|
@ -34,6 +34,11 @@ def write_contents(f):
|
|||
targets = ['_unknown_opcode'] * 256
|
||||
for opname, op in opcode.opmap.items():
|
||||
targets[op] = "TARGET_%s" % opname
|
||||
next_op = 1
|
||||
for opname in opcode._specialized_instructions:
|
||||
while targets[next_op] != '_unknown_opcode':
|
||||
next_op += 1
|
||||
targets[next_op] = "TARGET_%s" % opname
|
||||
f.write("static void *opcode_targets[256] = {\n")
|
||||
f.write(",\n".join([" &&%s" % s for s in targets]))
|
||||
f.write("\n};\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue