cpython/Lib/test/test_capi
mpage 2e95c5ba3b
gh-115999: Implement thread-local bytecode and enable specialization for 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.
2024-11-04 11:13:32 -08:00
..
__init__.py gh-116303: Skip test module dependent tests if test modules are unavailable (#117341) 2024-04-03 15:11:36 +02:00
__main__.py
check_config.py gh-120417: Add #noqa: F401 to tests (#120627) 2024-06-18 15:51:47 +00:00
test_abstract.py gh-111495: Add tests for PyNumber C API (#111996) 2024-08-26 15:59:22 +02:00
test_bytearray.py gh-116417: Move 4 limited C API test files to _testlimitedcapi (#116571) 2024-03-11 10:28:16 +00:00
test_bytes.py gh-121645: Add PyBytes_Join() function (#121646) 2024-08-30 12:57:33 +00:00
test_codecs.py gh-111495: improve test coverage of codecs C API (GH-126030) 2024-11-01 13:28:18 +00:00
test_complex.py gh-119771: Set errno on overflows in _Py_c_pow() (#120256) 2024-09-18 10:39:11 +02:00
test_config.py gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP (#123926) 2024-11-04 11:13:32 -08:00
test_dict.py gh-115142: Skip `test_capi.test_dict.py if _testcapi and _testlimitedcapi` are not available (GH-117588) 2024-04-10 16:32:57 +02:00
test_eval.py gh-111495: Add more tests on PyEval C APIs (#122789) 2024-08-08 14:16:20 +02:00
test_eval_code_ex.py gh-117694: Improve tests for PyEval_EvalCodeEx() (GH-117695) 2024-04-15 12:44:54 +03:00
test_exceptions.py Fix typos in comments (#123201) 2024-08-21 12:49:23 +00:00
test_float.py gh-116417: Move limited C API abstract.c tests to _testlimitedcapi (#116986) 2024-03-19 10:44:13 +00:00
test_getargs.py gh-121039: add Floats/ComplexesAreIdenticalMixin to test.support.testcase (GH-121071) 2024-09-08 16:01:54 +03:00
test_hash.py gh-122854: Add Py_HashBuffer() function (#122855) 2024-08-30 15:42:27 +00:00
test_immortal.py gh-84436: Add integration C API tests for immortal objects (gh-103962) 2023-05-03 00:05:30 +09:00
test_list.py gh-111495: Add tests for PyTuple C API (#118757) 2024-08-26 11:57:52 +02:00
test_long.py gh-121485: Always use 64-bit integers for integers bits count (GH-121486) 2024-08-30 08:13:24 +03:00
test_mem.py Fix incorrect usage of `support.requires_gil_enabled` (#118170) 2024-04-25 11:11:59 -04:00
test_misc.py gh-125900: Clean-up logic around immortalization in free-threading (#125901) 2024-10-24 18:09:59 -04:00
test_number.py gh-111495: Remove test_capi test_rshift_print() (#123338) 2024-08-26 14:39:32 +00:00
test_object.py gh-118789: Add PyUnstable_Object_ClearWeakRefsNoCallbacks (#118807) 2024-06-18 09:57:23 -04:00
test_opt.py gh-115999: Implement thread-local bytecode and enable specialization for BINARY_OP (#123926) 2024-11-04 11:13:32 -08:00
test_pyatomic.py gh-108337: Add pyatomic.h header (#108701) 2023-08-31 21:41:18 +00:00
test_run.py gh-116180: Check the globals argument in PyRun_* C API (GH-116637) 2024-05-02 16:43:03 +03:00
test_set.py gh-111495: Add tests for PyTuple C API (#118757) 2024-08-26 11:57:52 +02:00
test_structmembers.py gh-120417: Remove unused imports in tests (part 1) (#120629) 2024-06-17 21:05:56 +02:00
test_sys.py gh-116417: Move 4 limited C API test files to _testlimitedcapi (#116571) 2024-03-11 10:28:16 +00:00
test_time.py gh-111495: Add tests for PyTuple C API (#118757) 2024-08-26 11:57:52 +02:00
test_tuple.py gh-111495: Add tests for PyTuple C API (#118757) 2024-08-26 11:57:52 +02:00
test_type.py gh-121654: Add PyType_Freeze() function (#122457) 2024-10-25 11:12:48 +02:00
test_unicode.py gh-124502: Add PyUnicode_Equal() function (#124504) 2024-10-07 21:24:53 +00:00
test_watchers.py gh-125900: Clean-up logic around immortalization in free-threading (#125901) 2024-10-24 18:09:59 -04:00