summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* gh-118926: Spill deferred references to stack in cases generator (#122748)Sam Gross2024-08-073-35/+41
| | | | | | | This automatically spills the results from `_PyStackRef_FromPyObjectNew` to the in-memory stack so that the deferred references are visible to the GC before we make any possibly escaping call. Co-authored-by: Ken Jin <kenjin@python.org>
* gh-122759: Remove `assert` from `RERAISE` error handling (#122760)sobolevn2024-08-072-2/+0
|
* gh-117139: Fix an incorrect borrow in bytecodes.c (#122318)Sam Gross2024-08-073-11/+14
| | | `_PyDict_SetItem_Take2` steals both the key (i.e., `sub`) and the value.
* gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)Victor Stinner2024-08-061-1/+1
| | | | | | | Fix PyEval_GetLocals() to avoid SystemError ("bad argument to internal function"). Don't redefine the 'ret' variable in the if block. Add an unit test on PyEval_GetLocals().
* gh-122417: Implement per-thread heap type refcounts (#122418)Sam Gross2024-08-063-51/+231
| | | | | | | The free-threaded build partially stores heap type reference counts in distributed manner in per-thread arrays. This avoids reference count contention when creating or destroying instances. Co-authored-by: Ken Jin <kenjin@python.org>
* GH-120024: Move three more escaping calls out of conditional statements ↵Mark Shannon2024-08-063-10/+32
| | | | (GH-122734)
* GH-120024: Refactor code a bit so that escaping calls can be wrapped in ↵Mark Shannon2024-08-063-42/+78
| | | | spill code in code generator (GH-122693)
* gh-122595: Add more error checks in the compiler (GH-122596)Serhiy Storchaka2024-08-062-52/+145
|
* GH-122616: Simplify LOAD_ATTR_WITH_HINT and STORE_ATTR_WITH_HINT (GH-122620)Mark Shannon2024-08-053-95/+44
|
* gh-122313: Clean up deep recursion guarding code in the compiler (GH-122640)Serhiy Storchaka2024-08-033-162/+164
| | | | | | | | | Add ENTER_RECURSIVE and LEAVE_RECURSIVE macros in ast.c, ast_opt.c and symtable.c. Remove VISIT_QUIT macro in symtable.c. The current recursion depth counter only needs to be updated during normal execution -- all functions should just return an error code if an error occurs.
* GH-117224: Move the body of a few large-ish micro-ops into helper functions ↵Mark Shannon2024-08-024-335/+159
| | | | (GH-122601)
* gh-122445: populate only modified fields in __static_attributes__ (#122446)Irit Katriel2024-08-021-7/+11
|
* gh-122334: Fix crash when importing ssl after re-initialization (#122481)neonene2024-08-021-0/+13
| | | | * Fix crash when importing ssl after re-initialization
* gh-122188: Remove _imp.pyc_magic_number (GH-122503)Serhiy Storchaka2024-08-021-5/+1
| | | _imp.pyc_magic_number_token should be enough.
* gh-122562: Remove ste_free and ste_child_free from symtable (#122563)Jelle Zijlstra2024-08-011-12/+0
|
* GH-118095: Add tier two support for BINARY_SUBSCR_GETITEM (GH-120793)Mark Shannon2024-08-016-60/+150
|
* Replace PyObject_Del with PyObject_Free (#122453)Victor Stinner2024-08-011-1/+1
| | | | PyObject_Del() is just a alias to PyObject_Free() kept for backward compatibility. Use directly PyObject_Free() instead.
* GH-122155: Track local variables between pops and pushes in cases generator ↵Mark Shannon2024-08-014-48/+192
| | | | (GH-122286)
* Fix typos in docs, error messages and comments (#122502)jianghuyiyuan2024-08-011-1/+1
| | | Signed-off-by: jianghuyiyuan <shuangcui@live.com>
* gh-122188: Move magic number to its own file (#122243)Michael Droettboom2024-07-301-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-122188: Move magic number to its own file * Add versionadded directive * Do work in C * Integrate launcher.c * Make _pyc_magic_number private * Remove metadata * Move sys.implementation -> _imp * Modernize comment * Move _RAW_MAGIC_NUMBER to the C side as well * _pyc_magic_number -> pyc_magic_number * Remove unused import * Update docs * Apply suggestions from code review Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> * Fix typo in tests --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-117657: Avoid race in `PAUSE_ADAPTIVE_COUNTER` in free-threaded build ↵Sam Gross2024-07-301-1/+2
| | | | | | | (#122190) The adaptive counter doesn't do anything currently in the free-threaded build and TSan reports a data race due to concurrent modifications to the counter.
* GH-118093: Improve handling of short and mid-loop traces (GH-122252)Brandt Bucher2024-07-291-33/+31
|
* GH-116090: Fire RAISE events from _FOR_ITER_TIER_TWO (GH-122413)Brandt Bucher2024-07-294-12/+11
|
* gh-122234: Add DECREFs to error paths (#122406)Petr Viktorin2024-07-291-0/+4
| | | Co-Authored-By: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-122234: fix accuracy issues for sum() (#122236)Sergey B Kirpichev2024-07-291-11/+13
| | | | | | | | * Use compensated summation for complex sums with floating-point items. This amends #121176. * sum() specializations for floats and complexes now use PyLong_AsDouble() instead of PyLong_AsLongAndOverflow() and compensated summation as well.
* gh-119180: Add evaluate functions for type params and type aliases (#122212)Jelle Zijlstra2024-07-272-25/+19
|
* Manually override bytecode definition in optimizer, to avoid build error ↵Mark Shannon2024-07-262-4/+17
| | | | (GH-122316)