aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
Commit message (Collapse)AuthorAge
* gh-135474: Specialize arithmetic only on compact ints (GH-135479)Ken Jin19 hours
| | | | Specialize arithmetic only on compact ints. This also makes int operations non-escaping in the JIT and in tier 1.
* gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)Eric Snow30 hours
| | | | | | | | | | In this refactor we: * move some code around * make a couple of typedefs opaque * decouple errors from session state * improve tracebacks for propagated exceptions This change helps simplify several upcoming changes.
* gh-128627: Fix iPad detection in wasm-gc (#135388)Gyeongjae Choi3 days
| | | | | On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection to add a feature-based check to detect this case.
* gh-134939: Add the concurrent.interpreters Module (gh-133958)Eric Snow3 days
| | | | | | PEP-734 has been accepted (for 3.14). (FTR, I'm opposed to putting this under the concurrent package, but doing so is the SC condition under which the module can land in 3.14.)
* GH-135379: Remove types from stack items in code generator. (GH-135384)Mark Shannon4 days
| | | | * Make casts explicit in the instruction definitions
* Fix warnings `set but not used [-Wunused-but-set-variable]` in ↵Chris Eibl5 days
| | | | remote_debug.h (#135290)
* Fix definition of `_Py_RemoteDebug_` symbols for static linking (#135146)Zanie Blue5 days
|
* gh-131798: Optimize `_UNARY_INVERT` (GH-135222)Noam Cohen6 days
|
* GH-131798: Type-propagate string/list/tuple slices (GH-134671)Amit Lavon7 days
|
* gh-134876: Add fallback for when process_vm_readv fails with ENOSYS (#134878)Daniel Golding7 days
|
* GH-131798: Optimize away type(x) in the JIT when the result is known (GH-135194)Tomas R.8 days
|
* GH-132554: Fix tier2 `FOR_ITER` implementation and optimizations (GH-135137)Mark Shannon9 days
|
* gh-135161: Remove redundant NULL check for 'exc' after dereference in ↵rialbat10 days
| | | | ceval.c (#135162)
* gh-134889: Fix handling of a few opcodes when optimizing `LOAD_FAST` (#134958)mpage10 days
| | | We were incorrectly handling a few opcodes that leave their operands on the stack. Treat all of these conservatively; assume that they always leave operands on the stack.
* gh-135099: Only wait on `_PyOS_SigintEvent()` in main thread (GH-135100)Sam Gross11 days
| | | | | | | | | | | | On Windows, the `_PyOS_SigintEvent()` event handle is used to interrupt the main thread when Ctrl-C is pressed. Previously, we also waited on the event from other threads, but ignored the result. However, this can race with interpreter shutdown because the main thread closes the handle in `_PySignal_Fini` and threads may still be running and using mutexes during interpreter shtudown. Only use `_PyOS_SigintEvent()` in the main thread in parking_lot.c, like we do in other places in the CPython codebase.
* gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)stratakis12 days
| | | | | | | | | | Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S. Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks. Manual application is required for the assembly files. See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
* gh-132775: Expand the Capability of Interpreter.call() (gh-133484)Eric Snow2025-05-30
| | | It now supports most callables, full args, and return values.
* GH-134879: Fix `INSTRUMENT_FOR_ITER` for list/tuple (#134897)Mark Shannon2025-05-30
| | | Fix INSTRUMENT_FOR_ITER for list/tuple
* gh-134745: Change PyThread_allocate_lock() implementation to PyMutex (#134747)Victor Stinner2025-05-30
| | | Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)Victor Stinner2025-05-29
| | | | | | | | | | Replace most PyUnicodeWriter_WriteUTF8() calls with PyUnicodeWriter_WriteASCII(). Unrelated change to please the linter: remove an unused import in test_ctypes. Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)Serhiy Storchaka2025-05-28
| | | | | Add functions PySys_GetAttr(), PySys_GetAttrString(), PySys_GetOptionalAttr() and PySys_GetOptionalAttrString().
* gh-128629: Add _Py_PACK_VERSION for CPython's own definitions (GH-134247)Petr Viktorin2025-05-28
| | | | | | | | Add _Py_PACK_VERSION for CPython's own definitions Py_PACK_VERSION was added to limited API in 3.14, so if Py_LIMITED_API is lower, the macro can't be used. Add a private version that can be used in CPython headers for checks like `Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 14)`.
* gh-127266: avoid data races when updating type slots (gh-133177)Neil Schemenauer2025-05-27
| | | | | | In the free-threaded build, avoid data races caused by updating type slots or type flags after the type was initially created. For those (typically rare) cases, use the stop-the-world mechanism. Remove the use of atomics when reading or writing type flags.
* gh-131798: Optimize `_ITER_CHECK_TUPLE` (GH-134803)Noam Cohen2025-05-28
|
* gh-132917: fix data race on `last_mem` in free-threading gc (#134692)Kumar Aditya2025-05-27
|
* gh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134758)Eric Snow2025-05-27
| | | | | This is a small follow-up to gh-133481. There's a corner case in the behavior of PyImport_ImportModuleAttrString(), where it expects __builtins__ to be set if __globals__ is set.
* GH-132554: "Virtual" iterators (GH-132555)Mark Shannon2025-05-27
| | | | | | * FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero * NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.
* gh-134557: Suppress immortalization in _PyCode_GetScriptXIData under ↵neonene2025-05-26
| | | | | | | | | free-threading (gh-134686) Disable immortalization around Py_CompileString*(). The same approach as 332356b that fixed the refleaks in compile() and eval(). E: 09e72cf can pass test_capi, test_sys and test__interpchannels with this patch for me.
* gh-91048: Add better error messages for remote debugging for CI builds (#134682)Pablo Galindo Salgado2025-05-26
|
* gh-91048: Correct Apple platform includes for iOS. (#134712)Russell Keith-Magee2025-05-26
| | | Correct Apple platform includes for iOS.
* Heavily comment Python/perf_jit_trampoline.c to improve maintainability ↵Pablo Galindo Salgado2025-05-25
| | | | | (#134527) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-91048: Refactor and optimize remote debugging module (#134652)Pablo Galindo Salgado2025-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Completely refactor Modules/_remote_debugging_module.c with improved code organization, replacing scattered reference counting and error handling with centralized goto error paths. This cleanup improves maintainability and reduces code duplication throughout the module while preserving the same external API. Implement memory page caching optimization in Python/remote_debug.h to avoid repeated reads of the same memory regions during debugging operations. The cache stores previously read memory pages and reuses them for subsequent reads, significantly reducing system calls and improving performance. Add code object caching mechanism with a new code_object_generation field in the interpreter state that tracks when code object caches need invalidation. This allows efficient reuse of parsed code object metadata and eliminates redundant processing of the same code objects across debugging sessions. Optimize memory operations by replacing multiple individual structure copies with single bulk reads for the same data structures. This reduces the number of memory operations and system calls required to gather debugging information from the target process. Update Makefile.pre.in to include Python/remote_debug.h in the headers list, ensuring that changes to the remote debugging header force proper recompilation of dependent modules and maintain build consistency across the codebase. Also, make the module compatible with the free threading build as an extra :) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-131798: Small improvements to `remove_unneeded_uops` (GH-134554)Tomas R.2025-05-23
| | | Improve remove_unneeded_uops
* GH-130397: remove special-casing of C stack depth for WASI (#134469)Brett Cannon2025-05-22
| | | | | Removed special-casing for WASI when setting C stack depth limits. Since WASI has its own C stack checking this isn't a security risk. Also disabled some tests that stopped passing. They all happened to have already been disabled under Emscripten.
* gh-132775: Fix Recently Introduced Warnings (gh-134530)Eric Snow2025-05-22
|
* GH-131798: Optimize away isinstance calls in the JIT (GH-134369)Tomas R.2025-05-22
|
* gh-132775: Make _PyXI_session Opaque (gh-134452)Eric Snow2025-05-22
| | | | | | | | | This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code. Making the session opaque requires adding the following internal-only functions: * _PyXI_NewSession() * _PyXI_FreeSession() * _PyXI_GetMainNamespace()
* GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)Brandt Bucher2025-05-22
|
* GH-131798: Turn _LOAD_SMALL_INT into _LOAD_CONST_INLINE_BORROW in the JIT ↵Nadeshiko Manju2025-05-22
| | | | (GH-134406)
* gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134440)Eric Snow2025-05-22
| | | This change includes some semi-related refactoring of queues and channels.
* gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)Eric Snow2025-05-21
| | | It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`. There's also room for other fallback modes if that later makes sense.
* gh-131185: Use a proper thread-local for cached thread states (gh-132510)Peter Bierma2025-05-21
| | | | | Switches over to a _Py_thread_local in place of autoTssKey, and also fixes a few other checks regarding PyGILState_Ensure after finalization. Note that this doesn't fix concurrent use of PyGILState_Ensure with Py_Finalize; I'm pretty sure zapthreads doesn't work at all, and that needs to be fixed seperately.
* GH-131798: Narrow types more aggressively in the JIT (GH-134373)Brandt Bucher2025-05-20
|
* GH-131798: Narrow the return type of _GET_LEN to int (GH-133345)Nadeshiko Manju2025-05-20
|
* gh-106213: Shorten Emscripten wasm-gc trampoline by a little (#133984)Hood Chatham2025-05-20
| | | Using the if instruction results in slightly shorter trampoline code.
* GH-134282: Always borrow references LOAD_CONST (GH-134284)Mark Shannon2025-05-20
|
* GH-131798: Add _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW (GH-134268)Tomas R.2025-05-19
|
* GH-131798: Split CALL_LIST_APPEND into several uops (GH-134240)Diego Russo2025-05-19
|
* Revert "gh-128639: Don't assume one thread in subinterpreter finalization ↵Peter Bierma2025-05-19
| | | | | | | (gh-128640)" (gh-134256) This reverts commit 9859791f9e116c827468f307ac0770286c975c8b. The original change broke the iOS and android buildbots, where the tests are run single-process.
* Simplify interp_look_up_id() (#134257)Victor Stinner2025-05-19
| | | | Don't use PyInterpreterState_GetID() but get directly the interpreter 'id' member which cannot fail.