mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-100712: make it possible to disable specialization (for debugging) (#100713)
This commit is contained in:
parent
a1e051a237
commit
e9ccfe4a63
11 changed files with 87 additions and 3 deletions
|
@ -85,6 +85,7 @@ def main(opcode_py, outfile='Include/opcode.h', internaloutfile='Include/interna
|
|||
is_pseudo = opcode['is_pseudo']
|
||||
_pseudo_ops = opcode['_pseudo_ops']
|
||||
|
||||
ENABLE_SPECIALIZATION = opcode["ENABLE_SPECIALIZATION"]
|
||||
HAVE_ARGUMENT = opcode["HAVE_ARGUMENT"]
|
||||
MIN_PSEUDO_OPCODE = opcode["MIN_PSEUDO_OPCODE"]
|
||||
MAX_PSEUDO_OPCODE = opcode["MAX_PSEUDO_OPCODE"]
|
||||
|
@ -171,6 +172,10 @@ def main(opcode_py, outfile='Include/opcode.h', internaloutfile='Include/interna
|
|||
for i, (op, _) in enumerate(opcode["_nb_ops"]):
|
||||
fobj.write(DEFINE.format(op, i))
|
||||
|
||||
fobj.write("\n")
|
||||
fobj.write("/* Defined in Lib/opcode.py */\n")
|
||||
fobj.write(f"#define ENABLE_SPECIALIZATION {int(ENABLE_SPECIALIZATION)}")
|
||||
|
||||
iobj.write("\n")
|
||||
iobj.write("#ifdef Py_DEBUG\n")
|
||||
iobj.write(f"static const char *const _PyOpcode_OpName[{NUM_OPCODES}] = {{\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue