summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-718/+718
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 72487-72488,72879 via svnmerge fromAlexandre Vassalotti2009-07-211-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72487 | jeffrey.yasskin | 2009-05-08 17:51:06 -0400 (Fri, 08 May 2009) | 7 lines PyCode_NewEmpty: Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New are trying to build an empty code object, usually to put it in a dummy frame object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify just the filename, function name, and first line number, instead of also requiring lots of code internals. ........ r72488 | jeffrey.yasskin | 2009-05-08 18:23:21 -0400 (Fri, 08 May 2009) | 13 lines Issue 5954, PyFrame_GetLineNumber: Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The remaining uses of PyCode_Addr2Line seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. So we may be able to deprecate PyCode_Addr2Line entirely for external use. ........ r72879 | jeffrey.yasskin | 2009-05-23 19:23:01 -0400 (Sat, 23 May 2009) | 14 lines Issue #6042: lnotab-based tracing is very complicated and isn't documented very well. There were at least 3 comment blocks purporting to document co_lnotab, and none did a very good job. This patch unifies them into Objects/lnotab_notes.txt which tries to completely capture the current state of affairs. I also discovered that we've attached 2 layers of patches to the basic tracing scheme. The first layer avoids jumping to instructions that don't start a line, to avoid problems in if statements and while loops. The second layer discovered that jumps backward do need to trace at instructions that don't start a line, so it added extra lnotab entries for 'while' and 'for' loops, and added a special case for backward jumps within the same line. I replaced these patches by just treating forward and backward jumps differently. ........
* Merged revisions 73129 via svnmerge fromAntoine Pitrou2009-06-011-1/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73129 | antoine.pitrou | 2009-06-02 01:23:16 +0200 (mar., 02 juin 2009) | 3 lines Fix compilation error with gcc 4.3.2 ........
* Merged revisions 73114 via svnmerge fromAmaury Forgeot d'Arc2009-06-011-2/+2
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73114 | amaury.forgeotdarc | 2009-06-01 22:53:18 +0200 (lun., 01 juin 2009) | 3 lines #4547: When debugging a very large function, it was not always possible to update the lineno attribute of the current frame. ........
* Merged revisions 72776,72796 via svnmerge fromJeffrey Yasskin2009-05-201-15/+22
| | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72776 | jeffrey.yasskin | 2009-05-18 14:14:54 -0700 (Mon, 18 May 2009) | 6 lines While I was modifying test_trace, it threw an exception when I accidentally made it try to set the line number from the trace callback for a 'call' event. This patch makes the error message a little more helpful in that case, and makes it a little less likely that a future editor will make the same mistake in test_trace. ........ r72796 | jeffrey.yasskin | 2009-05-20 10:57:57 -0700 (Wed, 20 May 2009) | 3 lines Fix issue #1689458 by teaching frame_setlineno how to jump to the first line of a code object. ........
* Merged revisions 71722 via svnmerge fromBenjamin Peterson2009-04-181-1/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r71722 | benjamin.peterson | 2009-04-18 15:12:47 -0500 (Sat, 18 Apr 2009) | 1 line try to initalize all builtin types with PyType_Ready to avoid problems like #5787 ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.