| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
arithmetic.
|
|
|
|
|
|
| |
from a gcc inline assembler peculiarity. (gcc's "A" constraint
apparently means 'rax or rdx' in 64-bit mode, not edx:eax
or rdx:rax as one might expect.)
|
| |
|
| |
|
| |
|
|
|
|
| |
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
|
|
|
|
|
| |
It speeds up the with statement and correctly looks up the special
methods involved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This shows a modest (1-3%) speed-up in templating systems, for example.
|
| |
|
|
|
|
|
| |
I changed some bytearray methods to use strings instead of unicode like bytes_repr
Also, bytearray.fromhex() can take strings as well as unicode
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
"raised" without setting x, err, or why to let the eval loop know.
|
|
|
|
|
| |
whether any thread has tracing turned on, which saves one load instruction in
the fast_next_opcode path in PyEval_EvalFrameEx(). See issue 4477.
|
|
|
|
| |
(35% faster according to pybench)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
whose write() method installs another sys.stdout.
Will backport.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
EOL 80 limit and supply more alternatives in warning messages.
|
|
|
|
| |
derive from BaseException.
|
|
|
|
|
| |
now don't warn for some corner cases that deserve a warning, rather
than warning double or incorrectly for some other corner cases.
|
|
|
|
| |
doesn't derive from BaseException.
|
|
|
|
| |
of in a temp variable (bumps the magic number for pyc files)
|
|
|
|
| |
ceval.c. This is worth about a .03-.04us speedup on a simple with block.
|
| |
|
| |
|
|
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
go (way) over, but those are harder to fix without suffering in readability.
|
| |
|
|
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
| |
|
| |
|
|
|
|
| |
signed chars in frameobject.c which can occur with opcodes > 127
|
|
|
|
| |
masked by a generic one with the message "unpack non-sequence".
|