summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-121485: Always use 64-bit integers for integers bits count (GH-121486)Serhiy Storchaka2024-08-301-7/+7
| | | | | Use 64-bit integers instead of platform specific size_t or Py_ssize_t to represent the number of bits in Python integer.
* gh-123142: fix too wide source location of GET_ITER/GET_AITER (#123420)Irit Katriel2024-08-281-8/+7
|
* gh-123344: Add missing ast optimizations for PEP 696 (#123377)Bogdan Romanyuk2024-08-281-0/+3
| | | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-123271: Make builtin zip method safe under free-threading (#123272)Pieter Eendebak2024-08-271-1/+2
| | | | | | | | | | | | | | | | The `zip_next` function uses a common optimization technique for methods that generate tuples. The iterator maintains an internal reference to the returned tuple. When the method is called again, it checks if the internal tuple's reference count is 1. If so, the tuple can be reused. However, this approach is not safe under the free-threading build: after checking the reference count, another thread may perform the same check and also reuse the tuple. This can result in a double decref on the items of the replaced tuple and a double incref (memory leak) on the items of the tuple being set. This adds a function, `_PyObject_IsUniquelyReferenced` that encapsulates the stricter logic necessary for the free-threaded build: the internal tuple must be owned by the current thread, have a local refcount of one, and a shared refcount of zero.
* gh-121404: split compiler_nameop into a codegen part and a compiler part ↵Irit Katriel2024-08-271-89/+101
| | | | (#123398)
* GH-117759: Document incremental GC (GH-123266)Mark Shannon2024-08-271-11/+16
| | | | | | * Update what's new * Update gc module docs and fix inconsistency in gc.get_objects
* gh-121404: compiler_visit_* --> codegen_visit_* (#123382)Irit Katriel2024-08-271-61/+49
|
* GH-123232: Factor BINARY_SLICE and STORE_SLICE to handle stats properly for ↵Mark Shannon2024-08-273-34/+66
| | | | tier 2. (GH-123381)
* Remove comment from pystate created in 2003 (#123259)Anthony Shaw2024-08-241-5/+0
|
* gh-117376: Make `Py_DECREF` a macro in ceval.c in free-threaded build (#122975)Sam Gross2024-08-231-15/+44
| | | | | | | | | | | `Py_DECREF` and `PyStackRef_CLOSE` are now implemented as macros in the free-threaded build in ceval.c. There are two motivations; * MSVC has problems inlining functions in ceval.c in the PGO build. * We will want to mark escaping calls in order to spill the stack pointer in ceval.c and we will want to do this around `_Py_Dealloc` (or `_Py_MergeZeroLocalRefcount` or `_Py_DecRefShared`), not around the entire `Py_DECREF` or `PyStackRef_CLOSE` call.
* gh-123205: `Python/bytecodes.c`: Fix compiler warning (#123206)Kirill Podoprigora2024-08-233-3/+3
| | | Fix MSVC warning "conversion from '__int64' to 'int'"
* gh-121404: more compiler_* -> codegen_*, class_body and comprehensions (#123262)Irit Katriel2024-08-231-59/+82
|
* GH-122298: Restore printing of GC stats (GH-123261)Mark Shannon2024-08-231-0/+25
|
* GH-123232: Fix "not specialized" stats (GH-123236)Mark Shannon2024-08-234-2/+18
|
* gh-121404: compiler_annassign --> codegen_annassign (#123245)Irit Katriel2024-08-231-63/+100
|
* GH-123040: Specialize shadowed `LOAD_ATTR`. (GH-123219)Mark Shannon2024-08-234-138/+261
|
* gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH_HINT`` ↵Donghee Na2024-08-223-18/+21
| | | | (gh-123092)
* gh-121404: remove redundant c_nestlevel. more compiler abstractions. more ↵Irit Katriel2024-08-221-118/+111
| | | | macro usage consistency (#123225)
* GH-123197: Only count an instruction as deferred if it hasn't deopted first. ↵Mark Shannon2024-08-223-30/+31
| | | | | (GH-123222) Only count an instruction as deferred if hasn't deopted first.
* GH-118093: Specialize calls to non-vectorcall classes as ↵Brandt Bucher2024-08-221-5/+1
| | | | | `CALL_NON_PY_GENERAL` (GH-123212) Specialize classes without vectorcall as CALL_NON_PY_GENERAL
* gh-123142: Fix too wide source locations in tracebacks of exceptions from ↵Irit Katriel2024-08-211-2/+3
| | | | broken iterables in comprehensions (#123173)
* GH-115776: Allow any fixed sized object to have inline values (GH-123192)Mark Shannon2024-08-218-31/+50
|
* gh-121404: split fblock handling into compiler_* and codegen_* parts (#123199)Irit Katriel2024-08-211-15/+24
|
* GH-123197: Increment correct stat for CALL_KW (GH-123200)Mark Shannon2024-08-212-2/+2
|
* GH-123185: Check for `NULL` after calling `_PyEvalFramePushAndInit` (GH-123194)Mark Shannon2024-08-213-3/+15
|
* GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)Mark Shannon2024-08-208-145/+287
| | | | | * 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-123048: Fix missing source location in pattern matching code (#123167)Irit Katriel2024-08-201-1/+1
|
* gh-121404: rename functions to use codegen_* prefix. Use macros more ↵Irit Katriel2024-08-191-349/+303
| | | | consistently. (#123139)
* gh-121404: pass metadata to compiler_enter_scope (optionally) so that ↵Irit Katriel2024-08-191-58/+82
| | | | codegen functions don't need to set it on the code unit (#123078)
* GH-118093: Specialize `CALL_KW` (GH-123006)Mark Shannon2024-08-168-15/+749
|
* gh-121404: rename compiler_addop* to codegen_addop*, and replace direct ↵Irit Katriel2024-08-161-96/+102
| | | | usages by the macros (#123043)
* Add debug offsets for free threaded builds (#123041)Pablo Galindo Salgado2024-08-152-2/+4
|
* gh-117139: Garbage collector support for deferred refcounting (#122956)Sam Gross2024-08-153-18/+93
| | | | | | | | | | The free-threaded GC now visits interpreter stacks to keep objects that use deferred reference counting alive. Interpreter frames are zero initialized in the free-threaded GC so that the GC doesn't see garbage data. This is a temporary measure until stack spilling around escaping calls is implemented. Co-authored-by: Ken Jin <kenjin@python.org>
* gh-121404: split compiler's push/pop_inlined_comprehension_state into ↵Irit Katriel2024-08-151-63/+102
| | | | codegen and compiler parts (#123021)
* GH-118093: Turn some DEOPT_IFs into EXIT_IFs (GH-122998)Brandt Bucher2024-08-143-27/+27
|
* GH-120024: Remove `CHECK_EVAL_BREAKER` macro. (GH-122968)Mark Shannon2024-08-146-311/+636
| | | | | * Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis * Eliminate CHECK_EVAL_BREAKER macro
* gh-122985: add SYMBOL_TO_SCOPE macro in symtable (#122986)Irit Katriel2024-08-142-9/+6
|
* gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)Eric Snow2024-08-131-4/+8
| | | As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
* GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH-122942)Mark Shannon2024-08-134-46/+52
|
* GH-122821: Simplify compilation of while statements to ensure consistency of ↵Mark Shannon2024-08-131-3/+1
| | | | offsets for sys.monitoring (GH-122934)
* GH-118093: Handle some polymorphism before requiring progress in tier two ↵Brandt Bucher2024-08-124-38/+61
| | | | (GH-122843)
* gh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)Sam Gross2024-08-123-29/+3
| | | | | | | This replaces `_PyList_FromArraySteal` with `_PyList_FromStackRefSteal`. It's functionally equivalent, but takes a `_PyStackRef` array instead of an array of `PyObject` pointers. Co-authored-by: Ken Jin <kenjin@python.org>
* gh-117139: Fix a few `_PyStackRef` related bugs (#122831)Sam Gross2024-08-123-16/+14
| | | | | | `BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL` `CONVERSION_FAILED` was incorrect. Co-authored-by: Ken Jin <kenjin@python.org>
* GH-122869: Add missing tier two optimizer cases (GH-122936)Mark Shannon2024-08-122-4/+31
|
* gh-122860: Remove unused macro `_Py_atomic_load_relaxed_int32` (#122861)Sam Gross2024-08-112-14/+0
|
* gh-122697: Fix free-threading memory leaks at shutdown (#122703)Sam Gross2024-08-083-1/+17
| | | | | | | | | | | | | | | We were not properly accounting for interpreter memory leaks at shutdown and had two sources of leaks: * Objects that use deferred reference counting and were reachable via static types outlive the final GC. We now disable deferred reference counting on all objects if we are calling the GC due to interpreter shutdown. * `_PyMem_FreeDelayed` did not properly check for interpreter shutdown so we had some memory blocks that were enqueued to be freed, but never actually freed. * `_PyType_FinalizeIdPool` wasn't called at interpreter shutdown.
* gh-122562: fix dump_symtable for ste_free and ste_child_free removal (#122825)Irit Katriel2024-08-081-1/+1
|
* GH-120024: Tidy up case generator code a bit. (GH-122780)Mark Shannon2024-08-081-3/+0
|
* gh-122247: Move instruction instrumentation sanity check after tracing check ↵Tian Gao2024-08-081-1/+1
| | | | (#122251)
* gh-118814: Fix the TypeVar constructor when name is passed by keyword ↵Serhiy Storchaka2024-08-071-1/+1
| | | | | | | | (GH-122664) Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor.