cpython/Python
Guido van Rossum 41bc101dd6
GH-98831: "Generate" the interpreter (#98830)
The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code).

The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md.

This is surely a work-in-progress. An easy next step could be auto-generating super-instructions.

**IMPORTANT: Merge Conflicts**

If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
2022-11-02 21:31:26 -07:00
..
clinic GH-98686: Quicken everything (GH-98687) 2022-11-02 10:42:57 -07:00
deepfreeze gh-97669: Create Tools/build/ directory (#97963) 2022-10-17 12:01:00 +02:00
frozen_modules gh-97669: Create Tools/build/ directory (#97963) 2022-10-17 12:01:00 +02:00
_warnings.c gh-97841: Add methoddef for _filters_mutated (gh-98115) 2022-10-09 20:16:33 +09:00
adaptive.md
asdl.c
asm_trampoline.S gh-96143: Move the perf trampoline files to the Python directory (#98675) 2022-10-25 23:34:22 +01:00
ast.c GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510) 2022-10-05 01:34:03 +01:00
ast_opt.c GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510) 2022-10-05 01:34:03 +01:00
ast_unparse.c
bltinmodule.c gh-96526: Clarify format and __format__ docstrings (gh-96648) 2022-10-03 15:28:02 -07:00
bootstrap_hash.c
bytecodes.c GH-98831: "Generate" the interpreter (#98830) 2022-11-02 21:31:26 -07:00
ceval.c GH-98831: "Generate" the interpreter (#98830) 2022-11-02 21:31:26 -07:00
ceval_gil.c gh-97922: Run the GC only on eval breaker (#97920) 2022-10-08 07:57:09 -07:00
codecs.c
compile.c gh-87092: remove unused SET_LOC/UNSET_LOC macros (GH-98914) 2022-11-02 15:52:11 +00:00
condvar.h
context.c
dtoa.c
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
errors.c gh-91058: Add error suggestions to 'import from' import errors (#98305) 2022-10-25 23:56:59 +01:00
fileutils.c
formatter_unicode.c
frame.c GH-97002: Prevent _PyInterpreterFrames from backing more than one PyFrameObject (GH-97996) 2022-10-07 00:20:01 +01:00
frozen.c gh-97669: Create Tools/build/ directory (#97963) 2022-10-17 12:01:00 +02:00
frozenmain.c
future.c gh-87092: do not allocate PyFutureFeatures dynamically (GH-98913) 2022-11-02 15:13:07 +00:00
generated_cases.c.h GH-98831: "Generate" the interpreter (#98830) 2022-11-02 21:31:26 -07:00
getargs.c GH-95909: Make _PyArg_Parser initialization thread safe (GH-95958) 2022-08-16 11:22:14 -07:00
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
hamt.c
hashtable.c
import.c gh-98354: Add unicode check for 'name' attribute in _imp_create_builtin (GH-98412) 2022-10-19 17:25:10 -07:00
importdl.c
importdl.h
importlib.h bpo-38693: Use f-strings instead of str.format() within importlib (#17058) 2022-10-06 16:43:16 -07:00
initconfig.c gh-98608: Change _Py_NewInterpreter() to _Py_NewInterpreterFromConfig() (gh-98609) 2022-10-26 11:16:30 -06:00
makeopcodetargets.py
marshal.c gh-98925: Lower marshal recursion depth for WASI (GH-98938) 2022-11-01 15:51:05 -07:00
modsupport.c
mysnprintf.c Add a warning message about PyOS_snprintf (#95993) 2022-10-07 11:49:53 -07:00
mystrtoul.c
opcode_targets.h GH-98686: Quicken everything (GH-98687) 2022-11-02 10:42:57 -07:00
pathconfig.c
perf_trampoline.c gh-96143: Move the perf trampoline files to the Python directory (#98675) 2022-10-25 23:34:22 +01:00
preconfig.c
pyarena.c
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618) 2022-10-31 12:35:54 -07:00
pymath.c
pystate.c gh-98608: Change _Py_NewInterpreter() to _Py_NewInterpreterFromConfig() (gh-98609) 2022-10-26 11:16:30 -06:00
pystrcmp.c
pystrhex.c
pystrtod.c
Python-ast.c GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510) 2022-10-05 01:34:03 +01:00
Python-tokenize.c gh-97973: Return all necessary information from the tokenizer (GH-97984) 2022-10-06 16:07:17 -07:00
pythonrun.c gh-98254: Include stdlib module names in error messages for NameErrors (#98255) 2022-10-15 23:13:33 +01:00
pytime.c
README
specialize.c GH-98686: Quicken everything (GH-98687) 2022-11-02 10:42:57 -07:00
stdlib_module_names.h gh-90716: add _pylong.py module (#96673) 2022-10-25 22:00:50 -07:00
structmember.c
suggestions.c gh-91058: Add error suggestions to 'import from' import errors (#98305) 2022-10-25 23:56:59 +01:00
symtable.c gh-87092: do not allocate PyFutureFeatures dynamically (GH-98913) 2022-11-02 15:13:07 +00:00
sysmodule.c GH-98686: Quicken everything (GH-98687) 2022-11-02 10:42:57 -07:00
thread.c gh-96125: Fix sys.thread_info.name on pthread platforms (GH-96126) 2022-08-19 12:41:25 -07:00
thread_nt.h
thread_pthread.h gh-95174: Add pthread stubs for WASI (GH-95234) 2022-07-27 20:28:06 +02:00
thread_pthread_stubs.h gh-95174: Add pthread stubs for WASI (GH-95234) 2022-07-27 20:28:06 +02:00
traceback.c

Miscellaneous source files for the main Python shared library