summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46072: Add top level stats struct (GH-30169)Mark Shannon2021-12-171-23/+8
|
* bpo-45711: Remove type and traceback from exc_info (GH-30122)Irit Katriel2021-12-171-158/+54
| | | | | | | | * Do not PUSH/POP traceback or type to the stack as part of exc_info * Remove exc_traceback and exc_type from _PyErr_StackItem * Add to what's new, because this change breaks things like Cython
* bpo-46072: Add --with-pystats configure option to simplify gathering of VM ↵Mark Shannon2021-12-151-2/+2
| | | | | | | | | stats (GH-30116) * Simplify specialization stats collection macros. * Add --enable-pystats option to configure. * Update specialization summary script to handle larger number of kinds
* bpo-44525: Specialize for calls to type and other builtin classes with 1 ↵Mark Shannon2021-12-151-0/+35
| | | | argument. (GH-29942)
* bpo-46039: Split yield from in two (GH-30035)Mark Shannon2021-12-151-10/+11
| | | | | | * Split YIELD_FROM opcode into SEND and JUMP_ABSOLUTE. * Remove YIELD_FROM opcode.
* bpo-44525: Split calls into PRECALL and CALL (GH-30011)Mark Shannon2021-12-141-58/+158
| | | | | | | | | | * Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW. * Update specialization to handle new CALL opcodes. * Specialize call to method descriptors. * Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-141-8/+347
|
* bpo-46009: Do not exhaust generator when send() method raises (GH-29986)Mark Shannon2021-12-081-18/+2
|
* bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)Eric Snow2021-12-071-1/+1
| | | | | This parallels _PyRuntimeState.interpreters. Doing this helps make it more clear what part of PyInterpreterState relates to its threads. https://bugs.python.org/issue46008
* bpo-46008: Return void from _PyEval_InitState(). (gh-29970)Eric Snow2021-12-071-8/+3
| | | | | This falls into the category of keep-allocation-and-initialization separate. It also allows us to use _PyEval_InitState() safely in functions that return void. https://bugs.python.org/issue46008
* Fix leak when an exception is raised during generator creation. (GH-29960)Mark Shannon2021-12-071-20/+7
|
* bpo-45947: Place dict and values pointer at fixed (negative) offset just ↵Mark Shannon2021-12-071-13/+11
| | | | | | | | | | | | | | | | | | | before GC header. (GH-29879) * Place __dict__ immediately before GC header for plain Python objects. * Fix up lazy dict creation logic to use managed dict pointers. * Manage values pointer, placing them directly before managed dict pointers. * Convert hint-based load/store attr specialization target managed dict classes. * Specialize LOAD_METHOD for managed dict objects. * Remove unsafe _PyObject_GC_Calloc function. * Remove unsafe _PyObject_GC_Malloc() function. * Add comment explaning use of Py_TPFLAGS_MANAGED_DICT.
* bpo-45963: Make space for the InterpreterFrame of a generator in that ↵Mark Shannon2021-12-061-30/+11
| | | | | | | generator. (GH-29891) * Make generator, coroutine and async gen structs all the same size. * Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.
* bpo-45885: Specialize COMPARE_OP (GH-29734)Dennis Sweeney2021-12-031-0/+122
| | | | | | | * Add COMPARE_OP_ADAPTIVE adaptive instruction. * Add COMPARE_OP_FLOAT_JUMP, COMPARE_OP_INT_JUMP and COMPARE_OP_STR_JUMP specialized instructions. * Introduce and use _PyUnicode_Equal
* bpo-45753: Interpreter internal tweaks (GH-29575)Mark Shannon2021-12-011-139/+194
| | | | | | | | | | * Split exit paths into exceptional and non-exceptional. * Move exit tracing code to individual bytecodes. * Wrap all trace entry and exit events in macros to make them clearer and easier to enhance. * Move return sequence into RETURN_VALUE, YIELD_VALUE and YIELD_FROM. Distinguish between normal trace events and dtrace events.
* bpo-45711: Change exc_info related APIs to derive type and traceback from ↵Irit Katriel2021-11-301-6/+3
| | | | the exception instance (GH-29780)
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-291-7/+5
|
* bpo-45711: use exc_value instead of exc_type to determine if exc_info is ↵Irit Katriel2021-11-251-4/+14
| | | | valid. Add more assertions. (GH-29627)
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-231-46/+66
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45871: Refactor except matcher validation into a separate function so ↵Irit Katriel2021-11-221-23/+33
| | | | that it can be reused. Add missing unit test. (GH-29711)
* bpo-45709: Fix tracing when exception is handled. (GH-29638)Mark Shannon2021-11-191-4/+1
|
* bpo-45609: Specialize STORE_SUBSCR (GH-29242)Dennis Sweeney2021-11-191-5/+80
| | | | | * Specialize STORE_SUBSCR for list[int], and dict[object] * Adds _PyDict_SetItem_Take2 which consumes references to the key and values.
* bpo-45829: Specialize BINARY_SUBSCR for __getitem__ implemented in Python. ↵Mark Shannon2021-11-181-23/+38
| | | | (GH-29592)
* bpo-45510: Specialize BINARY_SUBTRACT (GH-29523)Dong-hee Na2021-11-181-0/+35
|
* bpo-45636: Simplify BINARY_OP (GH-29565)Brandt Bucher2021-11-161-83/+34
|
* bpo-45753: Make recursion checks more efficient. (GH-29524)Mark Shannon2021-11-161-17/+24
| | | | * Uses recursion remaining, instead of recursion depth to speed up check against recursion limit.
* bpo-45636: Remove the old %-formatting fast-path (GH-29532)Brandt Bucher2021-11-151-8/+0
|
* bpo-45711: assert that the type of exc_info is redundant (GH-29518)Irit Katriel2021-11-121-0/+25
|
* bpo-45636: Merge all numeric operators (GH-29482)Brandt Bucher2021-11-111-453/+151
|
* bpo-45711: remove unnecessary DUP_TOP and POP in exception handling (GH-29495)Irit Katriel2021-11-101-4/+1
|
* bpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)Mark Shannon2021-10-281-57/+84
|
* bpo-44525: Add recursive checks for `CALL_FUNCTION_BUILTIN_O` (GH-29271)Ken Jin2021-10-281-0/+6
|
* bpo-45637: Store the frame pointer in the cframe (GH-29267)Mark Shannon2021-10-281-23/+24
| | | * Rename 'frame' to 'current_frame'
* Don't make a call at the C level when calling bound-methods from Python ↵Mark Shannon2021-10-271-1/+14
| | | | code. (GH-29238)
* bpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)Brandt Bucher2021-10-271-44/+24
| | | | | | | * Refactor mapping patterns and speed up class patterns. * Simplify MATCH_KEYS and MATCH_CLASS. * Add COPY opcode.
* bpo-45527: Don't count cache hits, just misses. (GH-29092)Mark Shannon2021-10-201-46/+7
|
* bpo-44525: Specialize simple Python calls. (GH-29033)Mark Shannon2021-10-201-3/+42
|
* bpo-44525: Specialize ``CALL_FUNCTION`` for C function calls (GH-26934)Ken Jin2021-10-191-0/+147
|
* Record cache hits for BINARY_SUBSCR specializations (GH-29060)Ken Jin2021-10-191-0/+3
|
* bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)Victor Stinner2021-10-181-7/+7
| | | | | | * Rename _PyThreadState_DisableTracing() to _PyThreadState_PauseTracing() * Rename _PyThreadState_ResetTracing() to _PyThreadState_ResumeTracing()
* bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)Mark Shannon2021-10-181-153/+97
| | | | | | * Avoid making C calls for most calls to Python functions. * Change initialize_locals(steal=true) and _PyTuple_FromArraySteal to consume the argument references regardless of whether they succeed or fail.
* bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)Victor Stinner2021-10-151-10/+7
| | | | | | | | | | Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() functions to the limited C API to suspend and resume tracing and profiling. Add an unit test on the PyThreadState C API to _testcapi. Add also internal _PyThreadState_DisableTracing() and _PyThreadState_ResetTracing().
* bpo-45367: Specialize BINARY_MULTIPLY (GH-28727)Dennis Sweeney2021-10-141-1/+61
|
* Ensure that instruction cases are self-contained (GH-28938)Brandt Bucher2021-10-131-6/+6
|
* bpo-45256: Fix cleanup of stolen locals for Python-to-Python calls (GH-28905)Pablo Galindo Salgado2021-10-131-10/+24
|
* bpo-45340: Don't create object dictionaries unless actually needed (GH-28802)Mark Shannon2021-10-131-36/+36
| | | | | | | | | | | | | | * Never change types' cached keys. It could invalidate inline attribute objects. * Lazily create object dictionaries. * Update specialization of LOAD/STORE_ATTR. * Don't update shared keys version for deletion of value. * Update gdb support to handle instance values. * Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.
* pycore_pystate.h no longer redefines PyThreadState_GET() (GH-28921)Victor Stinner2021-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | Redefining the PyThreadState_GET() macro in pycore_pystate.h is useless since it doesn't affect files not including it. Either use _PyThreadState_GET() directly, or don't use pycore_pystate.h internal C API. For example, the _testcapi extension don't use the internal C API, but use the public PyThreadState_Get() function instead. Replace PyThreadState_Get() with _PyThreadState_GET(). The _PyThreadState_GET() macro is more efficient than PyThreadState_Get() and PyThreadState_GET() function calls which call fail with a fatal Python error. posixmodule.c and _ctypes extension now include <windows.h> before pycore header files (like pycore_call.h). _PyTraceback_Add() now uses _PyErr_Fetch()/_PyErr_Restore() instead of PyErr_Fetch()/PyErr_Restore(). The _decimal and _xxsubinterpreters extensions are now built with the Py_BUILD_CORE_MODULE macro defined to get access to the internal C API.
* bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)Victor Stinner2021-10-121-2/+2
| | | | | | | * Move _PyObject_CallNoArgs() to pycore_call.h (internal C API). * _ssl, _sqlite and _testcapi extensions now call the public PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs(). * _lsprof extension is now built with Py_BUILD_CORE_MODULE macro defined to get access to internal _PyObject_CallNoArgs().
* bpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891)Victor Stinner2021-10-111-5/+5
| | | | | Fix typo in the private _PyObject_CallNoArg() function name: rename it to _PyObject_CallNoArgs() to be consistent with the public function PyObject_CallNoArgs().
* Restore PEP 523 functionality. (GH-28871)Mark Shannon2021-10-111-4/+2
|