summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
Commit message (Collapse)AuthorAgeFilesLines
...
* GH-111485: Test the new cases generator (GH-113252)Mark Shannon2023-12-181-13/+13
|
* GH-111485: Mark some instructions as `TIER_ONE_ONLY` (GH-113155)Brandt Bucher2023-12-151-139/+0
|
* GH-112354: Treat _EXIT_TRACE like an unconditional side exit (GH-113104)Mark Shannon2023-12-141-1/+1
|
* Fix whitespace in generated codeMark Shannon2023-12-131-6/+6
|
* GH-111485: Factor out tier 2 code generation from the rest of the ↵Mark Shannon2023-12-121-730/+886
| | | | interpreter code generator (GH-112968)
* GH-111485: Separate out parsing, analysis and code-gen phases of tier 1 code ↵Mark Shannon2023-12-071-1/+1
| | | | generator (GH-112299)
* gh-112287: Speed up Tier 2 (uop) interpreter a little (#112286)Guido van Rossum2023-11-201-22/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes the Tier 2 interpreter a little faster. I calculated by about 3%, though I hesitate to claim an exact number. This starts by doubling the trace size limit (to 512), making it more likely that loops fit in a trace. The rest of the approach is to only load `oparg` and `operand` in cases that use them. The code generator know when these are used. For `oparg`, it will conditionally emit ``` oparg = CURRENT_OPARG(); ``` at the top of the case block. (The `oparg` variable may be referenced multiple times by the instructions code block, so it must be in a variable.) For `operand`, it will use `CURRENT_OPERAND()` directly instead of referencing the `operand` variable, which no longer exists. (There is only one place where this will be used.)
* gh-106529: Make FOR_ITER a viable uop (#112134)Guido van Rossum2023-11-201-0/+25
| | | | | | | | | | This uses the new mechanism whereby certain uops are replaced by others during translation, using the `_PyUop_Replacements` table. We further special-case the `_FOR_ITER_TIER_TWO` uop to update the deoptimization target to point just past the corresponding `END_FOR` opcode. Two tiny code cleanups are also part of this PR.
* GH-111848: Convert remaining jumps to deopts into tier 2 code. (GH-112045)Mark Shannon2023-11-141-8/+23
|
* gh-111789: Simplify bytecodes.c by using PyDict_GetItemRef() (GH-111978)Serhiy Storchaka2023-11-141-47/+17
|
* GH-111520: Add back the operand local (GH-111813)Brandt Bucher2023-11-141-22/+22
|
* GH-109369: Exit tier 2 if executor is invalid (GH-111657)Mark Shannon2023-11-091-0/+6
|
* GH-111848: Tidy up tier 2 handling of FOR_ITER specialization by using ↵Mark Shannon2023-11-081-35/+8
| | | | DEOPT_IF instead of jumps. (GH-111849)
* GH-111485: Allow arbitrary annotations on instructions and micro-ops. ↵Mark Shannon2023-11-071-18/+0
| | | | (GH-111697)
* GH-111485: Make BEFORE_WITH a uop (GH-111812)Brandt Bucher2023-11-071-1/+44
|
* gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (#111655)AN Long2023-11-031-2/+1
|
* GH-111485: Silence warnings in Python/executor_cases.c.h (#111619)Guido van Rossum2023-11-011-0/+2
|
* gh-111520: Integrate the Tier 2 interpreter in the Tier 1 interpreter (#111428)Guido van Rossum2023-11-011-157/+162
| | | | | | | | | | | - There is no longer a separate Python/executor.c file. - Conventions in Python/bytecodes.c are slightly different -- don't use `goto error`, you must use `GOTO_ERROR(error)` (same for others like `unused_local_error`). - The `TIER_ONE` and `TIER_TWO` symbols are only valid in the generated (.c.h) files. - In Lib/test/support/__init__.py, `Py_C_RECURSION_LIMIT` is imported from `_testcapi`. - On Windows, in debug mode, stack allocation grows from 8MiB to 12MiB. - **Beware!** This changes the env vars to enable uops and their debugging to `PYTHON_UOPS` and `PYTHON_LLTRACE`.
* GH-111485: Use micro-ops to split specialization code from base action ↵Mark Shannon2023-11-011-90/+17
| | | | (GH-111561)
* GH-111485: Remove some special cases from the code generator and bytecodes.c ↵Mark Shannon2023-10-311-0/+52
| | | | (GH-111540)
* GH-111485: Increment `next_instr` consistently at the start of the ↵Mark Shannon2023-10-311-37/+28
| | | | instruction. (GH-111486)
* gh-109094: replace frame->prev_instr by frame->instr_ptr (#109095)Irit Katriel2023-10-261-6/+14
|
* GH-109214: Convert _SAVE_CURRENT_IP to _SET_IP in tier 2 trace creation. ↵Mark Shannon2023-10-121-11/+1
| | | | (GH-110755)
* GH-109329: Add tier 2 stats (GH-109913)Michael Droettboom2023-10-041-0/+1
|
* GH-109369: Merge all eval-breaker flags and monitoring version into one ↵Mark Shannon2023-10-041-3/+4
| | | | word. (GH-109846)
* gh-104909: Split more LOAD_ATTR specializations (GH-110317)Guido van Rossum2023-10-041-0/+161
| | | | | | | | | | | | | | | | | | | * Split LOAD_ATTR_MODULE * Split LOAD_ATTR_WITH_HINT * Split _GUARD_TYPE_VERSION out of the latter * Split LOAD_ATTR_CLASS * Split LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES * Fix indent of DEOPT_IF in macros * Split LOAD_ATTR_METHOD_LAZY_DICT * Split LOAD_ATTR_NONDESCRIPTOR_NO_DICT * Fix omission of _CHECK_ATTR_METHOD_LAZY_DICT
* gh-109979: Unify _GUARD_TYPE_VERSION{,_STORE} (#110301)Guido van Rossum2023-10-031-10/+0
| | | | | Now the target for `DEOPT_IF()` is auto-filled, we don't need a separate `_GUARD_TYPE_VERSION_STORE` uop.
* gh-109979: Auto-generate the target for DEOPT_IF() (#110193)Guido van Rossum2023-10-031-40/+33
| | | | | | | | | | | | | | | | In Python/bytecodes.c, you now write ``` DEOPT_IF(condition); ``` The code generator expands this to ``` DEOPT_IF(condition, opcode); ``` where `opcode` is the name of the unspecialized instruction. This works inside macro expansions too. **CAVEAT:** The entire `DEOPT_IF(condition)` statement must be on a single line. If it isn't, the substitution will fail; an error will be printed by the code generator and the C compiler will report some errors.
* gh-110020: Fix unused variable warnings in bytecodes.c (GH-110023)Nikita Sobolev2023-09-281-6/+3
|
* gh-104909: Split some more insts into ops (#109943)Guido van Rossum2023-09-271-0/+139
| | | | | | | | | | | | | | | | | | | | These are the most popular specializations of `LOAD_ATTR` and `STORE_ATTR` that weren't already viable uops: * Split LOAD_ATTR_METHOD_WITH_VALUES * Split LOAD_ATTR_METHOD_NO_DICT * Split LOAD_ATTR_SLOT * Split STORE_ATTR_SLOT * Split STORE_ATTR_INSTANCE_VALUE Also: * Add `-v` flag to code generator which prints a list of non-viable uops (easter-egg: it can print execution counts -- see source) * Double _Py_UOP_MAX_TRACE_LENGTH to 128 I had dropped one of the DEOPT_IF() calls! :-(
* GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300)Brandt Bucher2023-09-131-21/+119
|
* gh-109216: Fix possible memory leak in `BUILD_MAP` (#109257)Nikita Sobolev2023-09-121-3/+0
|
* gh-109214: Rename SAVE_IP to _SET_IP, and similar (#109285)Guido van Rossum2023-09-111-7/+7
| | | | | | | | * Rename SAVE_IP to _SET_IP * Rename EXIT_TRACE to _EXIT_TRACE * Rename SAVE_CURRENT_IP to _SAVE_CURRENT_IP * Rename INSERT to _INSERT (This is for Ken Jin's abstract interpreter) * Rename IS_NONE to _IS_NONE * Rename JUMP_TO_TOP to _JUMP_TO_TOP
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function ↵Jelle Zijlstra2023-09-091-3/+39
| | | | (#109123)
* GH-108614: Unbreak emscripten build (GH-109132)Mark Shannon2023-09-081-2/+2
|
* GH-108614: Add `RESUME_CHECK` instruction (GH-108630)Mark Shannon2023-09-071-16/+9
|
* GH-108614: Remove `TIER_ONE` and `TIER_TWO` from `_PUSH_FRAME` (GH-108725)Mark Shannon2023-09-041-9/+11
|
* GH-108614: Remove non-debug uses of `#if TIER_ONE` and `#if TIER_TWO` from ↵Mark Shannon2023-08-311-11/+12
| | | | `_POP_FRAME` op. (GH-108685)
* GH-106581: Fix instrumentation in tier 2 (GH-108493)Brandt Bucher2023-08-251-4/+6
|
* gh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)Guido van Rossum2023-08-251-0/+26
| | | Instead of using `GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS)` we just add the macro elements of the latter to the macro for the former. This requires lengthening the uops array in struct opcode_macro_expansion. (It also required changes to stacking.py that were merged already.)
* gh-106581: Project through calls (#108067)Guido van Rossum2023-08-171-1/+45
| | | | This finishes the work begun in gh-107760. When, while projecting a superblock, we encounter a call to a short, simple function, the superblock will now enter the function using `_PUSH_FRAME`, continue through it, and leave it using `_POP_FRAME`, and then continue through the original code. Multiple frame pushes and pops are even possible. It is also possible to stop appending to the superblock in the middle of a called function, when running out of space or encountering an unsupported bytecode.
* GH-108035: Remove the `_PyCFrame` struct as it is no longer needed for ↵Mark Shannon2023-08-171-2/+1
| | | | performance. (GH-108036)
* gh-106581: Split `CALL_PY_EXACT_ARGS` into uops (#107760)Guido van Rossum2023-08-161-9/+89
| | | | | | | | | | | | * Split `CALL_PY_EXACT_ARGS` into uops This is only the first step for doing `CALL` in Tier 2. The next step involves tracing into the called code object and back. After that we'll have to do the remaining `CALL` specialization. Finally we'll have to deal with `KW_NAMES`. Note: this moves setting `frame->return_offset` directly in front of `DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
* gh-107557: Setup abstract interpretation (#107847)Ken Jin2023-08-151-0/+9
| | | | Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
* gh-106797: Remove warning logs from Python/generated_cases.c.h and ↵Dong-hee Na2023-08-121-1/+1
| | | | | executor_cases.c.h (gh-107889) gh-106797: Remove warning logs from Python/generated_cases.c.h
* GH-106485: Dematerialize instance dictionaries when possible (GH-106539)Brandt Bucher2023-08-091-2/+4
|
* GH-105848: Simplify the arrangement of CALL's stack (GH-107788)Brandt Bucher2023-08-091-120/+111
|
* GH-107596: Specialize str[int] (GH-107597)Brandt Bucher2023-08-081-0/+23
|
* gh-106812: Refactor cases_generator to allow uops with array stack effects ↵Guido van Rossum2023-08-041-207/+404
| | | | | (#107564) Introducing a new file, stacking.py, that takes over several responsibilities related to symbolic evaluation of push/pop operations, with more generality.
* Use tstate->interp to get the interpreter state in bytecodes.c (GH-107506)Brandt Bucher2023-07-311-2/+2
|