summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-1/+4
|
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-171-0/+4
| | | | (GH-11175)
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-3/+4
| | | Fix also return type for few other functions (clear, releasebuffer).
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-2/+2
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-33041: Fix downcast warning on Windows (#6595)Victor Stinner2018-04-271-1/+1
| | | | Cast pointer difference from ssize_t to int: a frame is very unlikely larger than 2 GB.
* bpo-30953: Improve error messages and add tests for jumping (GH-6196)Serhiy Storchaka2018-03-231-2/+6
| | | | into/out of an except block.
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-12/+9
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)xdegaye2018-03-131-4/+35
| | | (cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
* bpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026)Serhiy Storchaka2018-03-111-9/+15
|
* closes bpo-32980 Remove _PyFrame_Init (GH-5965)Thomas Nyberg2018-03-041-8/+0
|
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-126/+77
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32690: Preserve order of locals() (#5379)Raymond Hettinger2018-01-281-2/+2
|
* bpo-32468: Better frame repr() (#5067)Antoine Pitrou2017-12-311-1/+10
| | | | bpo-32468: Better frame repr()
* Move exc state to generator. Fixes bpo-25612 (#1773)Mark Shannon2017-10-221-12/+1
| | | Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-0/+1
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-0/+4
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.INADA Naoki2016-12-241-4/+16
| | | | Calling function is up to 5% faster.
* Issue #28618: Make hot functions using __attribute__((hot))Victor Stinner2016-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | When Python is not compiled with PGO, the performance of Python on call_simple and call_method microbenchmarks depend highly on the code placement. In the worst case, the performance slowdown can be up to 70%. The GCC __attribute__((hot)) attribute helps to keep hot code close to reduce the risk of such major slowdown. This attribute is ignored when Python is compiled with PGO. The following functions are considered as hot according to statistics collected by perf record/perf report: * _PyEval_EvalFrameDefault() * call_function() * _PyFunction_FastCall() * PyFrame_New() * frame_dealloc() * PyErr_Occurred()
* Issue #27129: Replaced wordcode related magic constants with macros.Serhiy Storchaka2016-09-111-2/+2
|
* Issue #20041: Fixed TypeError when frame.f_trace is set to None.Serhiy Storchaka2016-06-041-0/+2
|\ | | | | | | Patch by Xavier de Gaye.
| * Issue #20041: Fixed TypeError when frame.f_trace is set to None.Serhiy Storchaka2016-06-041-5/+3
| | | | | | | | Patch by Xavier de Gaye.
* | Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.Serhiy Storchaka2016-05-241-10/+2
| | | | | | | | Patch by Demur Rumed.
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-2/+2
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
| |
* | co_lnotab supports negative line number deltaVictor Stinner2016-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta. Changes: * assemble_lnotab(): if line number delta is less than -128 or greater than 127, emit multiple (offset_delta, lineno_delta) in co_lnotab * update functions decoding co_lnotab to use signed 8-bit integers - dis.findlinestarts() - PyCode_Addr2Line() - _PyCode_CheckLineNumber() - frame_setlineno() * update lnotab_notes.txt * increase importlib MAGIC_NUMBER to 3361 * document the change in What's New in Python 3.6 * cleanup also PyCode_Optimize() to use better variable names
* | Issue #20440: Cleaning up the code by using Py_SETREF.Serhiy Storchaka2016-01-051-5/+1
|/
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | macro Py_SETREF.
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-2/+6
|
* Issue #21897: Fix a crash with the f_locals attribute with closure variables ↵Antoine Pitrou2014-07-051-1/+1
| | | | when frame.clear() has been called.
* Issue #14432: Remove the thread state field from the frame structure. Fix aVictor Stinner2013-12-131-1/+0
| | | | | | | crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
* frameobject.c: Use an identifer instead of creating explicitly an internedVictor Stinner2013-11-071-7/+5
| | | | string for "__builtins__" literal string
* Issue #18408: Add a new PyFrame_FastToLocalsWithError() function to handleVictor Stinner2013-10-291-27/+50
| | | | | exceptions when merging fast locals into f_locals of a frame. PyEval_GetLocals() now raises an exception and return NULL on failure.
* Issue #17934: Add a clear() method to frame objects, to help clean up ↵Antoine Pitrou2013-08-051-2/+26
| | | | expensive details (local variables) and break reference cycles.
* Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macrosVictor Stinner2013-06-041-8/+3
| | | | multiprocessing.h: remove unused MIN and MAX macros
* Backout c89febab4648 following private feedback by Guido.Antoine Pitrou2013-05-141-234/+20
| | | | (Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
* Issue #17807: Generators can now be finalized even when they are part of a ↵Antoine Pitrou2013-05-081-20/+234
| | | | reference cycle.
* Issue #9566: Use the right type to fix a compiler warnings on Win64Victor Stinner2012-10-301-4/+4
|
* Issue #14785: Add sys._debugmallocstats() to help debug low-level memory ↵David Malcolm2012-06-221-0/+10
| | | | allocation issues
* Issue #14909: A number of places were using PyMem_Realloc() apis andKristjan Valur Jonsson2012-05-311-2/+4
| | | | | PyObject_GC_Resize() with incorrect error handling. In case of errors, the original object would be leaked. This checkin fixes those cases.
* Issue #14385: Support other types than dict for __builtins__Victor Stinner2012-04-181-4/+2
| | | | | | It is now possible to use a custom type for the __builtins__ namespace, instead of a dict. It can be used for sandboxing for example. Raise also a NameError instead of ImportError if __build_class__ name if not found in __builtins__.
* merge 3.2 (#14612)Benjamin Peterson2012-04-181-2/+4
|\
| * SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno ↵Benjamin Peterson2012-04-181-2/+4
| | | | | | | | (closes #14612)
* | perform yield from delegation by repeating YIELD_FROM opcode (closes #14230)Benjamin Peterson2012-03-151-4/+0
| | | | | | | | | | | | | | This allows generators that are using yield from to be seen by debuggers. It also kills the f_yieldfrom field on frame objects. Patch mostly from Mark Shannon with a few tweaks by me.
* | remove f_yieldfrom access from Python (closes #13970)Benjamin Peterson2012-03-051-1/+0
| |
* | Implement PEP 380 - 'yield from' (closes #11682)Nick Coghlan2012-01-131-5/+10
|/
* Issue #9089: Remove references to intobject.c and intobject.h from comments.Mark Dickinson2010-06-271-1/+1
|