summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)Donghee Na2024-02-014-4/+7
|
* gh-112529: Remove PyGC_Head from object pre-header in free-threaded build ↵Sam Gross2024-02-012-6/+25
| | | | | | | | | | | | | | | | | (#114564) * gh-112529: Remove PyGC_Head from object pre-header in free-threaded build This avoids allocating space for PyGC_Head in the free-threaded build. The GC implementation for free-threaded CPython does not use the PyGC_Head structure. * The trashcan mechanism uses the `ob_tid` field instead of `_gc_prev` in the free-threaded build. * The GDB libpython.py file now determines the offset of the managed dict field based on whether the running process is a free-threaded build. Those are identified by the `ob_ref_local` field in PyObject. * Fixes `_PySys_GetSizeOf()` which incorrectly incorrectly included the size of `PyGC_Head` in the size of static `PyTypeObject`.
* GH-114806. Don't specialize calls to classes with metaclasses. (GH-114870)Mark Shannon2024-02-011-0/+5
|
* Remove unused Py_XDECREF from _PyFrame_ClearExceptCode (GH-106158)Anders Kaseorg2024-02-011-1/+0
| | | | | | frame->frame_obj was set to NULL a few lines earlier. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* gh-114746: Avoid quadratic behavior in free-threaded GC (GH-114817)Sam Gross2024-02-011-73/+29
| | | | | | | | | | | | | | The free-threaded build's GC implementation is non-generational, but was scheduled as if it were collecting a young generation leading to quadratic behavior. This increases the minimum threshold and scales it to the number of live objects as we do for the old generation in the default build. Note that the scheduling is still not thread-safe without the GIL. Those changes will come in later PRs. A few tests, like "test_sneaky_frame_object" rely on prompt scheduling of the GC. For now, to keep that test passing, we disable the scaled threshold after calls like `gc.set_threshold(1, 0, 0)`.
* gh-112606: Use pthread_cond_timedwait_relative_np() in parking_lot.c when ↵Matt Prodani2024-01-301-1/+5
| | | | | | | available (#112616) Add a configure define for HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP and replaces pthread_cond_timedwait() with pthread_cond_timedwait_relative_np() for relative time when supported in semaphore waiting logic.
* gh-103323: Remove current_fast_get() unused parameter (#114593)Victor Stinner2024-01-301-26/+24
| | | | The current_fast_get() static inline function doesn't use its 'runtime' parameter, so just remove it.
* gh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)Erlend E. Aasland2024-01-292-16/+15
|
* gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686)Nikita Sobolev2024-01-291-1/+1
|
* GH-113464: Add a JIT backend for tier 2 (GH-113465)Brandt Bucher2024-01-294-1/+407
| | | | | | | Add an option (--enable-experimental-jit for configure-based builds or --experimental-jit for PCbuild-based ones) to build an *experimental* just-in-time compiler, based on copy-and-patch (https://fredrikbk.com/publications/copy-and-patch.pdf). See Tools/jit/README.md for more information on how to install the required build-time tooling.
* gh-113055: Use pointer for interp->obmalloc state (gh-113412)Neil Schemenauer2024-01-272-8/+22
| | | | | | | | | For interpreters that share state with the main interpreter, this points to the same static memory structure. For interpreters with their own obmalloc state, it is heap allocated. Add free_obmalloc_arenas() which will free the obmalloc arenas and radix tree structures for interpreters with their own obmalloc state. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)Donghee Na2024-01-262-4/+4
|
* gh-107901: compiler replaces POP_BLOCK instruction by NOPs before ↵Irit Katriel2024-01-251-1/+2
| | | | optimisations (#114530)
* gh-112529: Implement GC for free-threaded builds (#114262)Sam Gross2024-01-254-6/+1794
| | | | | | | * gh-112529: Implement GC for free-threaded builds This implements a mark and sweep GC for the free-threaded builds of CPython. The implementation relies on mimalloc to find GC tracked objects (i.e., "containers").
* gh-114265: remove i_loc_propagated, jump threading does not consider line ↵Irit Katriel2024-01-251-41/+47
| | | | numbers anymore (#114535)
* gh-114312: Collect stats for unlikely events (GH-114493)Michael Droettboom2024-01-253-0/+30
|
* Update outdated comment in ``Python/bytecodes.c`` (#114522)Kirill Podoprigora2024-01-241-2/+2
|
* GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)Mark Shannon2024-01-244-37/+39
| | | | * Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
* GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)Mark Shannon2024-01-245-3/+60
| | | | | * Convert _LOAD_CONST to inline versions * Remove PEP 523 checks
* gh-111964: Implement stop-the-world pauses (gh-112471)Sam Gross2024-01-232-14/+264
| | | | | | | | | | | | | | | | | The `--disable-gil` builds occasionally need to pause all but one thread. Some examples include: * Cyclic garbage collection, where this is often called a "stop the world event" * Before calling `fork()`, to ensure a consistent state for internal data structures * During interpreter shutdown, to ensure that daemon threads aren't accessing Python objects This adds the following functions to implement global and per-interpreter pauses: * `_PyEval_StopTheWorldAll()` and `_PyEval_StartTheWorldAll()` (for the global runtime) * `_PyEval_StopTheWorld()` and `_PyEval_StartTheWorld()` (per-interpreter) (The function names may change.) These functions are no-ops outside of the `--disable-gil` build.
* gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG ↵Irit Katriel2024-01-221-140/+179
| | | | before optimize_basic_block. (#114408)
* gh-113102: Fix typo in INSTRUMENTED_RESUME (GH-114349)Guido van Rossum2024-01-222-2/+2
|
* gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect ↵Nikita Sobolev2024-01-211-1/+1
| | | | implementation (#114385)
* gh-112529: Use GC heaps for GC allocations in free-threaded builds (gh-114157)Sam Gross2024-01-201-6/+7
| | | | | | | | | | * gh-112529: Use GC heaps for GC allocations in free-threaded builds The free-threaded build's garbage collector implementation will need to find GC objects by traversing mimalloc heaps. This hooks up the allocation calls with the correct heaps by using a thread-local "current_obj_heap" variable. * Refactor out setting heap based on type
* gh-114265: move line number propagation before cfg optimization, remove ↵Irit Katriel2024-01-191-53/+54
| | | | guarantee_lineno_for_exits (#114267)
* gh-111968: Use per-thread freelists for generator in free-threading (gh-114189)Donghee Na2024-01-184-4/+3
|
* Delete unused macro (GH-114238)Mark Shannon2024-01-181-3/+0
|
* Update copyright years to 2024. (GH-113608)solya0x2024-01-161-1/+1
| | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-111968: Use per-thread freelists for PyContext in free-threading (gh-114122)Donghee Na2024-01-165-28/+18
|
* gh-113626: Add allow_code parameter in marshal functions (GH-113648)Serhiy Storchaka2024-01-162-43/+282
| | | | | Passing allow_code=False prevents serialization and de-serialization of code objects which is incompatible between Python versions.
* GH-113655: Lower the C recursion limit on various platforms (GH-113944)Mark Shannon2024-01-165-22/+13
|
* gh-111968: Use per-thread slice_cache in free-threading (gh-113972)Donghee Na2024-01-152-3/+2
|
* GH-112354: `_GUARD_IS_TRUE_POP` side-exits to target the next instruction, ↵Mark Shannon2024-01-153-14/+27
| | | | not themselves. (GH-114078)
* gh-113710: Add types to the interpreter DSL (#113711)Ken Jin2024-01-122-41/+26
| | | | 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-107901: duplicate blocks with no lineno that have an eval break and ↵Irit Katriel2024-01-121-10/+22
| | | | multiple predecessors (#113950)
* GH-113860: Get rid of `_PyUOpExecutorObject` (GH-113954)Brandt Bucher2024-01-126-29/+27
|
* gh-111968: Use per-thread freelists for tuple in free-threading (gh-113921)Donghee Na2024-01-114-3/+2
|
* gh-113845: Fix a compiler warning in Python/suggestions.c (GH-113949)Serhiy Storchaka2024-01-111-2/+0
|
* GH-113853: Guarantee forward progress in executors (GH-113854)Mark Shannon2024-01-113-73/+118
|
* gh-107901: jump leaving an exception handler doesn't need an eval break ↵Irit Katriel2024-01-111-1/+1
| | | | check (#113943)
* gh-89811: Check for valid tp_version_tag in specializer (GH-113558)Peter Lazorchak2024-01-111-1/+29
|
* gh-111968: Use per-thread freelists for float in free-threading (gh-113886)Donghee Na2024-01-104-3/+2
|
* GH-113860: All executors are now defined in terms of micro ops. Convert ↵Mark Shannon2024-01-104-130/+111
| | | | counter executor to use uops. (GH-113864)
* gh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API (gh-113584)Donghee Na2024-01-095-17/+71
|
* Fix opcode name printing in debug mode (#113870)Guido van Rossum2024-01-091-3/+3
| | | Fix a few places where the lltrace debug output printed ``(null)`` instead of an opcode name, because it was calling ``_PyUOpName()`` on a Tier-1 opcode.
* gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c ↵Yan Yanchii2024-01-091-0/+6
| | | | (GH-113843)
* gh-110721: Remove unused code from suggestions.c after moving PyErr_Display ↵Pablo Galindo Salgado2024-01-082-219/+1
| | | | to use the traceback module (#113712)
* gh-73965: Move PYTHON_HISTORY into the correct usage section (#113798)Hugo van Kemenade2024-01-081-1/+1
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-73965: New environment variable PYTHON_HISTORY (#13208)Zackery Spytz2024-01-071-0/+1
| | | | | | | | It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-107901: synthetic jumps which are not at end of loop no longer check the ↵Irit Katriel2024-01-062-23/+36
| | | | eval breaker (#113721)