summaryrefslogtreecommitdiff
path: root/Objects/codeobject.c
AgeCommit message (Collapse)AuthorLines
2009-05-23Issue #6042:Jeffrey Yasskin-132/+8
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.
2009-05-08PyCode_NewEmpty:Jeffrey Yasskin-0/+46
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.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-22/+22
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-05-26Renamed PyString to PyBytesChristian Heimes-22/+22
2008-04-27A little reformating of Py3k warningsBenjamin Peterson-2/+2
2008-04-27Use PyErr_WarnPy3k throughoutBenjamin Peterson-4/+2
2008-03-25Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl-3/+6
EOL 80 limit and supply more alternatives in warning messages.
2008-03-18Add py3k warnings for code and method inequality comparisons. This should ↵Steven Bethard-1/+67
resolve issue 2373. The codeobject.c and methodobject.c changes are both just backports of the Python 3 code.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-2/+1
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2006-07-12Fix uninitialized memory read reported by Valgrind when running doctest.Neal Norwitz-0/+1
This could happen if size == 0.
2006-05-23Merge from rjones-funccall branch.Richard Jones-0/+3
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for Python 2.5 and also modified to retain the free_list to avoid the 67% slow-down in pybench recursion test. 5% speed up in function call pybench.
2006-04-18Refactor: Move code that uses co_lnotab from ceval to codeobjectJeremy Hylton-0/+133
2006-02-15Merge ssize_t branch.Martin v. Löwis-3/+3
2005-10-20Merge ast-branch to headJeremy Hylton-0/+453
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.