summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* GH-115709: Invalidate executors when a local variable is changed via ↵Mark Shannon2024-05-062-0/+6
| | | | | frame.f_locals (#118639) Also fix unrelated assert in debug Tier2/JIT builds.
* gh-118415: Fix issues with local tracing being enabled/disabled on a ↵Dino Viehland2024-05-061-46/+45
| | | | function (#118496)
* gh-118518: Ensure that the code padding it's applied (#118654)Pablo Galindo Salgado2024-05-061-1/+1
|
* gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL ↵Petr Viktorin2024-05-062-2/+2
| | | | (GH-118645)
* gh-118518: Correct type of perf_profiling in config (#118646)Pablo Galindo Salgado2024-05-061-1/+1
|
* gh-118465: Add __firstlineno__ attribute to class (GH-118475)Serhiy Storchaka2024-05-061-0/+5
| | | | It is set by compiler with the line number of the first line of the class definition.
* gh-118613: Fix error handling of `_PyEval_GetFrameLocals` in `ceval.c` (#118614)Nikita Sobolev2024-05-061-4/+8
|
* gh-111201: A new Python REPL (GH-111567)Pablo Galindo Salgado2024-05-054-3/+36
| | | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-118518: Use the raw syscall directly for gettid (#118592)Pablo Galindo Salgado2024-05-051-1/+2
|
* gh-110850: Remove _PyTime_TimeUnchecked() function (#118552)Victor Stinner2024-05-057-63/+51
| | | | | | | | | | | | | Use the new public Raw functions: * _PyTime_PerfCounterUnchecked() with PyTime_PerfCounterRaw() * _PyTime_TimeUnchecked() with PyTime_TimeRaw() * _PyTime_MonotonicUnchecked() with PyTime_MonotonicRaw() Remove internal functions: * _PyTime_PerfCounterUnchecked() * _PyTime_TimeUnchecked() * _PyTime_MonotonicUnchecked()
* gh-118518: Allow perf to work without frame pointers (#112254)Pablo Galindo Salgado2024-05-055-6/+694
|
* gh-117953: Track Extra Details in Global Extensions Cache (gh-118532)Eric Snow2024-05-042-137/+567
| | | | | | | | | | | | We have only been tracking each module's PyModuleDef. However, there are some problems with that. For example, in some cases we load single-phase init extension modules from def->m_base.m_init or def->m_base.m_copy, but if multiple modules share a def then we can end up with unexpected behavior. With this change, we track the following: * PyModuleDef (same as before) * for some modules, its init function or a copy of its __dict__, but specific to that module * whether it is a builtin/core module or a "dynamic" extension * the interpreter (ID) that owns the cached __dict__ (only if cached) This also makes it easier to remember the module's kind (e.g. single-phase init) and if loading it previously failed, which I'm doing separately.
* gh-74929: Implement PEP 667 (GH-115153)Tian Gao2024-05-043-20/+43
|
* GH-118095: Use broader specializations of CALL in tier 1, for better tier 2 ↵Mark Shannon2024-05-049-190/+541
| | | | | | | | | | 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-111997: C-API for signalling monitoring events (#116413)Irit Katriel2024-05-041-0/+301
|
* GH-113464: Remove the extra jump via `_SIDE_EXIT` in `_EXIT_TRACE` (GH-118545)Mark Shannon2024-05-044-29/+12
|
* gh-110850: Use _PyDeadline_Get() in EnterNonRecursiveMutex() (#118556)Victor Stinner2024-05-041-6/+7
| | | | | | | | Use _PyDeadline_Init() and _PyDeadline_Get() in EnterNonRecursiveMutex() of thread_nt.h. _PyDeadline_Get() uses the monotonic clock which is now the same as the perf counter clock on all platforms. So this change does not cause any behavior change. It just reuses existing helper functions.
* GH-113464: Generate a more efficient JIT (GH-118512)Brandt Bucher2024-05-031-311/+276
|
* gh-118534: Fix load of `gil->locked` (#118553)Sam Gross2024-05-031-1/+1
|
* gh-107674: Improve performance of `sys.settrace` (GH-117133)Tian Gao2024-05-036-52/+62
| | | | | | * Check tracing in RESUME_CHECK * Only change to RESUME_CHECK if not tracing
* gh-116322: Add Py_mod_gil module slot (#116882)Brett Simmers2024-05-037-0/+11
| | | | | | | | | | | | | | This PR adds the ability to enable the GIL if it was disabled at interpreter startup, and modifies the multi-phase module initialization path to enable the GIL when loading a module, unless that module's spec includes a slot indicating it can run safely without the GIL. PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148. A warning will be issued up to once per interpreter for the first GIL-using module that is loaded. If `-v` is given, a shorter message will be printed to stderr every time a GIL-using module is loaded (including the first one that issues a warning).
* gh-117514: Add `sys._is_gil_enabled()` function (#118514)Sam Gross2024-05-032-1/+49
| | | | | The function returns `True` or `False` depending on whether the GIL is currently enabled. In the default build, it always returns `True` because the GIL is always enabled.
* gh-118527: Use `_Py_ID(__main__)` for main module name (#118528)Sam Gross2024-05-031-1/+1
| | | | | Most module names are interned and immortalized, but the main module was not. This partially addresses a scaling bottleneck in the free-threaded when creating closure concurrently in the main module.
* gh-118513: Fix sibling comprehensions with a name bound in one and global in ↵Carl Meyer2024-05-031-39/+42
| | | | | | the other (#118526) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-116126: Implement PEP 696 (#116129)Jelle Zijlstra2024-05-035-53/+286
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-117953: Other Cleanups in the Extensions Machinery (gh-118206)Eric Snow2024-05-031-94/+134
| | | This change will make some later changes simpler.
* gh-116738: Make `_codecs` module thread-safe (#117530)Brett Simmers2024-05-022-73/+81
| | | | | | | | | | | | | | | The module itself is a thin wrapper around calls to functions in `Python/codecs.c`, so that's where the meaningful changes happened: - Move codecs-related state that lives on `PyInterpreterState` to a struct declared in `pycore_codecs.h`. - In free-threaded builds, add a mutex to `codecs_state` to synchronize operations on `search_path`. Because `search_path_mutex` is used as a normal mutex and not a critical section, we must be extremely careful with operations called while holding it. - The codec registry is explicitly initialized as part of `_PyUnicode_InitEncodings` to simplify thread-safety.
* Remove stray `__cplusplus` guard in sysmodule.c (#118511)Sam Gross2024-05-021-4/+0
|
* gh-93502: Add new C-API functions to trace object creation and destruction ↵Pablo Galindo Salgado2024-05-021-1/+9
| | | | (#115945)
* gh-105879: Add support for keyword arguments to eval and exec (#105885)Raphael Gaschignard2024-05-022-28/+63
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-118095: Unify the behavior of tier 2 FOR_ITER branch micro-ops (GH-118420)Mark Shannon2024-05-025-21/+56
| | | | | | * Target _FOR_ITER_TIER_TWO at POP_TOP following the matching END_FOR * Modify _GUARD_NOT_EXHAUSTED_RANGE, _GUARD_NOT_EXHAUSTED_LIST and _GUARD_NOT_EXHAUSTED_TUPLE so that they also target the POP_TOP following the matching END_FOR
* gh-116180: Check the globals argument in PyRun_* C API (GH-116637)NGRsoftlab2024-05-021-9/+12
| | | | | It used to crash when passing NULL or non-dict as globals. Now it sets a SystemError.
* gh-118216: Don't consider dotted `__future__` imports (#118267)Crowthebird2024-05-022-2/+2
|
* GH-117442: Check eval-breaker at start (rather than end) of tier 2 loops ↵Mark Shannon2024-05-025-61/+30
| | | | (GH-118482)
* gh-117953: Work Relative to Specific Extension Kinds in the Import Machinery ↵Eric Snow2024-05-012-65/+293
| | | | | (gh-118205) This change will make some later changes simpler.
* GH-118095: Make sure that progress is made if there are pending calls being ↵Mark Shannon2024-05-011-11/+10
| | | | handled. (GH-118484)
* gh-118272: set stacktop to 0 before freeing contents, to avoid access to ↵Irit Katriel2024-05-011-2/+3
| | | | invalid objects during GC (#118478)
* gh-117225: Move colorize functionality to own internal module (#118283)Hugo van Kemenade2024-05-011-0/+1
|
* gh-110850: Add PyTime_TimeRaw() function (#118394)Victor Stinner2024-05-011-24/+69
| | | | | | | | | | | | | | | | | Add "Raw" variant of PyTime functions: * PyTime_MonotonicRaw() * PyTime_PerfCounterRaw() * PyTime_TimeRaw() Changes: * Add documentation and tests. Tests release the GIL while calling raw clock functions. * py_get_system_clock() and py_get_monotonic_clock() now check that the GIL is hold by the caller if raise_exc is non-zero. * Reimplement "Unchecked" functions with raw clock functions. Co-authored-by: Petr Viktorin <encukou@gmail.com>
* GH-115802: Use the GHC calling convention in JIT code (GH-118287)Brandt Bucher2024-05-012-15/+39
|
* gh-117958: Expose JIT code via method in UOpExecutor (#117959)Anthony Shaw2024-05-011-1/+24
|
* gh-116767: fix crash on 'async with' with many context managers (GH-118348)Irit Katriel2024-05-011-2/+16
| | | | | | | Account for `add_stopiteration_handler` pushing a block for `async with`. To allow generator functions that previously almost hit the `CO_MAXBLOCKS` limit by nesting non-async blocks, the limit is increased by 1. This increase allows one more block in non-generator functions.
* GH-118095: Make invalidating and clearing executors memory safe (GH-118459)Mark Shannon2024-05-013-40/+99
|
* gh-118335: Configure Tier 2 interpreter at build time (#118339)Guido van Rossum2024-05-0110-13/+57
| | | | | | | | | | | | | | | | | | | | | | The code for Tier 2 is now only compiled when configured with `--enable-experimental-jit[=yes|interpreter]`. We drop support for `PYTHON_UOPS` and -`Xuops`, but you can disable the interpreter or JIT at runtime by setting `PYTHON_JIT=0`. You can also build it without enabling it by default using `--enable-experimental-jit=yes-off`; enable with `PYTHON_JIT=1`. On Windows, the `build.bat` script supports `--experimental-jit`, `--experimental-jit-off`, `--experimental-interpreter`. In the C code, `_Py_JIT` is defined as before when the JIT is enabled; the new variable `_Py_TIER2` is defined when the JIT *or* the interpreter is enabled. It is actually a bitmask: 1: JIT; 2: default-off; 4: interpreter.
* gh-117657: Don't specialize RESUME_CHECK when specialization is disabled ↵Ken Jin2024-04-302-0/+4
| | | | (GH-118349)
* gh-118422: Fix run_fileexflags() test (#118429)Victor Stinner2024-04-302-51/+53
| | | | | Don't test the undefined behavior of fileno() on a closed file, but use fstat() as a reliable test if the file was closed or not.
* gh-118332: Fix deadlock involving stop the world (#118412)Sam Gross2024-04-302-4/+5
| | | | | | Avoid detaching thread state when stopping the world. When re-attaching the thread state, the thread would attempt to resume the top-most critical section, which might now be held by a thread paused for our stop-the-world request.
* gh-117657: Fix small issues with instrumentation and TSAN (#118064)Dino Viehland2024-04-305-8/+11
| | | Small TSAN fixups for instrumentation
* gh-118272: Clear generator frame's locals when the generator is closed (#118277)Irit Katriel2024-04-301-5/+12
| | | Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* gh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)Nice Zombies2024-04-301-2/+2
|