summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_cases.c.h
Commit message (Collapse)AuthorAgeFilesLines
* GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure ↵Mark Shannon2024-09-121-6/+10
| | | | that it is kept in memory for calls (GH-124003)
* GH-115776: Allow any fixed sized object to have inline values (GH-123192)Mark Shannon2024-08-211-2/+2
|
* GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)Mark Shannon2024-08-201-1/+40
| | | | | * Convert CALL_ALLOC_AND_ENTER_INIT to micro-ops such that tier 2 supports it * Allow inexact arguments for CALL_ALLOC_AND_ENTER_INIT.
* GH-118093: Specialize `CALL_KW` (GH-123006)Mark Shannon2024-08-161-0/+56
|
* GH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)Mark Shannon2024-08-141-8/+14
| | | | | * Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis * Eliminate CHECK_EVAL_BREAKER macro
* GH-122869: Add missing tier two optimizer cases (GH-122936)Mark Shannon2024-08-121-4/+17
|
* GH-118095: Add tier two support for BINARY_SUBSCR_GETITEM (GH-120793)Mark Shannon2024-08-011-1/+12
|
* GH-122155: Track local variables between pops and pushes in cases generator ↵Mark Shannon2024-08-011-1/+2
| | | | (GH-122286)
* Manually override bytecode definition in optimizer, to avoid build error ↵Mark Shannon2024-07-261-4/+9
| | | | (GH-122316)
* GH-122294: Burn in the addresses of side exits (GH-122295)Brandt Bucher2024-07-261-0/+2
|
* GH-122029: Break INSTRUMENTED_CALL into micro-ops, so that its behavior is ↵Mark Shannon2024-07-261-2/+16
| | | | consistent with CALL (GH-122177)
* GH-121131: Clean up and fix some instrumented instructions. (GH-121132)Mark Shannon2024-07-261-6/+2
| | | | * Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
* GH-118093: Add tier two support for BINARY_OP_INPLACE_ADD_UNICODE (GH-122253)Brandt Bucher2024-07-251-0/+6
|
* GH-118093: Add tier two support for LOAD_ATTR_PROPERTY (GH-122283)Brandt Bucher2024-07-251-1/+6
|
* GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)Mark Shannon2024-07-251-9/+0
|
* GH-118093: Add tier two support to several instructions (GH-121884)Brandt Bucher2024-07-181-3/+45
|
* GH-116017: Get rid of _COLD_EXITs (GH-120960)Brandt Bucher2024-07-011-4/+0
|
* gh-117139: Convert the evaluation stack to stack refs (#118450)Ken Jin2024-06-261-9/+9
| | | | | | | | | | | | | | | | | 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/+128
|
* gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in ↵Nadeshiko Manju2024-06-191-1/+0
| | | | | | gh-118322 (GH-120712) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
* GH-120507: Lower the `BEFORE_WITH` and `BEFORE_ASYNC_WITH` instructions. ↵Mark Shannon2024-06-181-3/+13
| | | | | | | | | (#120640) * Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions. * Add LOAD_SPECIAL instruction * Reimplement `with` and `async with` statements using LOAD_SPECIAL
* GH-120619: Clean up `RETURN_VALUE` instruction (GH-120624)Mark Shannon2024-06-171-1/+1
| | | | | * Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
* gh-119258: Eliminate Type Guards in Tier 2 Optimizer with Watcher (GH-119365)Saul Shanabrook2024-06-081-8/+25
| | | | | | | Co-authored-by: parmeggiani <parmeggiani@spaziodati.eu> Co-authored-by: dpdani <git@danieleparmeggiani.me> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com> Co-authored-by: Ken Jin <kenjin@python.org>
* gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822)Jelle Zijlstra2024-05-311-6/+1
| | | | | | | | | Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS The implementation basically copies LOAD_GLOBAL. Possibly it could be deduplicated, but that seems like it may get hairy since the two operations have different operands. This is important to fix in 3.14 for PEP 649, but it's a bug in earlier versions too, and we should backport to 3.13 and 3.12 if possible.
* GH-119258: Handle STORE_ATTR_WITH_HINT in tier two (GH-119481)Brandt Bucher2024-05-281-1/+4
|
* GH-119476: Split _CHECK_FUNCTION_VERSION out of _CHECK_FUNCTION_EXACT_ARGS ↵Brandt Bucher2024-05-281-2/+0
| | | | (GH-119510)
* gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)Jelle Zijlstra2024-05-221-1/+1
| | | | | | | | | | The PEP 649 implementation will require a way to load NotImplementedError from the bytecode. @markshannon suggested implementing this by converting LOAD_ASSERTION_ERROR into a more general mechanism for loading constants. This PR adds this new opcode. I will work on the rest of the implementation of the PEP separately. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* GH-118910: Less boilerplate in the tier 2 optimizer (#118913)Mark Shannon2024-05-101-222/+87
|
* GH-118095: Use broader specializations of CALL in tier 1, for better tier 2 ↵Mark Shannon2024-05-041-3/+53
| | | | | | | | | | support of calls. (GH-118322) * Add CALL_PY_GENERAL, CALL_BOUND_METHOD_GENERAL and call CALL_NON_PY_GENERAL specializations. * Remove CALL_PY_WITH_DEFAULTS specialization * Use CALL_NON_PY_GENERAL in more cases when otherwise failing to specialize
* GH-113464: Remove the extra jump via `_SIDE_EXIT` in `_EXIT_TRACE` (GH-118545)Mark Shannon2024-05-041-4/+0
|
* GH-117442: Check eval-breaker at start (rather than end) of tier 2 loops ↵Mark Shannon2024-05-021-4/+0
| | | | (GH-118482)
* GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)Mark Shannon2024-04-301-5/+9
|
* GH-118095: Allow a variant of RESUME_CHECK in tier 2 (GH-118286)Mark Shannon2024-04-291-0/+8
|
* GH-118095: Add dynamic exit support and FOR_ITER_GEN support to tier 2 ↵Mark Shannon2024-04-261-1/+12
| | | | (GH-118279)
* GH-118095: Handle `RETURN_GENERATOR` in tier 2 (GH-118180)Mark Shannon2024-04-251-0/+23
|
* GH-115480: Reduce guard strength for binary ops when type of one operand is ↵Mark Shannon2024-04-221-8/+60
| | | | known already (GH-118050)
* GH-115419: Tidy up tier 2 optimizer. Merge peephole pass into main pass ↵Mark Shannon2024-04-181-3/+52
| | | | (GH-117997)
* gh-116168: Remove extra `_CHECK_STACK_SPACE` uops (#117242)Peter Lazorchak2024-04-031-0/+4
| | | This merges all `_CHECK_STACK_SPACE` uops in a trace into a single `_CHECK_STACK_SPACE_OPERAND` uop that checks whether there is enough stack space for all calls included in the entire trace.
* GH-115776: Embed the values array into the object, for "normal" Python ↵Mark Shannon2024-04-021-1/+1
| | | | objects. (GH-116115)
* GH-116422: Tier2 hot/cold splitting (GH-116813)Mark Shannon2024-03-261-40/+17
| | | | | 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-117176: Fix compiler warning in Python/optimizer_bytecodes.c (GH-117199)Kirill Podoprigora2024-03-241-1/+1
|
* gh-117045: Add code object to function version cache (#117028)Guido van Rossum2024-03-211-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the function version cache: - In addition to the function object, also store the code object, and allow the latter to be retrieved even if the function has been evicted. - Stop assigning new function versions after a critical attribute (e.g. `__code__`) has been modified; the version is permanently reset to zero in this case. - Changes to `__annotations__` are no longer considered critical. (This fixes gh-109998.) Changes to the Tier 2 optimization machinery: - If we cannot map a function version to a function, but it is still mapped to a code object, we continue projecting the trace. The operand of the `_PUSH_FRAME` and `_POP_FRAME` opcodes can be either NULL, a function object, or a code object with the lowest bit set. This allows us to trace through code that calls an ephemeral function, i.e., a function that may not be alive when we are constructing the executor, e.g. a generator expression or certain nested functions. We will lose globals removal inside such functions, but we can still do other peephole operations (and even possibly [call inlining](https://github.com/python/cpython/pull/116290), if we decide to do it), which only need the code object. As before, if we cannot retrieve the code object from the cache, we stop projecting.
* GH-117066: Tier 2 optimizer: Don't throw away good traces if we can't ↵Mark Shannon2024-03-201-1/+3
| | | | optimize them perfectly. (GH-117067)
* Cleanup tier2 debug output (#116920)Guido van Rossum2024-03-181-0/+1
| | | Various tweaks, including a slight refactor of the special cases for `_PUSH_FRAME`/`_POP_FRAME` to show the actual operand emitted.
* GH-116422: Factor out eval breaker checks at end of calls into its own ↵Mark Shannon2024-03-141-0/+4
| | | | micro-op. (GH-116817)
* gh-115419: Change default sym to not_null (GH-116562)Ken Jin2024-03-131-89/+92
|
* GH-116468: Use constants instead of `oparg` in stack effects when `oparg` is ↵Mark Shannon2024-03-111-13/+15
| | | | known to be a constant. (GH-116469)
* gh-116381: Remove bad specializations, add fail stats (GH-116464)Ken Jin2024-03-071-27/+0
| | | * Remove bad specializations, add fail stats
* gh-116420: Fix unused var compilation warnings (GH-116466)Ken Jin2024-03-071-0/+12
| | | Fix unused var compilation warnings
* gh-116381: Specialize CONTAINS_OP (GH-116385)Ken Jin2024-03-061-0/+45
| | | | | | | | | | | * Specialize CONTAINS_OP * 📜🤖 Added by blurb_it. * Add PyAPI_FUNC for JIT --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>