summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-106320: Remove private _PyLong converter functions (#108499)Victor Stinner2023-08-262-4/+7
| | | | | | | | | | | Move these private functions to the internal C API (pycore_long.h): * _PyLong_UnsignedInt_Converter() * _PyLong_UnsignedLongLong_Converter() * _PyLong_UnsignedLong_Converter() * _PyLong_UnsignedShort_Converter() Argument Clinic now emits #include "pycore_long.h" when these functions are used.
* gh-107901: add the HAS_EVAL_BREAK instruction flag (#108375)Irit Katriel2023-08-251-17/+19
|
* gh-108444: Remove _PyLong_AsInt() function (#108461)Victor Stinner2023-08-251-3/+0
| | | | * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Remove _PyLong_AsInt() alias to PyLong_AsInt().
* gh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)Guido van Rossum2023-08-251-14/+27
| | | Instead of using `GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS)` we just add the macro elements of the latter to the macro for the former. This requires lengthening the uops array in struct opcode_macro_expansion. (It also required changes to stacking.py that were merged already.)
* gh-106320: Remove private _PyTraceback functions (#108453)Victor Stinner2023-08-242-3/+6
| | | | | | Move private functions to the internal C API (pycore_traceback.h): * _Py_DisplaySourceLine() * _PyTraceback_Add()
* gh-108444: Add PyLong_AsInt() public function (#108445)Victor Stinner2023-08-242-1/+8
| | | | | | * Rename _PyLong_AsInt() to PyLong_AsInt(). * Add documentation. * Add test. * For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
* gh-106320: Remove private _PySys functions (#108452)Victor Stinner2023-08-243-6/+7
| | | | | | | | | | Move private functions to the internal C API (pycore_sysmodule.h): * _PySys_GetAttr() * _PySys_GetSizeOf() No longer export most of these functions. Fix also a typo in Include/cpython/optimizer.h: add a missing space.
* gh-106320: Remove private _PyDict functions (#108449)Victor Stinner2023-08-242-32/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Move private functions to the internal C API (pycore_dict.h): * _PyDictView_Intersect() * _PyDictView_New() * _PyDict_ContainsId() * _PyDict_DelItemId() * _PyDict_DelItem_KnownHash() * _PyDict_GetItemIdWithError() * _PyDict_GetItem_KnownHash() * _PyDict_HasSplitTable() * _PyDict_NewPresized() * _PyDict_Next() * _PyDict_Pop() * _PyDict_SetItemId() * _PyDict_SetItem_KnownHash() * _PyDict_SizeOf() No longer export most of these functions. Move also the _PyDictViewObject structure to the internal C API. Move dict_getitem_knownhash() function from _testcapi to the _testinternalcapi extension. Update test_capi.test_dict for this change.
* gh-106320: Remove private _PyList functions (#108451)Victor Stinner2023-08-242-4/+3
| | | | | | | | Move private functions to the internal C API (pycore_list.h): * _PyList_Extend() * _PyList_DebugMallocStats() No longer export these functions.
* gh-106320: Remove private _PyEval function (#108433)Victor Stinner2023-08-242-10/+17
| | | | | | | | | | | | | | Move private _PyEval functions to the internal C API (pycore_ceval.h): * _PyEval_GetBuiltin() * _PyEval_GetBuiltinId() * _PyEval_GetSwitchInterval() * _PyEval_MakePendingCalls() * _PyEval_SetProfile() * _PyEval_SetSwitchInterval() * _PyEval_SetTrace() No longer export most of these functions.
* gh-107211: Fix test_peg_generator (#108435)Victor Stinner2023-08-241-45/+47
| | | | | | | | Export these internal functions for test_peg_generator * _PyArena_AddPyObject() * _PyArena_Free() * _PyArena_Malloc() * _PyArena_New()
* gh-106320: Remove private _PyContext_NewHamtForTests() (#108434)Victor Stinner2023-08-242-4/+5
| | | Move the function to the internal C API.
* gh-106320: Remove private float C API functions (#108430)Victor Stinner2023-08-242-9/+7
| | | | | | | | | | 106320: Remove private float C API functions Remove private C API functions: * _Py_parse_inf_or_nan() * _Py_string_to_number_with_underscores() Move these functions to the internal C API and no longer export them.
* gh-106320: Remove private _PyManagedBuffer_Type (#108431)Victor Stinner2023-08-242-2/+2
| | | | Remove private _PyManagedBuffer_Type variable. Move it to the internal C API and no longer export it.
* gh-106320: Remove private PyLong C API functions (#108429)Victor Stinner2023-08-242-72/+82
| | | | | | | | | | | | | | | | Remove private PyLong C API functions: * _PyLong_AsByteArray() * _PyLong_DivmodNear() * _PyLong_Format() * _PyLong_Frexp() * _PyLong_FromByteArray() * _PyLong_FromBytes() * _PyLong_GCD() * _PyLong_Lshift() * _PyLong_Rshift() Move these functions to the internal C API. No longer export _PyLong_FromBytes() function.
* gh-107211: No longer export internal functions (5) (#108423)Victor Stinner2023-08-2410-39/+73
| | | | | | No longer export _PyCompile_AstOptimize() internal C API function. Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* 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
|