summaryrefslogtreecommitdiff
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} withJeffrey Yasskin2009-02-281-17/+67
| | | | | | POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
* Issue 5176: special-case string formatting in BINARY_MODULO implementation. ↵Collin Winter2009-02-201-1/+4
| | | | This shows a modest (1-3%) speed-up in templating systems, for example.
* Silence 'arg may be used uninitialized in this function' warning from gcc.Mark Dickinson2009-02-081-1/+1
|
* fix building the core with --disable-unicodeBenjamin Peterson2009-01-251-4/+15
| | | | | I changed some bytearray methods to use strings instead of unicode like bytes_repr Also, bytearray.fromhex() can take strings as well as unicode
* allow unicode keyword arguments for the ** syntax #4978Benjamin Peterson2009-01-201-12/+33
|
* Issue 4293: Make Py_AddPendingCall() thread safeKristján Valur Jónsson2009-01-091-22/+146
|
* Issue #2183: Simplify and optimize bytecode for list comprehensions.Antoine Pitrou2008-12-171-2/+1
|
* #4559: When a context manager's __exit__() method returns an object whoseAmaury Forgeot d'Arc2008-12-101-6/+13
| | | | | | | conversion to bool raises an exception, 'with' loses that exception. Reviewed by Jeffrey Yasskin. Already ported to 2.5, will port to 2.6 and 3.0
* Issue 4597: Fix several cases in EvalFrameEx where an exception could beJeffrey Yasskin2008-12-081-3/+14
| | | | "raised" without setting x, err, or why to let the eval loop know.
* Speed up Python (according to pybench and 2to3-on-itself) by 1-2% by cachingJeffrey Yasskin2008-12-031-1/+10
| | | | | whether any thread has tracing turned on, which saves one load instruction in the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477.
* Raymond's patch for #1819: speedup function calls with named parametersAntoine Pitrou2008-07-251-22/+30
| | | | (35% faster according to pybench)
* Apply patch for 874900: threading module can deadlock after forkJesse Noller2008-07-161-0/+20
|
* Update comment on prediction macros.Raymond Hettinger2008-07-051-11/+13
|
* Add a comment about incref'ing w.Georg Brandl2008-07-011-0/+2
|
* #3242: fix a crash in "print", if sys.stdout is set to a custom object,Amaury Forgeot d'Arc2008-07-011-0/+2
| | | | | | whose write() method installs another sys.stdout. Will backport.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-47/+47
| | | | | | | 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.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-47/+47
|
* A little reformating of Py3k warningsBenjamin Peterson2008-04-271-8/+8
|
* Use PyErr_WarnPy3k throughoutBenjamin Peterson2008-04-271-2/+2
|
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-251-1/+1
| | | | EOL 80 limit and supply more alternatives in warning messages.
* Issue #2341: Add a Py3k warning when raising an exception that doesn'tGuido van Rossum2008-03-181-0/+9
| | | | derive from BaseException.
* Clean up the Py3k warnings for non-BaseException-subclasses a bit. WeGuido van Rossum2008-03-181-4/+6
| | | | | now don't warn for some corner cases that deserve a warning, rather than warning double or incorrectly for some other corner cases.
* - Issue #2371: Add a Py3k warning when catching an exception thatGuido van Rossum2008-03-181-0/+27
| | | | doesn't derive from BaseException.
* Speed up with statements by storing the __exit__ method on the stack instead ↵Nick Coghlan2008-03-071-24/+50
| | | | of in a temp variable (bumps the magic number for pyc files)
* compile.c always emits END_FINALLY after WITH_CLEANUP, so predict that inJeffrey Yasskin2008-03-031-0/+2
| | | | ceval.c. This is worth about a .03-.04us speedup on a simple with block.
* Reduce buffer size since we do not need 1kNeal Norwitz2008-01-271-1/+1
|
* Fix two crashers.Guido van Rossum2008-01-231-1/+5
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Give meaning to the oparg for BUILD_MAP: estimated size of the dictionary.Raymond Hettinger2007-12-181-1/+1
| | | | | | | | | | | Allows dictionaries to be pre-sized (upto 255 elements) saving time lost to re-sizes with their attendant mallocs and re-insertions. Has zero effect on small dictionaries (5 elements or fewer), a slight benefit for dicts upto 22 elements (because they had to resize once anyway), and more benefit for dicts upto 255 elements (saving multiple resizes during the build-up and reducing the number of collisions on the first insertions). Beyond 255 elements, there is no addional benefit.
* Speed-up dictionary constructor by about 10%.Raymond Hettinger2007-12-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | New opcode, STORE_MAP saves the compiler from awkward stack manipulations and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem. Old disassembly: 0 BUILD_MAP 0 3 DUP_TOP 4 LOAD_CONST 1 (1) 7 ROT_TWO 8 LOAD_CONST 2 ('x') 11 STORE_SUBSCR 12 DUP_TOP 13 LOAD_CONST 3 (2) 16 ROT_TWO 17 LOAD_CONST 4 ('y') 20 STORE_SUBSCR New disassembly: 0 BUILD_MAP 0 3 LOAD_CONST 1 (1) 6 LOAD_CONST 2 ('x') 9 STORE_MAP 10 LOAD_CONST 3 (2) 13 LOAD_CONST 4 ('y') 16 STORE_MAP
* Silence a warning about an unsed variable in debug buildsChristian Heimes2007-12-141-2/+3
|
* Fix typo.Georg Brandl2007-12-051-1/+1
|
* Merge from py3k branch:Amaury Forgeot d'Arc2007-11-131-7/+12
| | | | | | | | | | | | | | | | | | | | | | Correction for issue1265 (pdb bug with "with" statement). When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx is called with a GeneratorExit exception set. This leads to funny results if the sys.settrace function itself makes use of generators. A visible effect is that the settrace function is reset to None. Another is that the eventual "finally" block of the generator is not called. It is necessary to save/restore the exception around the call to the trace function. This happens a lot with py3k: isinstance() of an ABCMeta instance runs def __instancecheck__(cls, instance): """Override for isinstance(instance, cls).""" return any(cls.__subclasscheck__(c) for c in {instance.__class__, type(instance)}) which lets an opened generator expression each time it returns True. Backport candidate, even if the case is less frequent in 2.5.
* Add build option for faster loop execution.Raymond Hettinger2007-11-071-0/+11
|
* Try harder to stay within the 79-column limit. There's still two places that ↵Thomas Wouters2007-09-201-44/+55
| | | | go (way) over, but those are harder to fix without suffering in readability.
* Whitespace cleanup.Thomas Wouters2007-09-191-27/+27
|
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-1/+1
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Patch #1686487: you can now pass any mapping after '**' in function calls.Georg Brandl2007-05-211-10/+29
|
* Remove an XXX that is unnecessary.Georg Brandl2007-05-111-1/+0
|
* Fix a bug when using the __lltrace__ opcode tracer, and a problem sith ↵Kristján Valur Jónsson2007-04-131-1/+1
| | | | signed chars in frameobject.c which can occur with opcodes > 127
* Patch #1682205: a TypeError while unpacking an iterable is no longerGeorg Brandl2007-03-211-5/+3
| | | | masked by a generic one with the message "unpack non-sequence".
* Patch #1674228: when assigning a slice (old-style), check for theGeorg Brandl2007-03-051-1/+1
| | | | sq_ass_slice instead of the sq_slice slot.
* Reformat long lines.Jeremy Hylton2007-02-261-2/+4
|
* Put declarations before code.Jeremy Hylton2007-02-251-1/+1
|
* Fix crash in exec when unicode filename can't be decoded.Jeremy Hylton2007-02-251-0/+2
| | | | | | | I can't think of an easy way to test this behavior. It only occurs when the file system default encoding and the interpreter default encoding are different, such that you can open the file but not decode its name.
* No more raising of string exceptions!Brett Cannon2007-01-301-13/+34
| | | | | | | The next step of PEP 352 (for 2.6) causes raising a string exception to trigger a TypeError. Trying to catch a string exception raises a DeprecationWarning. References to string exceptions has been removed from the docs since they are now just an error.
* SF# 1409443: Expand comment to cover the interaction between f->f_lasti and ↵Raymond Hettinger2007-01-061-1/+10
| | | | the PREDICT macros.
* Forgot a case where the locals can now be a general mappingArmin Rigo2006-11-291-1/+3
| | | | instead of just a dictionary. (backporting...)
* [Bug #1542016] Report PCALL_POP value. This makes the return value of ↵Andrew M. Kuchling2006-10-271-2/+2
| | | | | | | sys.callstats() match its docstring. Backport candidate. Though it's an API change, this is a pretty obscure portion of the API.
* Move/copy assert for tstate != NULL before first use.Neal Norwitz2006-08-131-1/+7
| | | | | | Verify that PyEval_Get{Globals,Locals} returned valid pointers. Klocwork 231-232