summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-107211: No longer export internal functions (7) (#108425)Victor Stinner2023-08-248-42/+65
| | | | | | | | | No longer export _PyUnicode_FromId() internal C API function. Change comment style to "// comment" and add comment explaining why other functions have to be exported. Update Tools/build/generate_token.py to update Include/internal/pycore_token.h comments.
* gh-108308: Remove _PyDict_GetItemStringWithError() function (#108426)Victor Stinner2023-08-241-1/+0
| | | | | | | | Remove the internal _PyDict_GetItemStringWithError() function. It can now be replaced with the new public PyDict_ContainsString() and PyDict_GetItemStringRef() functions. getargs.c now now uses a strong reference for current_arg. find_keyword() returns a strong reference.
* gh-107211: No longer export internal functions (6) (#108424)Victor Stinner2023-08-248-43/+45
| | | | | | | | | | | | No longer export these 5 internal C API functions: * _PyArena_AddPyObject() * _PyArena_Free() * _PyArena_Malloc() * _PyArena_New() * _Py_FatalRefcountErrorFunc() Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-107211: No longer export PyTime internal functions (#108422)Victor Stinner2023-08-241-118/+146
| | | | | | | | | No longer export these 2 internal C API functions: * _PyTime_AsNanoseconds() * _PyTime_GetSystemClockWithInfo() Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-108314: Add PyDict_ContainsString() function (#108323)Victor Stinner2023-08-241-0/+1
|
* gh-108240: Add _PyCapsule_SetTraverse() internal function (#108339)Victor Stinner2023-08-231-0/+4
| | | | | The _socket extension uses _PyCapsule_SetTraverse() to visit and clear the socket type in the garbage collector. So the _socket.socket type can be cleared in some corner cases when it wasn't possible before.
* gh-105481: remove regen-opcode. Generated _PyOpcode_Caches in regen-cases. ↵Irit Katriel2023-08-233-42/+21
| | | | (#108367)
* gh-108113: Make it possible to optimize an AST (#108282)Irit Katriel2023-08-231-0/+8
|
* gh-106320: Remove _PyDict_GetItemStringWithError() function (#108313)Victor Stinner2023-08-222-1/+1
| | | | | | | | | Remove private _PyDict_GetItemStringWithError() function of the public C API: the new PyDict_GetItemStringRef() can be used instead. * Move private _PyDict_GetItemStringWithError() to the internal C API. * _testcapi get_code_extra_index() uses PyDict_GetItemStringRef(). Avoid using private functions in _testcapi which tests the public C API.
* Define _Py_NULL as nullptr on C23 and newer (#108244)Victor Stinner2023-08-221-3/+4
| | | | C23 standard added nullptr constant: https://en.wikipedia.org/wiki/C23_(C_standard_revision)
* gh-107211: No longer export pycore_strhex.h functions (#108229)Victor Stinner2023-08-211-2/+5
| | | | | | No longer export functions: * _Py_strhex_bytes() * _Py_strhex_with_sep()
* gh-108216: Cleanup #include in internal header files (#108228)Victor Stinner2023-08-2127-69/+68
| | | | | | | | | | | * Add missing includes. * Remove unused includes. * Update old include/symbol names to newer names. * Mention at least one included symbol. * Sort includes. * Update Tools/cases_generator/generate_cases.py used to generated pycore_opcode_metadata.h. * Update Parser/asdl_c.py used to generate pycore_ast.h. * Cleanup also includes in _testcapimodule.c and _testinternalcapi.c.
* gh-108220: Internal header files require Py_BUILD_CORE to be defined (#108221)Victor Stinner2023-08-2111-4/+42
| | | | | | | | | * pycore_intrinsics.h does nothing if included twice (add #ifndef and #define). * Update Tools/cases_generator/generate_cases.py to generate the Py_BUILD_CORE test. * _bz2, _lzma, _opcode and zlib extensions now define the Py_BUILD_CORE_MODULE macro to use internal headers (pycore_code.h, pycore_intrinsics.h and pycore_blocks_output_buffer.h).
* gh-108113: Make it possible to create an optimized AST (#108154)Irit Katriel2023-08-211-1/+2
|
* gh-95065, gh-107704: Argument Clinic: support multiple '/ [from ...]' and '* ↵Serhiy Storchaka2023-08-214-0/+18
| | | | [from ...]' markers (GH-108132)
* gh-108014: Add Py_IsFinalizing() function (#108032)Victor Stinner2023-08-182-1/+2
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-107944: Improve error message for function calls with bad keyword ↵Pablo Galindo Salgado2023-08-171-1/+1
| | | | arguments (#107969)
* gh-106581: Project through calls (#108067)Guido van Rossum2023-08-173-39/+58
| | | | This finishes the work begun in gh-107760. When, while projecting a superblock, we encounter a call to a short, simple function, the superblock will now enter the function using `_PUSH_FRAME`, continue through it, and leave it using `_POP_FRAME`, and then continue through the original code. Multiple frame pushes and pops are even possible. It is also possible to stop appending to the superblock in the middle of a called function, when running out of space or encountering an unsupported bytecode.
* gh-105481: opcode.h is no longer generated during the build (#108080)Irit Katriel2023-08-171-2/+1
|
* GH-108035: Remove the `_PyCFrame` struct as it is no longer needed for ↵Mark Shannon2023-08-174-30/+5
| | | | performance. (GH-108036)
* gh-106581: Split `CALL_PY_EXACT_ARGS` into uops (#107760)Guido van Rossum2023-08-161-4/+43
| | | | | | | | | | | | * Split `CALL_PY_EXACT_ARGS` into uops This is only the first step for doing `CALL` in Tier 2. The next step involves tracing into the called code object and back. After that we'll have to do the remaining `CALL` specialization. Finally we'll have to deal with `KW_NAMES`. Note: this moves setting `frame->return_offset` directly in front of `DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
* gh-105481: generate op IDs from bytecode.c instead of hard coding them in ↵Irit Katriel2023-08-163-757/+709
| | | | opcode.py (#107971)
* gh-107211: Fix select extension build on Solaris (#108012)Victor Stinner2023-08-161-2/+4
| | | | Export the internal _Py_open() and _Py_write() functions for Solaris: the select shared extension uses them.
* gh-107955 Remove old comment about increasing the reference count in usage ↵brandonardenwalli2023-08-161-2/+0
| | | | of Py_None (#107993)
* gh-107557: Setup abstract interpretation (#107847)Ken Jin2023-08-154-2/+164
| | | | Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
* gh-106242: Fix path truncation in os.path.normpath (GH-106816)Finn Womack2023-08-151-0/+1
|
* gh-105481: reduce repetition in opcode metadata generation code (#107942)Irit Katriel2023-08-141-14/+15
|
* gh-91051: fix segfault when using all 8 type watchers (#107853)Carl Meyer2023-08-111-1/+1
|
* gh-105481: split opcode_ids.h out of opcode.h so that it can be generated ↵Irit Katriel2023-08-112-220/+236
| | | | separately (#107866)
* gh-84805: Autogenerate signature for METH_NOARGS and METH_O extension ↵Serhiy Storchaka2023-08-111-1/+1
| | | | functions (GH-107794)
* GH-106485: Handle dict subclasses correctly when dematerializing `__dict__` ↵Mark Shannon2023-08-104-1/+4
| | | | (GH-107837)
* gh-106149: move CFG and basicblock definitions into flowgraph.c, use them as ↵Irit Katriel2023-08-102-74/+17
| | | | opaque types in compile.c (#107639)
* GH-106485: Dematerialize instance dictionaries when possible (GH-106539)Brandt Bucher2023-08-092-0/+5
|
* GH-105848: Simplify the arrangement of CALL's stack (GH-107788)Brandt Bucher2023-08-091-9/+9
|
* GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)Mark Shannon2023-08-091-4/+0
|
* GH-107596: Specialize str[int] (GH-107597)Brandt Bucher2023-08-083-69/+76
|
* gh-107630: Initialize Each Interpreter's refchain Properly (gh-107733)Eric Snow2023-08-071-0/+1
| | | This finishes fixing the crashes in Py_TRACE_REFS builds. We missed this part in gh-107567.
* gh-106608: make uop trace variable length (#107531)Ivin Lee2023-08-052-2/+2
| | | Executors are now more like tuples.
* GH-84436: Skip refcounting for known immortals (GH-107605)Brandt Bucher2023-08-041-3/+3
|
* gh-106812: Refactor cases_generator to allow uops with array stack effects ↵Guido van Rossum2023-08-041-4/+15
| | | | | (#107564) Introducing a new file, stacking.py, that takes over several responsibilities related to symbolic evaluation of push/pop operations, with more generality.
* Add some GC stats to Py_STATS (GH-107581)Mark Shannon2023-08-042-0/+11
|
* GH-107263: Increase C stack limit for most functions, except ↵Mark Shannon2023-08-041-1/+2
| | | | | | `_PyEval_EvalFrameDefault()` (GH-107535) * Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
* gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)Eric Snow2023-08-033-6/+22
| | | The linked list of objects was a global variable, which broke isolation between interpreters, causing crashes. To solve this, we've moved the linked list to each interpreter.
* gh-105481: simplify definition of pseudo ops in Lib/opcode.py (#107561)Irit Katriel2023-08-021-2/+0
|
* gh-105481: the ENABLE_SPECIALIZATION flag does not need to be generated by ↵Irit Katriel2023-08-012-2/+2
| | | | the build script, or exposed in opcode.py (#107534)
* GH-104909: Move unused cache entries from uops to macros (#107444)Guido van Rossum2023-07-311-26/+24
| | | | | | There's no need to use a dummy uop to skip unused cache entries. The macro syntax lets you write `unused/1` instead. Similarly, move `unused/5` from op `_LOAD_ATTR_INSTANCE_VALUE` to macro `LOAD_ATTR_INSTANCE_VALUE`.
* gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974)Eric Snow2023-07-283-17/+4
| | | | | | | This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules. The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL. It turns out it's tricky to use the same thread state for different threads. Who could have guessed? We solve the problem by eliminating the one object we were still sharing between interpreters. We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter. We also remove the accommodations for "detached" thread states, which were a dubious idea to start with.
* GH-104580: Put `eval_breaker` back at the start of the interpreter state. ↵Mark Shannon2023-07-282-3/+8
| | | | (GH-107383)
* gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359)Eric Snow2023-07-276-31/+33
| | | The _xxsubinterpreters module should not rely on internal API. Some of the functions it uses were recently moved there however. Here we move them back (and expose them properly).
* gh-106931: Intern Statically Allocated Strings Globally (gh-107272)Eric Snow2023-07-275-1/+12
| | | | | We tried this before with a dict and for all interned strings. That ran into problems due to interpreter isolation. However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning. Here we circle back to using a global cache, but only for statically allocated strings. We also use a more-basic _Py_hashtable_t for that global cache instead of a dict. Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter. Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.