aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/makeopcodetargets.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-06-10 08:46:01 +0100
committerGitHub <noreply@github.com>2021-06-10 08:46:01 +0100
commite117c0283705943189e6b1aef668a1f68f3f00a4 (patch)
tree2f0ed87b3a6ee853b65b7db260b39d62337e87bd /Python/makeopcodetargets.py
parent309ab616020f8504ced8ca64f7d7abc2df25a37f (diff)
downloadcpython-e117c0283705943189e6b1aef668a1f68f3f00a4.tar.gz
cpython-e117c0283705943189e6b1aef668a1f68f3f00a4.zip
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
Diffstat (limited to 'Python/makeopcodetargets.py')
-rwxr-xr-xPython/makeopcodetargets.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/makeopcodetargets.py b/Python/makeopcodetargets.py
index 023c9e6c9f1..189d72a8c84 100755
--- a/Python/makeopcodetargets.py
+++ b/Python/makeopcodetargets.py
@@ -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")