summaryrefslogtreecommitdiff
path: root/Python/ceval.c
AgeCommit message (Collapse)AuthorLines
2006-03-07Backport r42894: SF #1444030 Fix several potential defects foundHye-Shik Chang-1/+4
by Coverity.
2006-02-27Return value off PyErr_Warn() for raising string exceptions was not beingBrett Cannon-3/+5
checked. Problem when 'warnings' was set to "error" and thus would re-raise a new exception.
2006-02-19Bug #801349: document that start/stop/step slice arguments can be NoneGeorg Brandl-1/+1
2006-02-16Cast assignments to ``unsigned char *`` from PyString_AS_STRING() calls toBrett Cannon-1/+1
silence compiler warnings on gcc 4.0.1 .
2005-09-20(backport) tracing of C functions: don't call the trace funcArmin Rigo-26/+31
with an exception currently set!
2005-08-15Fix for SF bug # 900092, hotshot.stats.load assertion failure. This patchBarry Warsaw-8/+14
restores the tracing of a 'return' event for exceptions that cause a function to exit. Also, update the unit test. I will port to Python 2.5.
2004-11-23Hye-Shik Chang's fix for Bug 875692.Kurt B. Kaiser-0/+6
Improve signal handling, especially when using threads, by forcing an early re-execution of PyEval_EvalFrame() "periodic" code when things_to_do is not cleared by Py_MakePendingCalls(). M Misc/NEWS M Python/ceval.c
2004-10-11SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters-3/+6
Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
2004-09-16SF bug #1014215: Unspecific errors with metaclassRaymond Hettinger-4/+16
High level error message was stomping useful detailed messages from lower level routines. The new approach is to augment string error messages returned by the low level routines. The provides both high and low level information. If the exception value is not a string, no changes are made. To see the improved messages in action, type: import random class R(random): pass class B(bool): pass
2004-08-29Centralize WITH_TSC processing.Martin v. Löwis-37/+3
2004-08-12This is my patch:Michael W. Hudson-1/+33
[ 1005891 ] support --with-tsc on PPC plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
2004-08-07This was quite a dark bug in my recent in-place string concatenationArmin Rigo-1/+1
hack: it would resize *interned* strings in-place! This occurred because their reference counts do not have their expected value -- stringobject.c hacks them. Mea culpa.
2004-08-06SF patch #980695: efficient string concatenationRaymond Hettinger-2/+91
(Original patch by Armin Rigo).
2004-08-02Fix for the unfortunate fact that PyDict_GetItem and PyObject_GetItemMichael W. Hudson-2/+4
have differing refcount semantics. If anyone sees a prettier way to acheive the same ends, then please go for it. I think this is the first time I've ever used Py_XINCREF.
2004-08-02Completed the patch for Bug #215126.Raymond Hettinger-3/+3
* Fixes an incorrect variable in a PyDict_CheckExact. * Allow general mapping locals arguments for the execfile() function and exec statement. * Add tests.
2004-07-08Remove unused macros in .c filesNeal Norwitz-3/+0
2004-07-07This closes patch:Michael W. Hudson-1/+1
[ 960406 ] unblock signals in threads although the changes do not correspond exactly to any patch attached to that report. Non-main threads no longer have all signals masked. A different interface to readline is used. The handling of signals inside calls to PyOS_Readline is now rather different. These changes are all a bit scary! Review and cross-platform testing much appreciated.
2004-07-02SF Bug #215126: Over restricted type checking on eval() functionRaymond Hettinger-4/+16
The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
2004-06-27Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis-14/+6
2004-06-26Get ceval.c to compile again by moving declarations before other statments.Raymond Hettinger-1/+2
2004-06-25Massive performance improvement for C extension and builtin tracing codeNicholas Bastin-51/+27
2004-06-22Less ugly #ifdefs for C profiling fixNicholas Bastin-12/+5
2004-06-22One forgotten C profiling #ifdefNicholas Bastin-1/+2
2004-06-22Making C profiling a configure option (at least temporarily)Nicholas Bastin-0/+12
2004-06-21Install two code generation optimizations that depend on NOP.Raymond Hettinger-0/+3
Reduces the cost of "not" to almost zero.
2004-06-17Performance tweak: allow stack_pointer and oparg to be register variables.Armin Rigo-7/+16
SF patch #943898
2004-06-08Patch #510695: Add TSC profiling for the VM.Martin v. Löwis-2/+150
2004-06-05SF bug #963956: Bad error mesage when subclassing a moduleRaymond Hettinger-0/+9
Add a more informative message for the common user mistake of subclassing from a module name rather than another class (i.e. random instead of random.random).
2004-06-01Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis-138/+8
2004-04-11Some (but not all) of the why code bitfield tests ran faster asRaymond Hettinger-3/+4
separate equality tests. Now, all are set to their best timing.
2004-04-10Revert 2.393, elimination of pre-decrementing, whichRaymond Hettinger-17/+13
did not stand-up to additional timings.
2004-04-07Use continue instead of break whereever possible.Raymond Hettinger-2/+8
2004-04-07* Improve readability and remove data dependencies by convertingRaymond Hettinger-14/+18
pre-increment forms to post-increment forms. Post-incrementing also eliminates the need for negative array indices for oparg fetches. * In exception handling code, check for class based exceptions before the older string based exceptions.
2004-04-07Small code improvements for readability, code size, and/or speed.Raymond Hettinger-58/+54
BINARY_SUBSCR: * invert test for normal case fall through * eliminate err handling code by jumping to slow_case LOAD_LOCALS: * invert test for normal case fall through * continue instead of break for the non-error case STORE_NAME and DELETE_NAME: * invert test for normal case fall through LOAD_NAME: * continue instead of break for the non-error case DELETE_FAST: * invert test for normal case fall through LOAD_DEREF: * invert test for normal case fall through * continue instead of break for the non-error case
2004-04-06Simplify previous checkin (bitfields for WHY codes).Raymond Hettinger-11/+13
Restores the self-documenting enum declaration.
2004-04-06Coded WHY flags as bitfields (taking inspiration from tp_flags).Raymond Hettinger-19/+15
This allows multiple flags to be tested in a single compare which eliminates unnecessary compares and saves a few bytes.
2004-04-05Since the fast_yield branch target was introduced, it appears that mostTim Peters-41/+41
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-03-24Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin-5/+5
2004-03-24Enable the profiling of C functions (builtins and extensions)Nicholas Bastin-3/+48
2004-03-22Fix SF bug #765624.Armin Rigo-5/+12
2004-03-20Cancelled checkin, sorry.Armin Rigo-10/+6
2004-03-20A 2% speed improvement with gcc on low-endian machines. My guess is that thisArmin Rigo-6/+10
new pattern for NEXTARG() is detected and optimized as a single (*short) loading.
2004-03-12LIST_APPEND is predicably followed by JUMP_ABSOLUTE.Raymond Hettinger-1/+5
Reduces loop overhead by an additional 10%.
2004-03-12Move the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.Raymond Hettinger-9/+9
Makes it more likely that all loop operations are in the cache at the same time.
2004-03-12Speedup for-loops by inlining PyIter_Next(). Saves duplicate testsRaymond Hettinger-8/+10
and a function call resulting in a 15% reduction of total loop overhead (as measured by timeit.Timer('pass')).
2004-03-08Refactor and optimize code for UNPACK_SEQUENCE.Raymond Hettinger-27/+13
* 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-07SF patch #910929: Optimize list comprehensionsRaymond Hettinger-0/+9
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-01Add pystack definition to Misc/gdbinit with some explanation of its behaviorSkip Montanaro-0/+4
and add flag comments to ceval.c and main.c alerting people to the coupling between pystack and the layout of those files.
2004-02-12This is my patch #876198 plus a NEWS entry and a header frob.Michael W. Hudson-1/+1
Remove the ability to use (from C) arbitrary objects supporting the read buffer interface as the co_code member of code objects.
2004-02-10remove support for missing ANSI C header files (limits.h, stddef.h, etc).Skip Montanaro-11/+0