summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-94673: Add Per-Interpreter tp_subclasses for Static Builtin Types (gh-95301)Eric Snow2022-08-053-3/+4
|
* gh-94673: Recover Weaklist Lookup Performance (gh-95544)Eric Snow2022-08-041-0/+33
| | | gh-95302 seems to have introduced a small performance regression. Here we make some minor changes to recover that lost performance.
* gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)Ken Jin2022-08-041-0/+6
|
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-013-12/+38
| | | | (GH-95278)
* gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types (#95302)Eric Snow2022-07-293-1/+20
| | | | | | | | | | | | | | | * Store tp_weaklist on the interpreter state for static builtin types. * Factor out _PyStaticType_GET_WEAKREFS_LISTPTR(). * Add _PyStaticType_ClearWeakRefs(). * Add a comment about how _PyStaticType_ClearWeakRefs() loops. * Document the change. * Update Doc/whatsnew/3.12.rst * Fix a typo.
* GH-90081: Run python tracers at full speed (GH-95328)Mark Shannon2022-07-281-2/+3
|
* gh-95174: Add pthread stubs for WASI (GH-95234)Christian Heimes2022-07-272-0/+91
| | | Co-authored-by: Brett Cannon <brett@python.org>
* gh-95005: Replace PyAccu with PyUnicodeWriter (gh-95006)Aivars Kalvāns2022-07-271-39/+0
|
* gh-94673: Add Per-Interpreter Storage for Static Builtin Types (#95255)Eric Snow2022-07-263-1/+18
| | | | | | | | | | | | | | This is the last precursor to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types. Here we add per-type storage on PyInterpreterState, but only for the static builtin types. This involves the following: * add PyInterpreterState.types * move PyInterpreterState.type_cache to it * add a "num_builtins_initialized" field * add a "builtins" field (a static array big enough for all the static builtin types) * add _PyStaticType_GetState() to look up a static builtin type's state * (temporarily) add PyTypeObject.tp_static_builtin_index (to hold the type's index into PyInterpreterState.types.builtins) We will be eliminating tp_static_builtin_index in a later change.
* gh-91247: Use memcpy for list and tuple repeat (#91482)Pieter Eendebak2022-07-262-0/+23
| | | | | | | * Add _Py_memory_repeat function to pycore_list * Add _Py_RefcntAdd function to pycore_object * Use the new functions in tuplerepeat, list_repeat, and list_inplace_repeat
* GH-92678: Expose managed dict clear and visit functions (#95246)Mark Shannon2022-07-251-0/+3
|
* gh-94673: Add _PyStaticType_InitBuiltin() (#95152)Eric Snow2022-07-253-1/+12
| | | | | | | | | | | | This is the first of several precursors to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types. We do the following: * add `_PyStaticType_InitBuiltin()` * add `_Py_TPFLAGS_STATIC_BUILTIN` * set it on all static builtin types in `_PyStaticType_InitBuiltin()` * shuffle some code around to be able to use _PyStaticType_InitBuiltin() * rename `_PyStructSequence_InitType()` to `_PyStructSequence_InitBuiltinWithFlags()` * add `_PyStructSequence_InitBuiltin()`.
* GH-94851: check refcnt of immortal objects after finalization (GH-95001)Kumar Aditya2022-07-252-1/+4408
|
* gh-95185: Check recursion depth in the AST constructor (#95186)Pablo Galindo Salgado2022-07-241-0/+2
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121)Brandt Bucher2022-07-221-188/+0
|
* GH-94739: Mark stacks of exception handling blocks for setting ↵Mark Shannon2022-07-181-0/+13
| | | | frame.f_lineno in the debugger. (GH-94958)
* gh-94731: Revert to C-style casts for _Py_CAST (GH-94782)Petr Viktorin2022-07-141-51/+3
| | | Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* pycore_interp.h: Fix comment about pytypedefs.h (#93188)Itamar Ostricher2022-07-091-1/+1
| | | | GH-31527 moved this typedef to `Include/pytypedefs.h`, so this comment should point at the correct location
* GH-90699: Intern statically allocated strings (GH-93597)Kumar Aditya2022-07-081-0/+609
| | | This is similar to how strings are interned for deepfreeze.
* GH-90699: Move generated static initializer to pycore_runtime_generated.h ↵Kumar Aditya2022-07-072-1125/+1139
| | | | (GH-94051)
* gh-94216: add pseudo instructions to the dis/opcodes modules (GH-94241)Irit Katriel2022-07-012-9/+42
|
* GH-94262: Don't create frame objects for frames that aren't yet complete. ↵Mark Shannon2022-07-011-0/+17
| | | | (GH-94371)
* gh-90473: Reduce recursion limit on WASI even further (GH-94333)Christian Heimes2022-06-271-3/+4
| | | | 750 fails sometimes with newer wasmtime versions. 600 is a more conservative value.
* GH-94163: Add BINARY_SLICE and STORE_SLICE instructions. (GH-94168)Mark Shannon2022-06-273-83/+89
|
* gh-87347: Fix PyObject_NEW() regression (#94234)Victor Stinner2022-06-261-2/+2
| | | | | Don't add parenthesis around the type parameter. Add unit tests on PyObject_NEW() and similar functions.
* gh-93382: Sync up `co_code` changes with 3.11 (GH-94227)Ken Jin2022-06-241-1/+1
| | | Sync up co_code changes with 3.11 commit 852b4d4bcd12b0b6839a015a262ce976b134f6f3.
* GH-93841: Allow stats to be turned on and off, cleared and dumped at ↵Mark Shannon2022-06-212-13/+16
| | | | runtime. (GH-93843)
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-216-60/+104
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* gh-87347: Add parenthesis around macro arguments (#93915)Victor Stinner2022-06-2029-143/+147
| | | Add unit test on Py_MEMBER_SIZE() and some other macros.
* GH-93516: Speedup line number checks when tracing. (GH-93763)Mark Shannon2022-06-202-1/+32
| | | | * Use a lookup table to reduce overhead of getting line numbers during tracing.
* GH-93897: Store frame size in code object and de-opt if insufficient space ↵Mark Shannon2022-06-202-25/+29
| | | | on thread frame stack. (GH-93908)
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)Victor Stinner2022-06-193-13/+23
| | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed.
* gh-93911: Specialize `LOAD_ATTR_PROPERTY` (GH-93912)Ken Jin2022-06-173-39/+67
|
* gh-77782: Deprecate global configuration variable (#93943)Victor Stinner2022-06-173-22/+25
| | | | | | | Deprecate global configuration variable like Py_IgnoreEnvironmentFlag: the Py_InitializeFromConfig() API should be instead. Fix declaration of Py_GETENV(): use PyAPI_FUNC(), not PyAPI_DATA().
* gh-74953: Add _PyTime_FromMicrosecondsClamp() function (#93942)Victor Stinner2022-06-171-0/+4
|
* gh-87347: Add parenthesis around PyXXX_Check() arguments (#92815)Victor Stinner2022-06-1634-58/+58
|
* GH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430)Ken Jin2022-06-143-81/+72
|
* GH-93516: Store offset of first traceable instruction in code object (GH-93769)Mark Shannon2022-06-141-0/+1
|
* gh-91321: Fix compatibility with C++ older than C++11 (#93784)Victor Stinner2022-06-141-2/+5
| | | | | Fix the compatibility of the Python C API with C++ older than C++11. _Py_NULL is only defined as nullptr on C++11 and newer.
* gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742)Serhiy Storchaka2022-06-143-8/+3
| | | | | | It combines PyImport_ImportModule() and PyObject_GetAttrString() and saves 4-6 lines of code on every use. Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-139-92/+28
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid ↵Pablo Galindo Salgado2022-06-131-0/+2
| | | | UB (GH-93700)
* Remove ANY_VARARGS() macro from the C API (#93764)Victor Stinner2022-06-132-3/+3
| | | The macro was exposed by mistake.
* gh-89653: PEP 670: Convert PyFunction macros (#93765)Victor Stinner2022-06-131-16/+39
| | | Convert PyFunction macros to static inline functions.
* GH-90699: use statically allocated strings in typeobject.c (gh-93751)Kumar Aditya2022-06-122-0/+4
|
* gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar ↵Serhiy Storchaka2022-06-122-0/+2
| | | | | | | | | and TypeVarTuple parameters (alt) (GH-93412) For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
* Shrink the LOAD_METHOD cache by one codeunit. (#93537)Mark Shannon2022-06-072-2/+1
|
* gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500)Neil Schemenauer2022-06-051-0/+14
| | | | | | | | | | | | Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile. Without this, you get an error like: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’ The modern way to use a NULL value in C++ is to use nullptr. However, we want to not break extensions that do things the old way. Co-authored-by: serge-sans-paille
* gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383)Ken Jin2022-06-031-0/+1
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* gh-91320: Fix more old-style cast warnings in C++ (#93285)Victor Stinner2022-06-023-4/+4
| | | | Use _PyObject_CAST() in the public C API to fix C++ compiler warnings: "use of old-style cast" (clang -Wold-style-cast).