summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* 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)
* gh-113688: Split up gcmodule.c (gh-113715)Sam Gross2024-01-051-0/+1958
| | | | | This splits part of Modules/gcmodule.c of into Python/gc.c, which now contains the core garbage collection implementation. The Python module remain in the Modules/gcmodule.c file.
* gh-112532: Tag mimalloc heaps and pages (#113742)Sam Gross2024-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | * gh-112532: Tag mimalloc heaps and pages Mimalloc pages are data structures that contain contiguous allocations of the same block size. Note that they are distinct from operating system pages. Mimalloc pages are contained in segments. When a thread exits, it abandons any segments and contained pages that have live allocations. These segments and pages may be later reclaimed by another thread. To support GC and certain thread-safety guarantees in free-threaded builds, we want pages to only be reclaimed by the corresponding heap in the claimant thread. For example, we want pages containing GC objects to only be claimed by GC heaps. This allows heaps and pages to be tagged with an integer tag that is used to ensure that abandoned pages are only claimed by heaps with the same tag. Heaps can be initialized with a tag (0-15); any page allocated by that heap copies the corresponding tag. * Fix conversion warning
* GH-113486: Do not emit spurious PY_UNWIND events for optimized calls to ↵Mark Shannon2024-01-053-5/+6
| | | | classes. (GH-113680)
* gh-112532: Isolate abandoned segments by interpreter (#113717)Sam Gross2024-01-041-0/+5
| | | | | | | | | | | | | | | * gh-112532: Isolate abandoned segments by interpreter Mimalloc segments are data structures that contain memory allocations along with metadata. Each segment is "owned" by a thread. When a thread exits, it abandons its segments to a global pool to be later reclaimed by other threads. This changes the pool to be per-interpreter instead of process-wide. This will be important for when we use mimalloc to find GC objects in the `--disable-gil` builds. We want heaps to only store Python objects from a single interpreter. Absent this change, the abandoning and reclaiming process could break this isolation. * Add missing '&_mi_abandoned_default' to 'tld_empty'
* GH-113689: Fix broken handling of invalid executors (GH-113694)Brandt Bucher2024-01-042-2/+4
|
* gh-113603: Compiler no longer tries to maintain the no-empty-block invariant ↵Irit Katriel2024-01-031-78/+38
| | | | (#113636)
* GH-113595: Don't enter invalid executor (GH-113596)Mark Shannon2024-01-032-19/+39
|
* GH-113657: Add back missing _SET_IP uops in tier two (GH-113662)Brandt Bucher2024-01-021-2/+3
|
* gh-73427: deprecate `_enablelegacywindowsfsencoding` (#107729)Inada Naoki2023-12-281-0/+7
|
* gh-112532: Use separate mimalloc heaps for GC objects (gh-113263)Sam Gross2023-12-262-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | * gh-112532: Use separate mimalloc heaps for GC objects In `--disable-gil` builds, we now use four separate heaps in anticipation of using mimalloc to find GC objects when the GIL is disabled. To support this, we also make a few changes to mimalloc: * `mi_heap_t` and `mi_tld_t` initialization is split from allocation. This allows us to have a `mi_tld_t` per-`PyThreadState`, which is important to keep interpreter isolation, since the same OS thread may run in multiple interpreters (using different PyThreadStates.) * Heap abandoning (mi_heap_collect_ex) can now be called from a different thread than the one that created the heap. This is necessary because we may clear and delete the containing PyThreadStates from a different thread during finalization and after fork(). * Use enum instead of defines and guard mimalloc includes. * The enum typedef will be convenient for future PRs that use the type. * Guarding the mimalloc includes allows us to unconditionally include pycore_mimalloc.h from other header files that rely on things like `struct _mimalloc_thread_state`. * Only define _mimalloc_thread_state in Py_GIL_DISABLED builds
* gh-106905: Use separate structs to track recursion depth in each ↵Yilei Yang2023-12-251-312/+377
| | | | | | PyAST_mod2obj call. (GH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* GH-111485: Fix handling of FOR_ITER in Tier 2 (GH-113394)Mark Shannon2023-12-241-12/+5
|
* gh-113297: Fix segfault in compiler for with statement with 19 context ↵Irit Katriel2023-12-221-1/+2
| | | | managers (#113327)
* gh-113343: Fix error check on mmap(2) (#113342)Namhyung Kim2023-12-211-1/+1
| | | | | | | | | | | | Fix error check on mmap(2) It should check MAP_FAILED instead of NULL for error. On mmap(2) man page: RETURN VALUE On success, mmap() returns a pointer to the mapped area. On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno is set to indicate the error.
* GH-111485: Delete the old generator code. (GH-113321)Mark Shannon2023-12-213-1019/+52
|
* gh-111375: Use `NULL` rather than `None` in the exception stack to indicate ↵Carey Metcalfe2023-12-214-6/+6
| | | | that an exception was handled (#113302)
* GH-111485: Generate `TARGET` table for computed goto dispatch. (GH-113319)Mark Shannon2023-12-201-1/+2
|
* GH-111485: Generate instruction and uop metadata (GH-113287)Mark Shannon2023-12-208-83/+93
|
* gh-113054: Compiler no longer replaces a redundant jump with no line number ↵Irit Katriel2023-12-191-1/+16
| | | | by a NOP (#113139)
* gh-112535: Implement fallback implementation of _Py_ThreadId() (gh-113185)Donghee Na2023-12-181-0/+14
| | | | | --------- Co-authored-by: Sam Gross <colesbury@gmail.com>
* GH-111485: Break up instructions with unused cache entries into component ↵Mark Shannon2023-12-181-0/+71
| | | | micro-ops (GH-113169)
* GH-111485: Test the new cases generator (GH-113252)Mark Shannon2023-12-182-28/+28
|
* gh-111964: Add _PyRWMutex a "readers-writer" lock (gh-112859)Sam Gross2023-12-161-0/+106
| | | | This adds `_PyRWMutex`, a "readers-writer" lock, which wil be used to serialize global stop-the-world pauses with per-interpreter pauses.
* GH-111485: Mark some instructions as `TIER_ONE_ONLY` (GH-113155)Brandt Bucher2023-12-153-139/+14
|
* GH-112354: Treat _EXIT_TRACE like an unconditional side exit (GH-113104)Mark Shannon2023-12-144-21/+4
|
* gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770)Serhiy Storchaka2023-12-141-2/+2
| | | | | | It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
* Fix whitespace in generated codeMark Shannon2023-12-131-6/+6
|
* gh-76785: Avoid Pickled TracebackException for Propagated Subinterpreter ↵Eric Snow2023-12-131-151/+88
| | | | | Exceptions (gh-113036) We need the TracebackException of uncaught exceptions for a single purpose: the error display. Thus we only need to pass the formatted error display between interpreters. Passing a pickled TracebackException is overkill.
* gh-112723: Call `PyThreadState_Clear()` from the correct interpreter (#112776)Sam Gross2023-12-133-53/+30
| | | | | | | | | | | | | The `PyThreadState_Clear()` function must only be called with the GIL held and must be called from the same interpreter as the passed in thread state. Otherwise, any Python objects on the thread state may be destroyed using the wrong interpreter, leading to memory corruption. This is also important for `Py_GIL_DISABLED` builds because free lists will be associated with PyThreadStates and cleared in `PyThreadState_Clear()`. This fixes two places that called `PyThreadState_Clear()` from the wrong interpreter and adds an assertion to `PyThreadState_Clear()`.
* gh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)Eric Snow2023-12-131-12/+206
| | | When an exception is uncaught in Interpreter.exec_sync(), it helps to show that exception's error display if uncaught in the calling interpreter. We do so here by generating a TracebackException in the subinterpreter and passing it between interpreters using pickle.
* gh-112320: Implement on-trace confidence tracking for branches (#112321)Guido van Rossum2023-12-122-3/+18
| | | We track the confidence as a scaled int.
* gh-113010: Don't decrement deferred in pystats (#113032)Michael Droettboom2023-12-121-4/+0
| | | 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.