summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-112716: Fix SystemError when __builtins__ is not a dict ↵Serhiy Storchaka2023-12-141-9/+5
| | | | | | | | | (GH-112770) (GH-113105) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc. (cherry picked from commit 1161c14e8c68296fc465cd48970b32be9bee012e)
* [3.11] gh-109216: Fix possible memory leak in `BUILD_MAP` (#109323)Nikita Sobolev2023-10-121-2/+3
| | | | | | | | | | | | | * [3.11] gh-109216: Fix possible memory leak in `BUILD_MAP` * Add NEWS * Update Python/ceval.c Co-authored-by: Kumar Aditya <kumaraditya@python.org> --------- Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* [3.11] gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` ↵Miss Islington (bot)2023-10-081-3/+11
| | | | | | | | (GH-110238) (#110512) gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (GH-110238) (cherry picked from commit dd9d781da30aa3740e54c063a40413c542d78c25) Co-authored-by: denballakh <47365157+denballakh@users.noreply.github.com>
* [3.11] gh-104690: thread_run() checks for tstate dangling pointer (#109056) ↵Victor Stinner2023-09-081-20/+6
| | | | | | | | | | | | | | (#109134) gh-104690: thread_run() checks for tstate dangling pointer (#109056) thread_run() of _threadmodule.c now calls _PyThreadState_CheckConsistency() to check if tstate is a dangling pointer when Python is built in debug mode. Rename ceval_gil.c is_tstate_valid() to _PyThreadState_CheckConsistency() to reuse it in _threadmodule.c. (cherry picked from commit f63d37877ad166041489a968233b57540f8456e8)
* [3.11] GH-104405: Add missing PEP 523 checks (GH-104441)Brandt Bucher2023-05-121-0/+1
|
* [3.11] gh-101975: Fixed a potential SegFault on garbage collection ↵Mark Shannon2023-03-201-0/+1
| | | | | (GH-102803) (GH-102807) Authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
* [3.11] gh-101967: add a missing error check (GH-101968) (#102015)Miss Islington (bot)2023-02-211-1/+3
| | | | | | | gh-101967: add a missing error check (GH-101968) (cherry picked from commit 89413bbccb9261b72190e275eefe4b0d49671477) Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* [3.11] gh-101072: support default and kw default in PyEval_EvalCodeEx for ↵Łukasz Langa2023-02-071-4/+0
| | | | | | 3.11+ (GH-101127) (#101636) Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Matthieu Dartiailh <m.dartiailh@gmail.com>
* [3.11] GH-99729: Unlink frames before clearing them (#100047)Brandt Bucher2022-12-061-10/+8
|
* [3.11] GH-99460: Emscripten trampolines on optimized METH_O and METH_NOARGS ↵Hood Chatham2022-11-161-3/+3
| | | | | code paths (gh-99461) (#99514) Manual backport of GH-99461.
* [3.11] GH-99298: Don't perform jumps before error handling (GH-99343)Brandt Bucher2022-11-111-3/+11
|
* [3.11] GH-93354: Fix PRECALL's adaptive backoff (GH-98011)Brandt Bucher2022-10-121-2/+2
|
* GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97018)Miss Islington (bot)2022-09-221-3/+6
| | | | | (cherry picked from commit 8fd2c3b75b90c4ee391894aa5094615bbdb6242f) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* Remove a stray DISPATCH() (GH-97004)Brandt Bucher2022-09-221-1/+0
|
* GH-96864: Check for error between line and opcode events (GH-96880)Miss Islington (bot)2022-09-201-1/+1
| | | | | (cherry picked from commit c10e33ac119d96c4d88d5ae8b59e65a76ae0ad3c) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* GH-96754: Check whether the interpreter frame is complete before creating ↵Miss Islington (bot)2022-09-131-3/+5
| | | | | | | | | frame object. (GH-96776) (#96787) (cherry picked from commit 12c5f328d2479ac3432df5e266adc4e59adeabfe) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* GH-96678: Fix undefined behavior in ceval.c (GH-96708)Miss Islington (bot)2022-09-101-1/+7
| | | | | (cherry picked from commit 50a70a083d34305a52fac4f5901bff2ead152d68) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643) (#96688)Mark Shannon2022-09-091-59/+57
| | | | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit aa3b4cf779b3dddb84e094879b91703354910d8c)
* GH-96572: fix use after free in trace refs build mode (GH-96618)Miss Islington (bot)2022-09-061-1/+1
| | | | | (cherry picked from commit 67444902a0f10419a557d0a2d3b8675c31b075a9) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-90081: Run python tracers at full speed (GH-95328) (#95363)Miss Islington (bot)2022-07-291-4/+7
| | | | | | | (cherry picked from commit b8b2990fb3218cffedfe7bc92e9e7ae2275b3c98) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] GH-94739: Backport GH-94958 to 3.11 (#94965)Mark Shannon2022-07-251-14/+0
|
* [3.11] GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121) ↵Brandt Bucher2022-07-221-0/+8
| | | | | (GH-95143) (cherry picked from commit e402b26b7fb953a2f0c17a0044bb6d6cbd726e54)
* [3.11] GH-93252: Fix error handling for failed Python calls (GH-94693) ↵Kumar Aditya2022-07-091-1/+5
| | | | | (GH-94708) Automerge-Triggered-By: GH:tiran
* [3.11] gh-94215: Fix error handling for line-tracing events (GH-94681) ↵Christian Heimes2022-07-081-5/+14
| | | | | | | | | | (GH-94688) * Re-enable crasher * Fix error handling for line-tracing events * blurb add (cherry picked from commit 23ee4a8067506e6c9c47748185653617413f7a60) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] gh-94510: Raise on re-entrant calls to sys.setprofile and ↵Łukasz Langa2022-07-051-2/+24
| | | | | | | | sys.settrace (GH-94511) (GH-94578) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 40d81fd63b46cf998880ce3bf3e5cb42bc3199c1)
* [3.11] GH-93354: Use exponential backoff to avoid excessive specialization ↵Mark Shannon2022-06-301-21/+25
| | | | | | attempts (GH-93355) (GH-93379) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-91719: Reload opcode on unknown error so that C can optimize the ↵Miss Islington (bot)2022-06-301-0/+3
| | | | | | | dispatching in ceval.c (GH-94364) (#94453) (cherry picked from commit ea39b77de9fa25b447d0b4148f75f351076e890a) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* [3.11] GH-93516: Drop broken assert, fixes GH-93769 (GH-94411)Christian Heimes2022-06-291-4/+0
|
* [3.11] GH-93516: Backport GH-93769 (GH-94231)Mark Shannon2022-06-281-52/+41
| | | * Store offset of first traceable instruction to avoid having to recompute it all the time when tracing.
* [3.11] GH-93516: Backport GH-93769: Speedup line number checks when tracing ↵Mark Shannon2022-06-221-7/+9
| | | | | (GH-94127) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)Victor Stinner2022-06-201-1/+0
| | | | | | | | | | | | | | | | | | 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. (cherry picked from commit 27b989403356ccdd47545a93aeab8434e9c69f21)
* [3.11] bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185) ↵Eric Snow2022-05-281-55/+0
| | | | | | | | | | | | | (GH-93306) (cherry picked from commit caa279d6fd5f151e57f891cd4f6ba51b532501c6) This was added for bpo-40514 (gh-84694) to test out a per-interpreter GIL. However, it has since proven unnecessary to keep the experiment in the repo. (It can be done as a branch in a fork like normal.) So here we are removing: * the configure option * the macro * the code enabled by the macro Automerge-Triggered-By: GH:ericsnowcurrently
* gh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (GH-93199)Miss Islington (bot)2022-05-251-1/+3
| | | | | | | | | | | Fix __lltrace__ debug feature if the stdout encoding is not UTF-8. If the stdout encoding is not UTF-8, the first call to lltrace_resume_frame() indirectly sets lltrace to 0 when calling unicode_check_encoding_errors() which calls encodings.search_function(). (cherry picked from commit 5695c0e0a25da58dfc1d22fc1cd68c2fda0a320d) Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-92236: Remove spurious "line" event when starting coroutine or generator. ↵Miss Islington (bot)2022-05-131-0/+6
| | | | | | (GH-92722) (GH-92772) (cherry picked from commit 22a1db378c5c381272362c5b2f68ac78a368e136)
* Update outdated `LOAD_METHOD` comments in `Python/ceval.c` (GH-92641)Miss Islington (bot)2022-05-121-2/+2
| | | | | (cherry picked from commit bdf99691972c4e452a86eb3ca7ff7ae748d881a6) Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
* GH-92239: Make sure that PEP 523 is supported, even when specializing first. ↵Mark Shannon2022-05-041-0/+2
| | | | (GH-92245)
* Use static inline function Py_EnterRecursiveCall() (#91988)Victor Stinner2022-05-041-15/+15
| | | | | | | | | | | | | | | | Currently, calling Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() may use a function call or a static inline function call, depending if the internal pycore_ceval.h header file is included or not. Use a different name for the static inline function to ensure that the static inline function is always used in Python internals for best performance. Similar approach than PyThreadState_GET() (function call) and _PyThreadState_GET() (static inline function). * Rename _Py_EnterRecursiveCall() to _Py_EnterRecursiveCallTstate() * Rename _Py_LeaveRecursiveCall() to _Py_LeaveRecursiveCallTstate() * pycore_ceval.h: Rename Py_EnterRecursiveCall() to _Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() and _Py_LeaveRecursiveCall()
* gh-92063: Enforce types in specialized PRECALL opcodes (GH-92068)Dennis Sweeney2022-04-301-16/+27
| | | | | | | | | * Check the types of PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS * fix PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS as well * fix PRECALL_NO_KW_METHOD_DESCRIPTOR_O * fix PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST
* gh-91869: Fix tracing of specialized instructions with extended args (GH-91945)Dennis Sweeney2022-04-281-0/+9
|
* gh-91719: Add pycore_opcode.h internal header file (#91906)Victor Stinner2022-04-251-0/+1
| | | | | | | | | | | Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
* gh-89279: In ceval.c, redefine some macros for speed (#32387)Guido van Rossum2022-04-221-13/+60
| | | | | | | | | | | Macros Py_DECREF, Py_XDECREF, Py_IS_TYPE, _Py_atomic_load_32bit_impl and _Py_DECREF_SPECIALIZED are redefined as macros that completely replace the inline functions of the same name. These three came out in the top four of functions that (in MSVC) somehow weren't inlined. Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* GH-91719: Make MSVC generate somewhat faster switch code (#91718)Guido van Rossum2022-04-211-2/+4
| | | | | | | | | | | Apparently a switch on an 8-bit quantity where all cases are present generates a more efficient jump (doing only one indexed memory load instead of two). So we make opcode and use_tracing uint8_t, and generate a macro full of extra `case NNN:` lines for all unused opcodes. See https://github.com/faster-cpython/ideas/issues/321#issuecomment-1103263673
* Cast to (destructor) to fix compiler warnings (GH-91711)Dennis Sweeney2022-04-201-11/+11
|
* gh-90667: Add specializations of Py_DECREF when types are known (GH-30872)Dennis Sweeney2022-04-191-40/+44
|
* gh-91625: Don't ignore extended args of adaptive opcodes (GH-91626)Dennis Sweeney2022-04-171-16/+21
|
* gh-78607: Replace __ltrace__ with __lltrace__ (GH-91619)Dennis Sweeney2022-04-161-1/+1
|
* gh-91462: Make lltrace output human-readable. (GH-91463)Dennis Sweeney2022-04-161-35/+83
| | | | | | * Transform opcodes into opnames * Print the whole stack at each opcode, and eliminate prtrace output at each (push/pop/stackadj) * Display info about the function at each resume_frame
* gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)Irit Katriel2022-04-151-4/+4
|
* gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING ↵Dennis Sweeney2022-04-151-6/+2
| | | | (GH-91476)
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-47/+132
|