aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/ceval_macros.h
Commit message (Collapse)AuthorAge
* GH-133231: Changes to executor management to support proposed `sys._jit` ↵Mark Shannon2025-05-04
| | | | | | | | module (GH-133287) * Track the current executor, not the previous one, on the thread-state. * Batch executors for deallocation to avoid having to constantly incref executors; this is an ad-hoc form of deferred reference counting.
* gh-132758: Fix tail call and pystats builds (GH-132759)Ken Jin2025-04-23
|
* GH-131498: Cases generator: manage stacks automatically (GH-132074)Mark Shannon2025-04-04
|
* GH-127705: Use `_PyStackRef`s in the default build. (GH-127875)Mark Shannon2025-03-10
|
* gh-129989: Properly disable tailcall interp in configure (GH-129991)Ken Jin2025-02-16
| | | Co-authored-by: Zanie Blue <contact@zanie.dev>
* gh-129819: Allow tier2/JIT and tailcall (GH-129820)Ken Jin2025-02-13
|
* GH-128682: Account for escapes in `DECREF_INPUTS` (GH-129953)Mark Shannon2025-02-12
| | | | | | | | * Handle escapes in DECREF_INPUTS * Mark a few more functions as escaping * Replace DECREF_INPUTS with PyStackRef_CLOSE where possible
* GH-129709: Clean up tier two (GH-129710)Brandt Bucher2025-02-07
|
* GH-129763: Remove the LLTRACE macro (GH-129764)Brandt Bucher2025-02-07
|
* gh-128563: A new tail-calling interpreter (GH-128718)Ken Jin2025-02-06
| | | | | Co-authored-by: Garrett Gu <garrettgu777@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* GH-128682: Mark two more macros as escaping. (GH-129645)Mark Shannon2025-02-04
| | | Expand out SETLOCAL so that code generator can see the decref. Mark Py_CLEAR as escaping
* GH-128563: Move some labels, to simplify implementing tailcalling ↵Mark Shannon2025-01-31
| | | | interpreter. (GH-129525)
* gh-128563: Move GO_TO_INSTRUCTION and PREDICT to cases generator (GH-129115)Ken Jin2025-01-22
|
* gh-128563: Move lltrace into the frame struct (GH-129113)Ken Jin2025-01-21
|
* GH-128563: Add new frame owner type for interpreter entry frames (GH-129078)Mark Shannon2025-01-21
| | | Add new frame owner type for interpreter entry frames
* GH-128375: Better instrument for `FOR_ITER` (GH-128445)Mark Shannon2025-01-06
|
* GH-127705: Add debug mode for `_PyStackRef`s inspired by HPy debug mode ↵Mark Shannon2024-12-20
| | | | (GH-128121)
* gh-128033: change `PyMutex_LockFast` to take `PyMutex` as argument (#128054)Kumar Aditya2024-12-18
| | | Change `PyMutex_LockFast` to take `PyMutex` as argument.
* gh-115999: Add free-threaded specialization for `STORE_SUBSCR` (#127169)Sam Gross2024-11-26
| | | | | | | | | The specialization only depends on the type, so no special thread-safety considerations there. STORE_SUBSCR_LIST_INT needs to lock the list before modifying it. `_PyDict_SetItem_Take2` already internally locks the dictionary using a critical section.
* gh-120619: Strength reduce function guards, support 2-operand uop forms ↵Ken Jin2024-11-09
| | | | | (GH-124846) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-115999: Implement thread-local bytecode and enable specialization for ↵mpage2024-11-04
| | | | | | | | | `BINARY_OP` (#123926) Each thread specializes a thread-local copy of the bytecode, created on the first RESUME, in free-threaded builds. All copies of the bytecode for a code object are stored in the co_tlbc array on the code object. Threads reserve a globally unique index identifying its copy of the bytecode in all co_tlbc arrays at thread creation and release the index at thread destruction. The first entry in every co_tlbc array always points to the "main" copy of the bytecode that is stored at the end of the code object. This ensures that no bytecode is copied for programs that do not use threads. Thread-local bytecode can be disabled at runtime by providing either -X tlbc=0 or PYTHON_TLBC=0. Disabling thread-local bytecode also disables specialization. Concurrent modifications to the bytecode made by the specializing interpreter and instrumentation use atomics, with specialization taking care not to overwrite an instruction that was instrumented concurrently.
* GH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes ↵Mark Shannon2024-10-14
| | | | PyStackRefs. (GH-125439)
* GH-119866: Spill the stack around escaping calls. (GH-124392)Mark Shannon2024-10-07
| | | | | | | * Spill the evaluation around escaping calls in the generated interpreter and JIT. * The code generator tracks live, cached values so they can be saved to memory when needed. * Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
* GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)Mark Shannon2024-08-20
| | | | | * 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-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)Mark Shannon2024-08-14
| | | | | * Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis * Eliminate CHECK_EVAL_BREAKER macro
* gh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861)Sam Gross2024-08-11
|
* gh-117657: Avoid race in `PAUSE_ADAPTIVE_COUNTER` in free-threaded build ↵Sam Gross2024-07-30
| | | | | | | (#122190) The adaptive counter doesn't do anything currently in the free-threaded build and TSan reports a data race due to concurrent modifications to the counter.
* GH-121131: Clean up and fix some instrumented instructions. (GH-121132)Mark Shannon2024-07-26
| | | | * Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
* GH-116017: Get rid of _COLD_EXITs (GH-120960)Brandt Bucher2024-07-01
|
* gh-117139: Convert the evaluation stack to stack refs (#118450)Ken Jin2024-06-27
| | | | | | | | | | | | | | | | | 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-25
|
* gh-107674: Improve performance of `sys.settrace` (GH-117133)Tian Gao2024-05-03
| | | | | | * Check tracing in RESUME_CHECK * Only change to RESUME_CHECK if not tracing
* gh-117657: Fix small issues with instrumentation and TSAN (#118064)Dino Viehland2024-04-30
| | | Small TSAN fixups for instrumentation
* GH-118095: Add dynamic exit support and FOR_ITER_GEN support to tier 2 ↵Mark Shannon2024-04-26
| | | | (GH-118279)
* GH-118095: Handle `RETURN_GENERATOR` in tier 2 (GH-118180)Mark Shannon2024-04-25
|
* gh-116968: Reimplement Tier 2 counters (#117144)Guido van Rossum2024-04-04
| | | | | | | | | | | | Introduce a unified 16-bit backoff counter type (``_Py_BackoffCounter``), shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The API used for adaptive specialization counters is changed but the behavior is (supposed to be) identical. The behavior of the Tier 2 counters is changed: - There are no longer dynamic thresholds (we never varied these). - All counters now use the same exponential backoff. - The counter for ``JUMP_BACKWARD`` starts counting down from 16. - The ``temperature`` in side exits starts counting down from 64.
* GH-117121: Add pystats to JIT builds (GH-117346)Michael Droettboom2024-03-28
|
* GH-116422: Tier2 hot/cold splitting (GH-116813)Mark Shannon2024-03-26
| | | | | 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-116098: Revert "gh-107674: Improve performance of `sys.settrace` ↵Tian Gao2024-03-01
| | | | | | | (GH-114986)" (GH-116178) Revert "gh-107674: Improve performance of `sys.settrace` (GH-114986)" This reverts commit 0a61e237009bf6b833e13ac635299ee063377699.
* gh-115999: Disable the specializing adaptive interpreter in free-threaded ↵Brett Simmers2024-02-29
| | | | | builds (#116013) For now, disable all specialization when the GIL might be disabled.
* GH-115802: JIT "small" code for Windows (GH-115964)Brandt Bucher2024-02-29
|
* gh-107674: Improve performance of `sys.settrace` (GH-114986)Tian Gao2024-02-28
|
* gh-115778: Add `tierN` annotation for instruction definitions (#115815)Kirill Podoprigora2024-02-23
| | | | | This replaces the old `TIER_{ONE,TWO}_ONLY` macros. Note that `specialized` implies `tier1`. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-112175: Add `eval_breaker` to `PyThreadState` (#115194)Brett Simmers2024-02-20
| | | | | | | | | | | This change adds an `eval_breaker` field to `PyThreadState`. The primary motivation is for performance in free-threaded builds: with thread-local eval breakers, we can stop a specific thread (e.g., for an async exception) without interrupting other threads. The source of truth for the global instrumentation version is stored in the `instrumentation_version` field in PyInterpreterState. Threads usually read the version from their local `eval_breaker`, where it continues to be colocated with the eval breaker bits.
* GH-112354: Initial implementation of warm up on exits and trace-stitching ↵Mark Shannon2024-02-20
| | | | (GH-114142)
* gh-115103: Implement delayed memory reclamation (QSBR) (#115180)Sam Gross2024-02-16
| | | | | | This adds a safe memory reclamation scheme based on FreeBSD's "GUS" and quiescent state based reclamation (QSBR). The API provides a mechanism for callers to detect when it is safe to free memory that may be concurrently accessed by readers.
* Delete unused macro (GH-114238)Mark Shannon2024-01-18
|
* GH-112354: Treat _EXIT_TRACE like an unconditional side exit (GH-113104)Mark Shannon2023-12-14
|
* gh-113010: Don't decrement deferred in pystats (#113032)Michael Droettboom2023-12-12
| | | This fixes a recently introduced bug where the deferred count is being unnecessarily decremented to counteract an increment elsewhere that is no longer happening. This caused the values to flip around to "very large" 64-bit numbers.
* A smattering of cleanups in uop debug output and lltrace (#112980)Guido van Rossum2023-12-11
| | | | | | * Include destination T1 opcode in Error debug message * Include destination T1 opcode in DEOPT debug message * Remove obsolete comment from remove_unneeded_uops * Change lltrace_instruction() to print caller's opcode/oparg