Commit Graph

5122 Commits

Author SHA1 Message Date
Guido van Rossum 70d44787a3 Only call sigcheck() at the ticker code if we don't have true signals.
This is safe now that both intrcheck() and signalmodule.c schedule a
sigcheck() call via Py_AddPendingCall().

This gives another 7% speedup (never run such a test twice ;-).
1997-01-21 06:15:24 +00:00
Guido van Rossum fcdd0e40a4 Arrange for PyErr_CheckSignals() to be called via Py_AddPendingCall().
This avoids having to call sigcheck() (the same routine by its old
name :-) in the ticker code in ceval.c's main interpreter loop.
1997-01-21 06:13:09 +00:00
Guido van Rossum ad74fa6674 In the Unix version, arrange for sigcheck() to be called via
Py_AddPendingCall().  This avoids having to call sigcheck() in the
ticker code in ceval.c's main interpreter loop.
1997-01-21 06:00:33 +00:00
Guido van Rossum 1aa14838d2 Cleanup:
- fix bug in Py_MakePendingCalls() with threading
- fix return type of do_raise
- remove build_slice (same as PySlice_New)
- remove code inside #if 0
- remove code inside #ifdef CHECK_STACK
- remove code inside #ifdef SUPPORT_OBSOLETE_ACCESS
- comment about newimp.py should refer to ni.py
1997-01-21 05:34:20 +00:00
Guido van Rossum 554fa49500 get build info from elsewhere 1997-01-20 18:34:55 +00:00
Guido van Rossum 2fff2e6b05 work build# into version string 1997-01-20 18:34:26 +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 768360243a Changes for frame object speedup:
- get fastlocals differently
- call newframeobject() with fewer arguments
- toss getowner(), which was unused anyway
1997-01-20 04:26:20 +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 cdf578ebaf New lay-out of frame object, for fewer mallocs.
See frameobject.c checkin message.
1997-01-20 04:16:40 +00:00
Guido van Rossum 7eb883a18e Remove unused variable. 1997-01-18 20:04:05 +00:00
Guido van Rossum 8d75161671 Intern the string "__complex__". 1997-01-18 08:04:16 +00:00
Guido van Rossum 7b89b6a660 Intern all names and varnames in newcodeobject(), plus those string
literals that look like identifiers.  Also intern all strings used as
names during the compilation.
1997-01-18 08:02:57 +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 ee5cf9b672 Bump API version due to the various speedup hacks. 1997-01-18 07:54:03 +00:00
Guido van Rossum 1e6e9a2368 Two speedup hacks. Caching the hash saves recalculation of a string's
hash value.  Interning strings (which requires hash caching) tries to
ensure that only one string object with a given value exists, so
equality tests are one pointer comparison.  Together, these can speed
the interpreter up by as much as 20%.  Each costs the size of a long
or pointer per string object.  In addition, interned strings live
until the end of times.  If you are concerned about memory footprint,
simply comment the #define out here (and rebuild everything!).
1997-01-18 07:53:23 +00:00
Guido van Rossum 3dfd53b4c8 Add "if (x != NULL) continue;" (or similar for err==0) before the
break to most cases, as suggested by Tim Peters.  This gives another
8-10% speedup.
1997-01-18 02:46:13 +00:00
Guido van Rossum 04f2b453bb Version 1.1. Fix memory leak and expensive comparison with None. 1997-01-18 02:20:37 +00:00
Guido van Rossum 3e7ae7ab17 Fix the _setmode() patch for MS_WINDOWS: include <fcntl.h> and use
fileno(std*).
1997-01-17 22:05:38 +00:00
Guido van Rossum e3258019c8 Remove obsolete PyFrame_ExtendStack. 1997-01-17 22:03:32 +00:00
Guido van Rossum 3d77d2b10b Removed accessobject.c from file list. 1997-01-17 21:56:08 +00:00
Guido van Rossum e9fd28dae5 Add stacksize argument to new.code(). 1997-01-17 21:12:06 +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 98a9b312e8 Marshal the new stacksize item in code objects. 1997-01-17 21:07:08 +00:00
Guido van Rossum 7af8130857 Working semaphore implementation by Sjoerd. 1997-01-17 21:06:41 +00:00
Guido van Rossum dd5db43905 New MAGIC number (code objects have one more item when marshalled). 1997-01-17 21:06:11 +00:00
Guido van Rossum 62f7d15d0b Use the stack size from the code object and the CO_MAXBLOCKS constant
from compile.h.  Remove all eval stack overflow checks.
1997-01-17 21:05:28 +00:00
Guido van Rossum 8b993a98db Add co_stacksize field to codeobject structure, and stacksize argument
to PyCode_New() argument list.  Move MAXBLOCKS constant to conpile.h.

Added accurate calculation of the actual stack size needed by the
generated code.

Also commented out all fprintf statements (except for a new one to
diagnose stack underflow, and one in #ifdef'ed out code), and added
some new TO DO suggestions (now that the stacksize is taken of the TO
DO list).
1997-01-17 21:04:03 +00:00
Guido van Rossum 3f6e408a31 Add co_stacksize field to codeobject structure, and stacksize argument
to PyCode_New() argument list.  Also add CO_MAXBLOCKS constant
indicating the maximum static nesting supported by the compiler.
1997-01-17 20:59:26 +00:00
Guido van Rossum 00f86e6086 Of course, when the type of the argument to dis() is unsupported, it
should raise TypeError, not ValueError...
1997-01-17 20:08:18 +00:00
Guido van Rossum bd30795192 More user friedly interface:
dis() still disassembles the last frame of the lats stack trace.

dis(x) disassembles x, which may be a code object, function, or method.

disassemble(co, [lasti]) disassembles a code object; the lasti
argument is now optional.

disco(...) is an alias for disassemble(...), for backward compatibility.
1997-01-17 20:05:04 +00:00
Roger E. Masse c905fffa15 Added Sjoerd's submitted 'ratecv' method. Made corrections for new names.
Reindented.
1997-01-17 18:12:04 +00:00
Guido van Rossum 1d1394e660 Make as sure as we can that the forked child does not return and
continue the tests.
1997-01-17 16:13:15 +00:00
Roger E. Masse ed648a25bd Renamed, but not tested. Guido will you try your test script on this? 1997-01-17 16:08:55 +00:00
Roger E. Masse e474fb36ab Renamed. 1997-01-17 16:00:02 +00:00
Roger E. Masse 5c7e711bb1 Test output for the SGI cl C module test script. 1997-01-17 15:59:16 +00:00
Roger E. Masse 69ed964f86 Lame test script for the SGI cl C module. 1997-01-17 15:58:35 +00:00
Barry Warsaw e886ea916e (puremodule.c): New module which exports the Purify and Quantify C API
to Python.  Minimal documentation is included in comments at the top
of the file, and in the Misc/PURIFY.README file.  Note that this
module must be statically linked since Pure doesn't provide shared
stubs libraries.

(Setup.in): Added commented template for pure module

(syslogmodule.c): ins() function wasn't declared static.
1997-01-17 00:01:33 +00:00
Barry Warsaw bb779ec4d9 README file for hints on Purify'ing or Quantify'ing the Python
interpreter.  It also mentions the soon to be checked in pure module.
1997-01-16 23:55:38 +00:00
Roger E. Masse d9240d19b2 Already renamed. Indented. 1997-01-16 22:05:33 +00:00
Roger E. Masse eca63b83ac Output from test script for the bsddb C extension module. 1997-01-16 22:04:35 +00:00
Roger E. Masse 352e186749 Test script for the bsddb C extension module. 1997-01-16 22:04:10 +00:00
Guido van Rossum 7d18159614 Rewrote lookmapping() according to suggestions by Jyrki Alakuijala. 1997-01-16 21:06:45 +00:00
Roger E. Masse 3b039faf19 Minor output message change 1997-01-16 18:53:01 +00:00
Guido van Rossum d0bc9cb869 Merge several mods:
- add opcodes BINARY_LSHIFT ... BINARY_OR

- remove RESERVE_FAST

- Skip M's suggestion for displaying which comparison operator is meant
1997-01-16 18:52:24 +00:00
Roger E. Masse 5f4ce18898 Renamed. 1997-01-16 17:10:22 +00:00
Roger E. Masse 469848a1ea As per GvR recomendations, remove the restriction that binhex only run on
big-endian machines.  This is done by directing the struct module's pack
and unpack methods to treat the data always in bin endian format.
This has been tested on irix (big endian) and solaris x86 (little endian)
but not yet on the mac.
1997-01-16 16:51:57 +00:00