| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(#32301)
This reverts commit 124227c95f310d2ecd4b567271ab1919fc7000cb.
|
|
|
| |
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
|
|
|
|
|
|
| |
(GH-32209)
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
|
|
|
|
|
|
|
|
|
|
| |
The fact interpreter frames were split out from full frame objects
rather than always being part of the eval loop implementation means
that it's tricky to infer the expected naming conventions simply
from looking at the code.
Documenting the de facto conventions in pycore_frame.h means future
readers of the code will have a clear explanation of the rationale
for those conventions (i.e. minimising non-functional code churn).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-32054)
Move the private _PyFrameEvalFunction type, and private
_PyInterpreterState_GetEvalFrameFunc() and
_PyInterpreterState_SetEvalFrameFunc() functions to the internal C
API. The _PyFrameEvalFunction callback function type now uses the
_PyInterpreterFrame type which is part of the internal C API.
Update the _PyFrameEvalFunction documentation.
|
|
|
|
|
| |
Move the private undocumented _PyEval_EvalFrameDefault() function to
the internal C API. The function now uses the _PyInterpreterFrame
type which is part of the internal C API.
|
| |
|
|
|
|
| |
(GH-32115)
|
|
|
|
|
|
|
|
| |
Add _PyCFunctionObject_CAST() and _PyCMethodObject_CAST() macros to
make macros casting their argument easier to read, but also to check
the type of their input in debug mode: assert(PyCFunction_Check(func)
and assert(PyCMethod_Check(func).
Reformat also PyCFunction_XXX() macros for readability.
|
|
|
| |
Use the macro in C files of the Python/ directory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject*
and PyUnicodeObject*: _PyASCIIObject_CAST(),
_PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using
these new macros make the code more readable and check their argument
with: assert(PyUnicode_Check(op)).
Remove redundant assert(PyUnicode_Check(op)) in macros using directly
or indirectly these new CAST macros.
Replacing existing casts with these macros.
|
| |
|
| |
|
|
|
| |
Use it where appropriate: the repeat functions of `array.array`, `bytes`, `bytearray`, and `str`.
|
|
|
|
| |
* add PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS
|
|
|
|
|
| |
* Don't deopt if refcounts are too big
* Detect more at specialization time
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-32055)
* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
(Contributed by Fabio Zadrozny)
* Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`.
* Document new `PyFrame_GetLocals` C-API function.
|
|
|
|
|
| |
In a gh-32003 comment, I realized it wasn't very clear how _Py_DECLARE_STR() should be used. This changes adds a comment to clarify.
https://bugs.python.org/issue46541
|
| |
|
|
|
| |
Also increases the stack allocation when run with `python_d.exe` to account for the extra stack checks that are added.
|
|
|
|
|
| |
* Remove the f_state field from _PyInterpreterFrame
* Make ownership of the frame explicit, replacing the is_generator field with an owner field.
|
| |
|
| |
|
|
|
| |
Use vectorcall, and replace `PyObject_SetAttrString` with `PyObject_SetAttr` and a global string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place.
* Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches
* _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms.
* _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches
* _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup
* _Py_Quicken is renamed to _PyCode_Quicken
* _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview).
* Do not emit unused nonzero opargs anymore in the compiler.
|
|
|
|
| |
Remove the private undocumented function _PyEval_CallTracing() from
the C API. Call the public sys.call_tracing() function instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the private undocumented function
_PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the
public sys.get_coroutine_origin_tracking_depth() function instead.
Change the internal function
_PyEval_SetCoroutineOriginTrackingDepth():
* Remove the 'tstate' parameter;
* Add return value and raises an exception if depth is negative;
* No longer export the function: call the public
sys.set_coroutine_origin_tracking_depth() function instead.
Uniformize also function declarations in pycore_ceval.h.
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the following private undocumented functions from the C API:
* _PyEval_GetAsyncGenFirstiter()
* _PyEval_GetAsyncGenFinalizer()
* _PyEval_SetAsyncGenFirstiter()
* _PyEval_SetAsyncGenFinalizer()
Call the public sys.get_asyncgen_hooks() and sys.set_asyncgen_hooks()
functions instead.
|
|
|
|
| |
Remove private empty _PyFrame_Fini() and _PyFrame_DebugMallocStats()
functions.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new functions to pack and unpack C double (serialize and
deserialize):
* PyFloat_Pack2(), PyFloat_Pack4(), PyFloat_Pack8()
* PyFloat_Unpack2(), PyFloat_Unpack4(), PyFloat_Unpack8()
Document these functions and add unit tests.
Rename private functions and move them from the internal C API
to the public C API:
* _PyFloat_Pack2() => PyFloat_Pack2()
* _PyFloat_Pack4() => PyFloat_Pack4()
* _PyFloat_Pack8() => PyFloat_Pack8()
* _PyFloat_Unpack2() => PyFloat_Unpack2()
* _PyFloat_Unpack4() => PyFloat_Unpack4()
* _PyFloat_Unpack8() => PyFloat_Unpack8()
Replace the "unsigned char*" type with "char*" which is more common
and easy to use.
|
|
|
|
|
|
| |
Add methods __typing_subst__() in TypeVar and ParamSpec.
Simplify code by using more object-oriented approach, especially
the C code for types.GenericAlias and the Python code for
collections.abc.Callable.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Replace "struct xxx" with "xxx" types in the internal C API.
|
|
|
| |
Move the type definition to pytypedefs.h.
|
|
|
|
|
|
| |
Move _PyBytes_Find() and _PyBytes_ReverseFind() functions to the
internal C API.
bytesobject.c now includes pycore_bytesobject.h.
|
|
|
| |
Speed up mmap.find(). Add _PyBytes_Find() and _PyBytes_ReverseFind().
|
| |
|