summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
Commit message (Collapse)AuthorAgeFilesLines
* GH-123516: Improve JIT memory consumption by invalidating cold executors ↵Savannah Ostrowski2024-09-271-0/+1
| | | | | (GH-124443) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-253-9/+22
| | | | of a boolean expression (#124394)
* gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)Sam Gross2024-09-242-4/+17
| | | | | | Use a `_PyStackRef` and defer the reference to `f_funcobj` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure ↵Mark Shannon2024-09-122-5/+15
| | | | that it is kept in memory for calls (GH-124003)
* GH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)Mark Shannon2024-08-144-35/+1
| | | | | * Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis * Eliminate CHECK_EVAL_BREAKER macro
* GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942)Mark Shannon2024-08-132-0/+2
|
* gh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)Sam Gross2024-08-121-1/+1
| | | | | | | This replaces `_PyList_FromArraySteal` with `_PyList_FromStackRefSteal`. It's functionally equivalent, but takes a `_PyStackRef` array instead of an array of `PyObject` pointers. Co-authored-by: Ken Jin <kenjin@python.org>
* GH-120024: Tidy up case generator code a bit. (GH-122780)Mark Shannon2024-08-0810-100/+175
|
* gh-118926: Spill deferred references to stack in cases generator (#122748)Sam Gross2024-08-076-25/+132
| | | | | | | This automatically spills the results from `_PyStackRef_FromPyObjectNew` to the in-memory stack so that the deferred references are visible to the GC before we make any possibly escaping call. Co-authored-by: Ken Jin <kenjin@python.org>
* GH-120024: Refactor code generators to uses classes for emitting code. ↵Mark Shannon2024-08-064-274/+272
| | | | (GH-122730)
* GH-122155: Track local variables between pops and pushes in cases generator ↵Mark Shannon2024-08-017-102/+213
| | | | (GH-122286)
* GH-121131: Clean up and fix some instrumented instructions. (GH-121132)Mark Shannon2024-07-263-8/+5
| | | | * Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
* GH-122155: Fix cases generator to correctly compute 'peek' offset for error ↵Mark Shannon2024-07-233-6/+17
| | | | handling (GH-122158)
* GH-121784: Generate an error during code gen if a variable is marked ↵Mark Shannon2024-07-185-57/+112
| | | | | | | | | | | | `unused`, but is used and thus cached in a prior uop. (#121788) * Reject uop definitions that declare values as 'unused' that are already cached by prior uops * Track which variables are defined and only load from memory when needed * Support explicit `flush` in macro definitions. * Make sure stack is flushed in where needed.
* GH-118926: Better distinguish between pointer and arrays in interpreter ↵Mark Shannon2024-07-096-18/+30
| | | | generator (GH-121496)
* gh-117139: Add _PyTuple_FromStackRefSteal and use it (#121244)Sam Gross2024-07-021-0/+1
| | | Avoids the extra conversion from stack refs to PyObjects.
* gh-117139: Convert the evaluation stack to stack refs (#118450)Ken Jin2024-06-267-23/+49
| | | | | | | | | | | | | | | | | This PR sets up tagged pointers for CPython. The general idea is to create a separate struct _PyStackRef for everything on the evaluation stack to store the bits. This forces the C compiler to warn us if we try to cast things or pull things out of the struct directly. Only for free threading: We tag the low bit if something is deferred - that means we skip incref and decref operations on it. This behavior may change in the future if Mark's plans to defer all objects in the interpreter loop pans out. This implies a strict stack reference discipline is required. ALL incref and decref operations on stackrefs must use the stackref variants. It is unsafe to untag something then do normal incref/decref ops on it. The new incref and decref variants are called dup and close. They mimic a "handle" API operating on these stackrefs. Please read Include/internal/pycore_stackref.h for more information! --------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
* GH-120982: Add stack check assertions to generated interpreter code (GH-120992)Mark Shannon2024-06-251-0/+1
|
* gh-120417: Remove unused imports in cases_generator (#120622)Victor Stinner2024-06-1711-30/+7
|
* gh-119689: generate stack effect metadata for pseudo instructions (#119691)Irit Katriel2024-05-295-20/+47
|
* GH-118910: Less boilerplate in the tier 2 optimizer (#118913)Mark Shannon2024-05-101-3/+0
|
* gh-118335: Configure Tier 2 interpreter at build time (#118339)Guido van Rossum2024-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | The code for Tier 2 is now only compiled when configured with `--enable-experimental-jit[=yes|interpreter]`. We drop support for `PYTHON_UOPS` and -`Xuops`, but you can disable the interpreter or JIT at runtime by setting `PYTHON_JIT=0`. You can also build it without enabling it by default using `--enable-experimental-jit=yes-off`; enable with `PYTHON_JIT=1`. On Windows, the `build.bat` script supports `--experimental-jit`, `--experimental-jit-off`, `--experimental-interpreter`. In the C code, `_Py_JIT` is defined as before when the JIT is enabled; the new variable `_Py_TIER2` is defined when the JIT *or* the interpreter is enabled. It is actually a bitmask: 1: JIT; 2: default-off; 4: interpreter.
* gh-112075: Make instance attributes stored in inline "dict" thread safe ↵Dino Viehland2024-04-221-0/+1
| | | | | (#114742) Make instance attributes stored in inline "dict" thread safe on free-threaded builds
* GH-115419: Improve list of escaping functions (GH-118054)Mark Shannon2024-04-191-0/+10
|
* Cases generator: Remove type_prop and passthrough (#117614)Ken Jin2024-04-072-11/+0
|
* GH-117457: Correct pystats uop "miss" counts (GH-117477)Michael Droettboom2024-04-041-2/+8
|
* GH-115776: Embed the values array into the object, for "normal" Python ↵Mark Shannon2024-04-021-4/+3
| | | | objects. (GH-116115)
* gh-117323: Make `cell` thread-safe in free-threaded builds (#117330)Sam Gross2024-03-291-2/+3
| | | Use critical sections to lock around accesses to cell contents. The critical sections are no-ops in the default (with GIL) build.
* GH-116422: Tier2 hot/cold splitting (GH-116813)Mark Shannon2024-03-265-37/+102
| | | | | Splits the "cold" path, deopts and exits, from the "hot" path, reducing the size of most jitted instructions, at the cost of slower exits.
* gh-115419: Change default sym to not_null (GH-116562)Ken Jin2024-03-131-2/+2
|
* GH-116596: Better determination of escaping uops. (GH-116597)Mark Shannon2024-03-111-0/+16
|
* gh-116000: Make optimizer_generator.py work without any arguments (#116470)Kirill Podoprigora2024-03-071-5/+8
|
* gh-115999: Disable the specializing adaptive interpreter in free-threaded ↵Brett Simmers2024-03-011-0/+5
| | | | | builds (#116013) For now, disable all specialization when the GIL might be disabled.
* gh-116088: Insert bottom checks after all sym_set_...() calls (#116089)Guido van Rossum2024-02-291-4/+0
| | | | | | | | | This changes the `sym_set_...()` functions to return a `bool` which is `false` when the symbol is `bottom` after the operation. All calls to such functions now check this result and go to `hit_bottom`, a special error label that prints a different message and then reports that it wasn't able to optimize the trace. No executor will be produced in this case.
* gh-115816: Generate calls to sym_new_const() etc. without _Py_uop prefix ↵Guido van Rossum2024-02-291-4/+4
| | | | | | | | | (#116077) This was left behind by GH-115987. Basically a lot of diffs like this: ``` - res = _Py_uop_sym_new_unknown(ctx); + res = sym_new_unknown(ctx); ```
* GH-115816: Assorted naming and formatting changes to improve ↵Mark Shannon2024-02-271-3/+3
| | | | | | | maintainability. (GH-115987) * Rename _Py_UOpsAbstractInterpContext to _Py_UOpsContext and _Py_UOpsSymType to _Py_UopsSymbol. * #define shortened form of _Py_uop_... names for improved readability.
* GH-115816: Make tier2 optimizer symbols testable, and add a few tests. ↵Mark Shannon2024-02-271-3/+3
| | | | (GH-115953)
* Rename tier 2 redundancy eliminator to optimizer (#115888)Guido van Rossum2024-02-262-8/+8
| | | | The original name is just too much of a mouthful.
* gh-115778: Add `tierN` annotation for instruction definitions (#115815)Kirill Podoprigora2024-02-238-10/+20
| | | | | This replaces the old `TIER_{ONE,TWO}_ONLY` macros. Note that `specialized` implies `tier1`. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-115457: Support splitting and replication of micro ops. (GH-115558)Mark Shannon2024-02-2010-36/+174
|
* GH-112354: Initial implementation of warm up on exits and trace-stitching ↵Mark Shannon2024-02-204-5/+37
| | | | (GH-114142)
* gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)Ken Jin2024-02-136-52/+248
| | | | | | | --------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com> Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
* ``Tools/cases_generator``: Fix typos and incorrect comments. (#114892)Kirill Podoprigora2024-02-034-6/+6
|
* Update outdated info in ``Tools/cases_generator/README.md`` (#114844)Kirill Podoprigora2024-02-011-7/+21
|
* GH-112354: `_GUARD_IS_TRUE_POP` side-exits to target the next instruction, ↵Mark Shannon2024-01-154-11/+12
| | | | not themselves. (GH-114078)
* gh-113710: Add types to the interpreter DSL (#113711)Ken Jin2024-01-127-30/+131
| | | | Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* GH-111485: Delete the old generator code. (GH-113321)Mark Shannon2023-12-219-2625/+102
|
* GH-111485: Fix DEFAULT_OUTPUT in opcode_metadata_generator.py (#113324)Guido van Rossum2023-12-201-1/+1
|
* GH-111485: Generate `TARGET` table for computed goto dispatch. (GH-113319)Mark Shannon2023-12-202-1/+54
|
* GH-111485: Generate instruction and uop metadata (GH-113287)Mark Shannon2023-12-2012-174/+849
|