Commit Graph

346 Commits

Author SHA1 Message Date
Guido van Rossum
19700b6a98 Add casts to CMPERROR macro to silence SunPro compiler warnings about
integer overflow in << operator.
1997-03-05 00:45:43 +00:00
Guido van Rossum
09e6ad0c1e Changes for Lee Busby's SIGFPE patch set.
Surround various f.p. operations with  PyFPE_{START,END}_PROTECT macros.
1997-02-14 22:54:21 +00:00
Guido van Rossum
0f4bbd2f34 Keep gcc -Wall happy. 1997-02-14 21:12:56 +00:00
Guido van Rossum
36b9f7908a Slight tweak: in string_hash(), if the hash hasn't been computed yet,
and if there's a pointer to an interned version of the string, use its
hash and store its hash in this object, rather than recomputing it.
1997-02-14 16:29:22 +00:00
Guido van Rossum
7582bfb60a Kill all local variables when the frame is deallocated (moved here
from ceval.c).

Wrapped a long line.
1997-02-14 16:27:29 +00:00
Guido van Rossum
efb4609c4a Small lookmapping nits:
- remove bogus initialization using uninitialized i
- derive initial incr from hash
- copy mp->ma_table into a local variable
1997-01-29 15:53:56 +00:00
Guido van Rossum
4acdc2327f Fix bug reported by Per Lindqvist: "%#06x" % 1 stuck the 0 padding
in front of the 0x, like such: "0000x1".
1997-01-29 06:00:24 +00:00
Guido van Rossum
9e5656ca3f Final three poly table entries corrected by Tim Peters.
Reindented the whole table.
1997-01-29 04:45:16 +00:00
Guido van Rossum
16e93a8d59 Changed the lookup algorithm again, based on Reimer Behrends's post.
The table size is now constrained to be a power of two, and we use a
variable increment based on GF(2^n)-{0} (not that I have the faintest
idea what that is :-) which helps avoid the expensive '%' operation.

Some of the entries in the table of polynomials have been modified
according to a post by Tim Peters.
1997-01-28 00:00:11 +00:00
Guido van Rossum
747596a491 When a recycled frame has more local+stack slots than needed,
give the extra slots to the stack rather than than forgetting about
them (this reduces the number of reallocs done).
1997-01-24 04:00:21 +00:00
Guido van Rossum
ca756f2a1d Forget keeping track of whether a dictionary contains all interned
string keys.  Just doing a pointer compare before the string compare
(in fact before the hash compare!) is just as fast.
1997-01-23 19:39:29 +00:00
Guido van Rossum
e0e696282f Added PyCObject_Import. 1997-01-22 20:48:48 +00:00
Guido van Rossum
a04d47b319 Don't use static buffers internally for formatstring(). 1997-01-21 16:12:09 +00:00
Guido van Rossum
3bb63a8dbe Bugfix: remove ref to fast before it's defined. 1997-01-20 04:29:16 +00:00
Guido van Rossum
f3e85a0356 Changes that appear to give another 12% speedup.
Rather than allocating a list object for the fast locals and another
(extensible one) for the value stack and allocating the block stack
dynamically, allocate the block stack with a fixed size (CO_MAXBLOCKS
from compile.h), and stick the locals and value stack at the end of
the object (this is now possible since the stack size is known
beforehand).  Get rid of the owner field and the nvalues argument --
it is available in the code object, like nlocals.

This requires small changes in ceval.c only.
1997-01-20 04:20:52 +00:00
Guido van Rossum
a412d24be0 Intern the various string objects created to speed up lookups. 1997-01-18 07:59:12 +00:00
Guido van Rossum
b56933ed2e Intern the strings "__builtins__". 1997-01-18 07:58:41 +00:00
Guido van Rossum
c6d0670f1b Intern the strings created in getattr() and setattr(). 1997-01-18 07:57:16 +00:00
Guido van Rossum
2a61e7428d String interning. 1997-01-18 07:55:05 +00:00
Guido van Rossum
792fd435ec Comment out extend_stack() -- it is no longer needed. 1997-01-17 21:07:57 +00:00
Guido van Rossum
7d18159614 Rewrote lookmapping() according to suggestions by Jyrki Alakuijala. 1997-01-16 21:06:45 +00:00
Guido van Rossum
6f72f97c03 Increased buffer sizes used by hex() and oct() -- on 64-bit or 128-bit
machines, the string may get longer than 20 characters!
1997-01-14 15:43:41 +00:00
Guido van Rossum
ebee0256f3 Changed hex() and oct() again, to never emit a '-' sign. 1997-01-12 19:48:03 +00:00
Guido van Rossum
919cf1aff1 New, better hash for floating point and complex 1997-01-11 19:26:21 +00:00
Guido van Rossum
80dd9b6672 Subtle change to hex/oct formatting so the largest negative number
does not receive a minus sign.
1997-01-10 17:39:30 +00:00