Tim Peters
8a5c3c76be
Since the fast_yield branch target was introduced, it appears that most
...
tests of "why" against WHY_YIELD became useless. This patch removes them,
but assert()s that why != WHY_YIELD everywhere such a test was removed.
The test suite ran fine under a debug build (i.e., the asserts never
triggered).
2004-04-05 19:36:21 +00:00
Nicholas Bastin
e5662aedef
Changed random calls to PyThreadState_Get() to use the macro
2004-03-24 22:22:12 +00:00
Nicholas Bastin
c69ebe8d50
Enable the profiling of C functions (builtins and extensions)
2004-03-24 21:57:10 +00:00
Armin Rigo
bf57a14522
Fix SF bug #765624 .
2004-03-22 19:24:58 +00:00
Armin Rigo
9dbf9084e8
Cancelled checkin, sorry.
2004-03-20 21:50:13 +00:00
Armin Rigo
1515fc2a01
A 2% speed improvement with gcc on low-endian machines. My guess is that this
...
new pattern for NEXTARG() is detected and optimized as a single (*short)
loading.
2004-03-20 20:03:17 +00:00
Raymond Hettinger
fba1cfc49a
LIST_APPEND is predicably followed by JUMP_ABSOLUTE.
...
Reduces loop overhead by an additional 10%.
2004-03-12 16:33:17 +00:00
Raymond Hettinger
2d783e9b16
Move the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.
...
Makes it more likely that all loop operations are in the cache
at the same time.
2004-03-12 09:12:22 +00:00
Raymond Hettinger
db0de9e7ca
Speedup for-loops by inlining PyIter_Next(). Saves duplicate tests
...
and a function call resulting in a 15% reduction of total loop overhead
(as measured by timeit.Timer('pass')).
2004-03-12 08:41:36 +00:00
Raymond Hettinger
f114a3ae63
Refactor and optimize code for UNPACK_SEQUENCE.
...
* Defer error handling for wrong number of arguments to the
unpack_iterable() function. Cuts the code size almost in half.
* Replace function calls to PyList_Size() and PyTuple_Size() with
their smaller and faster macro counterparts.
* Move the constant structure references outside of the inner loops.
2004-03-08 23:25:30 +00:00
Raymond Hettinger
dd80f76265
SF patch #910929 : Optimize list comprehensions
...
Add a new opcode, LIST_APPEND, and apply it to the code generation for
list comprehensions. Reduces the per-loop overhead by about a third.
2004-03-07 07:31:06 +00:00
Skip Montanaro
786ea6bc23
Add pystack definition to Misc/gdbinit with some explanation of its behavior
...
and add flag comments to ceval.c and main.c alerting people to the coupling
between pystack and the layout of those files.
2004-03-01 15:44:05 +00:00
Michael W. Hudson
ecfeb7f095
This is my patch #876198 plus a NEWS entry and a header frob.
...
Remove the ability to use (from C) arbitrary objects supporting the
read buffer interface as the co_code member of code objects.
2004-02-12 15:28:27 +00:00
Skip Montanaro
7befb9966e
remove support for missing ANSI C header files (limits.h, stddef.h, etc).
2004-02-10 16:50:21 +00:00
Raymond Hettinger
a72169871d
SF patch #884022 : dynamic execution profiling vs opcode prediction
...
(Contributed by Andrew I MacIntyre.)
disables opcode prediction when dynamic execution
profiling is in effect, so the profiling counters at
the top of the main interpreter loop in eval_frame()
are updated for each opcode.
2004-02-08 19:59:27 +00:00
Raymond Hettinger
1dd8309246
SF patch #864059 : optimize eval_frame
...
Simplified version of Neal Norwitz's patch which adds gotos for
opcodes that set "why". This skips a number of tests where the
outcome of the tests are known in advance.
2004-02-06 18:32:33 +00:00
Jack Jansen
eddc1449ba
Getting rid of all the code inside #ifdef macintosh too.
2003-11-20 01:44:59 +00:00
Jeremy Hylton
904ed86a77
Make undetected error on stack unwind a fatal error.
2003-11-05 17:29:35 +00:00
Armin Rigo
2b3eb4062c
Deleting cyclic object comparison.
...
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html
2003-10-28 12:05:48 +00:00
Armin Rigo
1d313ab9d1
oh dear. Wrong manipulation. Committed a version of ceval.c from my
...
no-cyclic-comparison patch at the same time as errors.c.
Reverting ceval.c to the previous revision.
2003-10-25 14:33:09 +00:00
Armin Rigo
092381a979
Made function declaration a proper C prototype
2003-10-25 14:29:27 +00:00
Raymond Hettinger
8ae4689657
Simplify and speedup uses of Py_BuildValue():
...
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
2003-10-12 19:09:37 +00:00
Neal Norwitz
c5131bc256
Fix SF #762455 , segfault when sys.stdout is changed in getattr
...
Will backport.
2003-06-29 14:48:32 +00:00
Guido van Rossum
b8b6d0c2c6
Add PyThreadState_SetAsyncExc(long, PyObject *).
...
A new API (only accessible from C) to interrupt a thread by sending it
an exception. This is not always effective, but might help some people.
Requested by Just van Rossum and Alex Martelli. It is intentional
that you have to write your own C extension to call it from Python.
Docs will have to wait.
2003-06-28 21:53:52 +00:00
Neil Schemenauer
c4b570f218
Use fast_next_opcode shortcut for forward jump opcodes (it's safe and
...
gives a small speedup).
2003-06-01 19:21:12 +00:00