| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
collection (GH-126502)" (#126983)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
collection (GH-126502)
* Mark almost all reachable objects before doing collection phase
* Add stats for objects marked
* Visit new frames before each increment
* Remove lazy dict tracking
* Update docs
* Clearer calculation of work to do.
|
| |
|
|
|
| |
subclasses (GH-126264)
Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
|
| |
|
|
|
| |
(GH-124846)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
| |
|
|
| |
(#126369)
|
| |
|
|
|
|
|
|
|
| |
`BINARY_OP` (#123926)
Each thread specializes a thread-local copy of the bytecode, created on the first RESUME, in free-threaded builds. All copies of the bytecode for a code object are stored in the co_tlbc array on the code object. Threads reserve a globally unique index identifying its copy of the bytecode in all co_tlbc arrays at thread creation and release the index at thread destruction. The first entry in every co_tlbc array always points to the "main" copy of the bytecode that is stored at the end of the code object. This ensures that no bytecode is copied for programs that do not use threads.
Thread-local bytecode can be disabled at runtime by providing either -X tlbc=0 or PYTHON_TLBC=0. Disabling thread-local bytecode also disables specialization.
Concurrent modifications to the bytecode made by the specializing interpreter and instrumentation use atomics, with specialization taking care not to overwrite an instruction that was instrumented concurrently.
|
| | |
|
| |
|
|
|
|
|
|
| |
* Add LOAD_CONST_IMMORTAL opcode
* Add LOAD_SMALL_INT opcode
* Remove RETURN_CONST opcode
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix usage of PyStackRef_FromPyObjectSteal in CALL_TUPLE_1
This was missed in gh-124894
* Fix usage of PyStackRef_FromPyObjectSteal in _CALL_STR_1
This was missed in gh-124894
* Regenerate code
|
| |
|
| |
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
| |
|
|
| |
PyStackRefs. (GH-125439)
|
| |
|
|
| |
PyStackRef_CLOSEs (GH-125324)
|
| |
|
|
| |
(GH-125251)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
{globals, builtins} keys (gh-124953)
Each of the `LOAD_GLOBAL` specializations is implemented roughly as:
1. Load keys version.
2. Load cached keys version.
3. Deopt if (1) and (2) don't match.
4. Load keys.
5. Load cached index into keys.
6. Load object from (4) at offset from (5).
This is not thread-safe in free-threaded builds; the keys object may be replaced
in between steps (3) and (4).
This change refactors the specializations to avoid reloading the keys object and
instead pass the keys object from guards to be consumed by downstream uops.
|
| |
|
|
| |
NULL pointers. (GH-124894)
|
| |
|
|
|
|
|
| |
* Spill the evaluation around escaping calls in the generated interpreter and JIT.
* The code generator tracks live, cached values so they can be saved to memory when needed.
* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
|
| | |
|
| | |
|
| |
|
|
|
| |
(GH-124443)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
| |
Fix off-by-ones in conversion function
|
| |
|
|
|
|
| |
Use a `_PyStackRef` and defer the reference to `f_funcobj` when
possible. This avoids some reference count contention in the common case
of executing the same code object from multiple threads concurrently in
the free-threaded build.
|
| |
|
|
| |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Sam Gross <655866+colesbury@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
(#123924)
Use a `_PyStackRef` and defer the reference to `f_executable` when
possible. This avoids some reference count contention in the common case
of executing the same code object from multiple threads concurrently in
the free-threaded build.
|
| |
|
|
| |
that it is kept in memory for calls (GH-124003)
|
| |
|
|
| |
errors (GH-123546)
|
| |
|
|
| |
Use _Py_IsImmortalLoose() in bytesobject.c, typeobject.c
and ceval.c.
|
| |
|
|
| |
tier 2. (GH-123381)
|
| |
|
| |
Fix MSVC warning "conversion from '__int64' to 'int'"
|
| | |
|
| |
|
|
| |
(gh-123092)
|
| | |
|
| | |
|
| |
|
|
|
| |
* Convert CALL_ALLOC_AND_ENTER_INIT to micro-ops such that tier 2 supports it
* Allow inexact arguments for CALL_ALLOC_AND_ENTER_INIT.
|
| | |
|
| | |
|
| |
|
|
|
| |
* Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis
* Eliminate CHECK_EVAL_BREAKER macro
|
| |
|
|
| |
(GH-122843)
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
`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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
| |
`_PyDict_SetItem_Take2` steals both the key (i.e., `sub`) and the value.
|
| |
|
|
| |
(GH-122734)
|
| |
|
|
| |
spill code in code generator (GH-122693)
|
| | |
|
| |
|
|
| |
(GH-122601)
|
| | |
|
| |
|
|
| |
(GH-122286)
|
| | |
|
| | |
|