summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
Commit message (Collapse)AuthorAgeFilesLines
* GH-100222: Redefine _Py_CODEUNIT as a union to clarify structure of code ↵Mark Shannon2022-12-141-13/+13
| | | | unit. (GH-100223)
* GH-98522: Add version number to code objects. (GH-98525)Mark Shannon2022-12-091-0/+1
| | | | | | * Add version number to code object for better versioning of functions. * Improves specialization for closures and list comprehensions.
* GH-100110: Specialize FOR_ITER for tuples (GH-100109)Ken Jin2022-12-091-0/+23
| | | * Specialize FOR_ITER for tuples
* GH-98831: Generate things in the input order (#100123)Guido van Rossum2022-12-081-237/+237
| | | | This makes it easier to see what changed in the generated code when converting an instruction to super or macro.
* GH-98831: Typed stack effects, and more instructions converted (#99764)Guido van Rossum2022-12-081-244/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stack effects can now have a type, e.g. `inst(X, (left, right -- jump/uint64_t)) { ... }`. Instructions converted to the non-legacy format: * COMPARE_OP * COMPARE_OP_FLOAT_JUMP * COMPARE_OP_INT_JUMP * COMPARE_OP_STR_JUMP * STORE_ATTR * DELETE_ATTR * STORE_GLOBAL * STORE_ATTR_INSTANCE_VALUE * STORE_ATTR_WITH_HINT * STORE_ATTR_SLOT, and complete the store_attr family * Complete the store_subscr family: STORE_SUBSCR{,DICT,LIST_INT} (STORE_SUBSCR was alread half converted, but wasn't using cache effects yet.) * DELETE_SUBSCR * PRINT_EXPR * INTERPRETER_EXIT (a bit weird, ends in return) * RETURN_VALUE * GET_AITER (had to restructure it some) The original had mysterious `SET_TOP(NULL)` before `goto error`. I assume those just account for `obj` having been decref'ed, so I got rid of them in favor of the cleanup implied by `ERROR_IF()`. * LIST_APPEND (a bit unhappy with it) * SET_ADD (also a bit unhappy with it) Various other improvements/refactorings as well.
* GH-99729: Unlink frames before clearing them (GH-100030)Brandt Bucher2022-12-061-1/+4
|
* GH-98831: Support cache effects in super- and macro instructions (#99601)Guido van Rossum2022-12-031-2/+2
|
* gh-89189: More compact range iterator (GH-27986)Serhiy Storchaka2022-11-301-3/+4
|
* GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)Guido van Rossum2022-11-231-43/+60
| | | | | | | | | | | | | | Newly supported interpreter definition syntax: - `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }` - `macro(NAME) = OP1 + OP2;` Also some other random improvements: - Convert `WITH_EXCEPT_START` to use stack effects - Fix lexer to balk at unrecognized characters, e.g. `@` - Fix moved output names; support object pointers in cache - Introduce `error()` method to print errors - Introduce read_uint16(p) as equivalent to `*p` Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* GH-98831: Refactor and fix cases generator (#99526)Guido van Rossum2022-11-181-29/+36
| | | | Also complete cache effects for BINARY_SUBSCR family.
* GH-99298: Clean up attribute specializations (GH-99398)Brandt Bucher2022-11-171-10/+2
|
* GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)Brandt Bucher2022-11-171-36/+24
|
* Add a macro for "inlining" new frames (GH-99490)Brandt Bucher2022-11-171-43/+9
|
* GH-98831: Implement basic cache effects (#99313)Guido van Rossum2022-11-161-17/+18
|
* gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code ↵Hood Chatham2022-11-151-3/+3
| | | | paths (#99461)
* GH-98831: Remove all remaining DISPATCH() calls from bytecodes.c (#99271)Guido van Rossum2022-11-101-75/+87
| | | | | Also mark those opcodes that have no stack effect as such. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* GH-99298: Don't perform jumps before error handling (GH-99299)Brandt Bucher2022-11-101-15/+19
|
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-77/+59
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* gh-99300: Use Py_NewRef() in Python/ceval.c (#99318)Victor Stinner2022-11-101-56/+30
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Python/ceval.c and related files.
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-091-198/+109
|
* GH-98831: Simple input-output stack effects for bytecodes.c (#99120)Guido van Rossum2022-11-081-158/+174
|
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-071-4/+39
|
* GH-98831: Implement super-instruction generation (#99084)Guido van Rossum2022-11-061-62/+82
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-99104: Update headers for bytecodes.c and generate_cases.py (#99112)Guido van Rossum2022-11-051-1/+1
| | | Also tweak the labels near the end of bytecodes.c.
* GH-96793: Implement PEP 479 in bytecode. (GH-99006)Mark Shannon2022-11-031-0/+42
| | | | | * Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-031-0/+3860
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).