summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)hms2023-06-292-18/+19
| | | | | | This enables super-instruction formation, removal of checks for uninitialized variables, and frees up an instruction.
* gh-106168: PyTuple_SET_ITEM() now checks the index (#106164)Victor Stinner2023-06-284-9/+10
| | | | | | | | | | | | | PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument with an assertion if Python is built in debug mode or is built with assertions. * list_extend() and _PyList_AppendTakeRef() now set the list size before calling PyList_SET_ITEM(). * PyStructSequence_GetItem() and PyStructSequence_SetItem() now check the index argument: must be lesser than REAL_SIZE(op). * PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now aliases to PyStructSequence_GetItem() and PyStructSequence_SetItem().
* gh-106084: Remove _PyObject_CallMethod() function (#106159)Victor Stinner2023-06-272-82/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the following private functions from the public C API: * _Py_CheckFunctionResult() * _PyObject_CallMethod() * _PyObject_CallMethodId() * _PyObject_CallMethodIdNoArgs() * _PyObject_CallMethodIdObjArgs() * _PyObject_CallMethodIdOneArg() * _PyObject_MakeTpCall() * _PyObject_VectorcallMethodId() * _PyStack_AsDict() Move these functions to the internal C API (pycore_call.h). No longer export the following functions: * _PyObject_Call() * _PyObject_CallMethod() * _PyObject_CallMethodId() * _PyObject_CallMethodIdObjArgs() * _PyObject_Call_Prepend() * _PyObject_FastCallDictTstate() * _PyStack_AsDict() The following functions are still exported for stdlib shared extensions: * _Py_CheckFunctionResult() * _PyObject_MakeTpCall() Mark the following internal functions as extern: * _PyStack_UnpackDict() * _PyStack_UnpackDict_Free() * _PyStack_UnpackDict_FreeNoDecRef()
* gh-106149: move jump target resolution from optimizer to assembler (#106150)Irit Katriel2023-06-272-5/+5
|
* gh-106140: Reorder some more fields to facilitate out-of-process inspection ↵Pablo Galindo Salgado2023-06-271-7/+8
| | | | (#106148)
* gh-106140: Reorder some fields to facilitate out-of-process inspection (#106143)Pablo Galindo Salgado2023-06-272-41/+52
| | | Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-104584: Baby steps towards generating and executing traces (#105924)Guido van Rossum2023-06-273-0/+35
| | | | | Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose). All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
* gh-106084: Remove _PyObject_RealIsInstance() function (#106106)Victor Stinner2023-06-262-12/+11
| | | | | | | | | | | | | | | Remove the following functions from the public C API: * _PyObject_RealIsInstance() * _PyObject_RealIsSubclass() * _Py_add_one_to_index_F() * _Py_add_one_to_index_C() Move _PyObject_RealIsInstance() and _PyObject_RealIsSubclass() to the internal C API (pycore_abstract.h) and no longer export their symbols (in libpython). Make _Py_add_one_to_index_F() and _Py_add_one_to_index_C() functions static: no longer export them.
* gh-106084: Remove _PyObject_HasLen() function (#106103)Victor Stinner2023-06-262-20/+22
| | | | | | | | | Remove _PyObject_HasLen() and _PySequence_IterSearch() functions from the public C API: move them to the internal C API (pycore_abstract.h). No longer export these symbols (in libpython). Remove also unused pycore_initconfig.h include in typeobject.c.
* gh-105927: Deprecate PyWeakref_GetObject() function (#106006)Victor Stinner2023-06-262-2/+3
| | | Deprecate PyWeakref_GetObject() and PyWeakref_GET_OBJECT() functions.
* gh-106084: Remove _PySequence_BytesToCharpArray() function (#106088)Victor Stinner2023-06-261-4/+0
| | | | | Remove private _PySequence_BytesToCharpArray() and _Py_FreeCharPArray() functions from the public C API: move these functions from Objects/abstract.c to Modules/_posixsubprocess.c.
* gh-106084: Remove old PyObject call aliases (#106085)Victor Stinner2023-06-261-9/+0
| | | | | | | | | | | | | | Remove old aliases which were kept backwards compatibility with Python 3.8: * _PyObject_CallMethodNoArgs() * _PyObject_CallMethodOneArg() * _PyObject_CallOneArg() * _PyObject_FastCallDict() * _PyObject_Vectorcall() * _PyObject_VectorcallMethod() * _PyVectorcall_Function() Update code which used these aliases to use new names.
* gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)Victor Stinner2023-06-232-4/+4
| | | | | | Remove _PyWeakref_GetWeakrefCount() and _PyWeakref_ClearRef() from the public C API: move them to the internal C API. Refactor also _weakref_getweakrefs() code to make it more readable.
* gh-105927: Add _PyWeakref_IS_DEAD() function (#105992)Victor Stinner2023-06-221-0/+13
| | | | | | | | * Add _PyWeakref_IS_DEAD() internal function. * Modify is_dead_weakref() of Modules/_weakref.c and _pysqlite_drop_unused_cursor_references() to replace PyWeakref_GET_OBJECT() with _PyWeakref_IS_DEAD(). * Replace "int i" with "Py_ssize_t i" to iterate on cursors in _pysqlite_drop_unused_cursor_references().
* GH-91095: Specialize calls to normal Python classes. (GH-99331)Mark Shannon2023-06-225-76/+105
|
* gh-105927: finalize_modules_clear_weaklist() uses _PyWeakref_GET_REF() (#105971)Victor Stinner2023-06-211-1/+1
| | | | | finalize_modules_clear_weaklist() now holds a strong reference to the module longer than before: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: Add PyWeakref_GetRef() function (#105932)Victor Stinner2023-06-211-0/+1
| | | | Add tests on PyWeakref_NewRef(), PyWeakref_GetObject(), PyWeakref_GET_OBJECT() and PyWeakref_GetRef().
* gh-105927: Add _PyWeakref_GET_REF() internal function (#105929)Victor Stinner2023-06-201-0/+40
| | | Add new pycore_weakref.h internal header file.
* gh-105922: Add PyImport_AddModuleRef() function (#105923)Victor Stinner2023-06-201-0/+5
| | | | | | * Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and PyImport_AddModuleObject(). * pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with PyImport_AddModuleRef(name).
* gh-105481: generate _specializations and _specialized_instructions from ↵Irit Katriel2023-06-192-106/+106
| | | | bytecodes.c (#105913)
* gh-105481: remove HAS_ARG, HAS_CONST, IS_JUMP_OPCODE, IS_PSEUDO_OPCODE and ↵Irit Katriel2023-06-173-57/+1
| | | | replace by their new versions (#105865)
* gh-105481: add HAS_JUMP flag to opcode metadata (#105791)Irit Katriel2023-06-141-2/+2
|
* GH-77273: Better bytecodes for f-strings (GH-6132)Mark Shannon2023-06-142-67/+69
|
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-146-24/+23
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (#105638)Eddie Elizondo2023-06-141-3/+2
|
* gh-105387: Limited C API implements Py_INCREF() as func (#105388)Victor Stinner2023-06-141-8/+10
| | | | | In the limited C API version 3.12, Py_INCREF() and Py_DECREF() functions are now implemented as opaque function calls to hide implementation details.
* gh-104812: Run Pending Calls in any Thread (gh-104813)Eric Snow2023-06-134-27/+24
| | | For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
* gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)Eric Snow2023-06-131-3/+7
| | | We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-132-58/+59
| | | | (GH-105680)
* gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)Victor Stinner2023-06-091-2/+14
| | | | | | When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF() and Py_DECREF() of the limited C API 3.9 (and older) now call Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were added to Python 3.10.
* gh-105396: Deprecate PyImport_ImportModuleNoBlock() function (#105397)Victor Stinner2023-06-091-1/+1
| | | | Deprecate the PyImport_ImportModuleNoBlock() function which is just an alias to PyImport_ImportModule() since Python 3.3.
* gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)Eric Snow2023-06-082-3/+4
| | | The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
* gh-100227: Lock Around Adding Global Audit Hooks (gh-105515)Eric Snow2023-06-081-1/+4
| | | The risk of a race with this state is relatively low, but we play it safe anyway.
* gh-100227: Lock Around Use of the Global "atexit" State (gh-105514)Eric Snow2023-06-081-0/+1
| | | The risk of a race with this state is relatively low, but we play it safe anyway.
* Revert "Move observability-relevant structure fields to the top" (#105512)Pablo Galindo Salgado2023-06-083-63/+51
|
* GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)Mark Shannon2023-06-083-30/+23
| | | | * Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
* Move observability-relevant structure fields to the top (#105271)Gabriele N. Tornetta2023-06-083-51/+63
|
* gh-105268: Add _Py_FROM_GC() function to pycore_gc.h (#105362)Victor Stinner2023-06-062-9/+20
| | | | | | | | | | * gcmodule.c reuses _Py_AS_GC(op) for AS_GC() * Move gcmodule.c FROM_GC() implementation to a new _Py_FROM_GC() static inline function in pycore_gc.h. * _PyObject_IS_GC(): only get the type once * gc_is_finalized(à) and PyObject_GC_IsFinalized() use _PyGC_FINALIZED(), instead of _PyGCHead_FINALIZED(). * Remove _Py_CAST() in pycore_gc.h: this header file is not built with C++.
* gh-105268: Remove _PyGC_FINALIZED() macro (#105350)Victor Stinner2023-06-061-8/+0
| | | | | Remove the old private, undocumented and untested _PyGC_FINALIZED() macro which was kept for backward compatibility with Python 3.8 and older.
* gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)Victor Stinner2023-06-061-14/+8
| | | | | | | | | | | When Python is built in debug mode (if the Py_REF_DEBUG macro is defined), the Py_INCREF() and Py_DECREF() function are now always implemented as opaque functions to avoid leaking implementation details like the "_Py_RefTotal" variable or the _Py_DecRefTotal_DO_NOT_USE_THIS() function. * Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI. * Remove _Py_NegativeRefcount() from limited C API.
* GH-105229: Replace some superinstructions with single instruction ↵Mark Shannon2023-06-053-37/+34
| | | | equivalent. (GH-105230)
* GH-104584: Allow optimizers to opt out of optimizing. (GH-105244)Mark Shannon2023-06-051-1/+2
|
* gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)Eric Snow2023-06-023-15/+21
| | | The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
* gh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)Jelle Zijlstra2023-06-021-0/+6
|
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-028-2/+72
|
* gh-85275: Remove old buffer APIs (#105137)Inada Naoki2023-06-021-49/+0
| | | | | They are now abi-only. Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-104341: Call _PyEval_ReleaseLock() with NULL When Finalizing the Current ↵Eric Snow2023-06-011-1/+1
| | | | | | | Thread (gh-105109) This avoids the problematic race in drop_gil() by skipping the FORCE_SWITCHING code there for finalizing threads. (The idea for this approach came out of discussions with @markshannon.)
* gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)Irit Katriel2023-06-011-2/+1
|
* gh-105145: Deprecate Py_GetPath() function (#105179)Victor Stinner2023-06-012-7/+7
| | | | | | | | | | | | | | Deprecate old Python initialization functions: * PySys_ResetWarnOptions() * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() _tkinter.c uses sys.executable instead of Py_GetProgramName() and uses sys.prefix instead of Py_GetPrefix().
* gh-105182: Remove PyEval_AcquireLock() and PyEval_InitThreads() (#105183)Victor Stinner2023-06-011-8/+0
| | | | | | | | | | | | Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI. Mention "make regen-limited-abi" in "make regen-all".