summaryrefslogtreecommitdiff
path: root/Python
AgeCommit message (Collapse)AuthorLines
2004-11-02Maintain peepholer's cumlc invariant by updating the running totalRaymond Hettinger-0/+4
everytime a LOAD_CONSTANT is encountered, created, or overwritten. Added two tests to cover cases affected by the patch.
2004-11-01Simplify and future proof NOP counting in the peepholer.Raymond Hettinger-13/+6
No longer assumes that the input is NOP free.
2004-10-30Fixed a comment and added another one.Armin Rigo-1/+4
2004-10-30Adopt some peepholer suggestions from Armin Rigo:Raymond Hettinger-15/+20
* Use simpler, faster two pass algorithm for markblocks(). * Free the blocks variable if not NULL and exiting without change. * Verify that the rest of the compiler has not set an exception. * Make the test for tuple of constants less restrictive. * Embellish the comment for chained conditional jumps.
2004-10-26SF bug #1053819: Segfault in tuple_of_constantsRaymond Hettinger-1/+9
Peepholer could be fooled into misidentifying a tuple_of_constants. Added code to count consecutive occurrences of LOAD_CONST. Use the count to weed out the misidentified cases. Added a unittest.
2004-10-24SF bug #1048870: call arg of lambda not updatingRaymond Hettinger-0/+2
2004-10-13Patch #975056 - fixes for restartable signals on *BSD. In addition,Anthony Baxter-24/+19
a few remaining calls to signal() were converted to PyOS_setsig().
2004-10-11SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters-4/+6
Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
2004-10-10Revert rev 2.35. It was based on erroneous reasoning -- the currentTim Peters-15/+8
thread's id can't get duplicated, because (of course!) the current thread is still running. The code should work either way, but reverting the gratuitous change should make backporting easier, and gets the bad reasoning out of 2.35's new comments.
2004-10-10PyInterpreterState_New(), PyThreadState_New(): use malloc/free directly.Tim Peters-4/+16
This appears to finish repairs for SF bug 1041645. This is a critical bugfix.
2004-10-10find_key(): This routine wasn't thread-correct, and accounts for theTim Peters-5/+17
release-build failures noted in bug 1041645. This is a critical bugfix. I'm not going to backport it, though (no time).
2004-10-09PyGILState_Release(): If we need to delete the TLS entry for this thread,Tim Peters-8/+15
that must be done under protection of the GIL, for reasons explained in new comments.
2004-10-09_PyGILState_Init(), PyGILState_Ensure(): Since PyThread_set_key_value()Tim Peters-2/+5
can fail, check its return value, and die if it does fail. _PyGILState_Init(): Assert that the thread doesn't already have an association for autoTLSkey. If it does, PyThread_set_key_value() will ignore the attempt to (re)set the association, which the code clearly doesn't want.
2004-10-09Document the results of painful reverse-engineering of the "portable TLS"Tim Peters-5/+83
code. PyThread_set_key_value(): It's clear that this code assumes the passed-in value isn't NULL, so document that it must not be, and assert that it isn't. It remains unclear whether existing callers want the odd semantics actually implemented by this function.
2004-10-09Style guide & consistency changes. No semantic changes.Tim Peters-29/+41
2004-10-09Trim trailing whitespace.Tim Peters-8/+8
2004-10-07SF patch #1035498: -m option to run a module as a scriptRaymond Hettinger-0/+16
(Contributed by Nick Coghlan.)
2004-10-07Finalize the freelist of list objects.Raymond Hettinger-0/+1
2004-10-03Print verbose messages to stderr. Fixes #1036752.Martin v. Löwis-1/+2
2004-09-29Improve error message for augmented assignments to genexps or listcomps.Raymond Hettinger-2/+2
Rather than introduce new logic, took the approach of making the message itself more general.
2004-09-29Fix two erroneous error messages.Raymond Hettinger-2/+2
2004-09-28Replaced a test with an assertion.Raymond Hettinger-3/+1
(Suggested by Michael Hudson.)
2004-09-23Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.Phillip J. Eby-4/+10
2004-09-22SF patch #1031667: Fold tuples of constants into a single constantRaymond Hettinger-12/+93
Example: >>> import dis >>> dis.dis(compile('1,2,3', '', 'eval')) 0 0 LOAD_CONST 3 ((1, 2, 3)) 3 RETURN_VALUE
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-31SF patch #1007189, multi-line imports, for instance:Anthony Baxter-824/+895
"from blah import (foo, bar baz, bongo)"
2004-08-29Centralize WITH_TSC processing.Martin v. Löwis-37/+3
2004-08-25Bypass peepholing of code with lineno tables having intervals >= 255.Raymond Hettinger-4/+8
Allows the lineno fixup code to remain simple and not have to deal with multibyte codings. * Add an assertion to that effect. * Remove the XXX comment on the subject.
2004-08-25Fix typo in comment and add clarification.Raymond Hettinger-1/+2
2004-08-25Patch #1015021: Stop claiming that coerce can return None.Martin v. Löwis-4/+4
Will backport to 2.3.
2004-08-25Simplify chains of conditional jumps.Raymond Hettinger-2/+25
(Suggested by Neal Norwitz.)
2004-08-25Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters-1/+3
happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.
2004-08-24Incorporate review comments courtesy of Neal Norwitz:Raymond Hettinger-6/+8
* Perform the code length check earlier. * Eliminate the extra PyMem_Free() upon hitting an EXTENDED_ARG. * Assert that the NOP count used in jump retargeting matches the NOPs eliminated in the final step. * Add an XXX note to indicate that more work is being to done to handle linenotab with intervals > 255.
2004-08-23SF Patch #1013667: Cleanup Peepholer OutputRaymond Hettinger-36/+102
* Make a pass to eliminate NOPs. Produce code that is more readable, more compact, and a tiny bit faster. Makes the peepholer more flexible in the scope of allowable transformations. * With Guido's okay, bumped up the magic number so that this patch gets widely exercised before the alpha goes out.
2004-08-19Patch #900727: Add Py_InitializeEx to allow embedding without signals.Martin v. Löwis-2/+10
2004-08-18Move the bytecode optimizer upstream so that its results are saved in pycRaymond Hettinger-3/+6
files and not re-optimized upon import. Saves a bit of startup time while still remaining decoupled from the rest of the compiler. As a side benefit, handcoded bytecode is not run through the optimizer when new code objects are created. Hopefully, a handcoder has already created exactly what they want to have run. (Idea suggested by Armin Rigo and Michael Hudson. Initially avoided because of worries about compiler coupling; however, only the nexus point needed to be moved so there won't be a conflict when the AST branch is loaded.)
2004-08-17This is Mark Russell's patch:Michael W. Hudson-36/+33
[ 1009560 ] Fix @decorator evaluation order From the description: Changes in this patch: - Change Grammar/Grammar to require newlines between adjacent decorators. - Fix order of evaluation of decorators in the C (compile.c) and python (Lib/compiler/pycodegen.py) compilers - Add better order of evaluation check to test_decorators.py (test_eval_order) - Update the decorator documentation in the reference manual (improve description of evaluation order and update syntax description) and the comment: Used Brett's evaluation order (see http://mail.python.org/pipermail/python-dev/2004-August/047835.html) (I'm checking this in for Anthony who was having problems getting SF to talk to him)
2004-08-16The attached patch fixes FTBFS on GNU/k*BSD. The problem happens on GNU/k*BSDMatthias Klose-0/+10
because GNU/k*BSD uses gnu pth to provide pthreads, but will also happen on any system that does the same. python fails to build because it doesn't detect gnu pth in pthread emulation. See C comments in patch for details. patch taken from http://bugs.debian.org/264315
2004-08-15Correct the order of application for decorators. Meant to be bottom-up and notBrett Cannon-1/+4
top-down. Now matches the PEP.
2004-08-15Fix incorrect comment for (struct compiling)->c_cellvarsBrett Cannon-1/+1
2004-08-12This is my patch:Michael W. Hudson-2/+34
[ 1005891 ] support --with-tsc on PPC plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
2004-08-12code_new(): Wouldn't compile on Windows, because of gcc'ism.Tim Peters-1/+1
2004-08-12Fix bugMichael W. Hudson-27/+88
[ 1005248 ] new.code() not cleanly checking its arguments using the result of new.code() can still destroy the sun, but merely calling the function shouldn't any more. I also rewrote the existing tests of new.code() to use vastly less un-bogus arguments, and added tests for the previous insane behaviours.
2004-08-12Patch #1005468: Disambiguate "min() or max()" exception string.Martin v. Löwis-3/+4
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-07Subclasses of string can no longer be interned. The semantics ofJeremy Hylton-0/+5
interning were not clear here -- a subclass could be mutable, for example -- and had bugs. Explicitly interning a subclass of string via intern() will raise a TypeError. Internal operations that attempt to intern a string subclass will have no effect. Added a few tests to test_builtin that includes the old buggy code and verifies that calls like PyObject_SetAttr() don't fail. Perhaps these tests should have gone in test_string.
2004-08-07FixMichael W. Hudson-9/+7
[ 991812 ] PyArg_ParseTuple can miss errors with warnings as exceptions as suggested in the report. This is definitely a 2.3 candidate (as are most of the checkins I've made in the last month...)
2004-08-06SF bug #1004088: big code objects (>64K) may be optimized incorrectlyRaymond Hettinger-0/+5
Will backport.
2004-08-06SF patch #980695: efficient string concatenationRaymond Hettinger-2/+91
(Original patch by Armin Rigo).
2004-08-04Revert 2.312; turns out interning the file name did do some good (reducingMichael W. Hudson-1/+1
.pyc size) after all.