mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
gh-105481: generate _specializations and _specialized_instructions from bytecodes.c (#105913)
This commit is contained in:
parent
28187a9c4f
commit
33f0a8578b
12 changed files with 345 additions and 277 deletions
|
@ -25,12 +25,13 @@ def write_contents(f):
|
|||
"""Write C code contents to the target file object.
|
||||
"""
|
||||
opcode = find_module('opcode')
|
||||
_opcode_metadata = find_module('_opcode_metadata')
|
||||
targets = ['_unknown_opcode'] * 256
|
||||
for opname, op in opcode.opmap.items():
|
||||
if not opcode.is_pseudo(op):
|
||||
targets[op] = "TARGET_%s" % opname
|
||||
next_op = 1
|
||||
for opname in opcode._specialized_instructions:
|
||||
for opname in _opcode_metadata._specialized_instructions:
|
||||
while targets[next_op] != '_unknown_opcode':
|
||||
next_op += 1
|
||||
targets[next_op] = "TARGET_%s" % opname
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue