Guido van Rossum
1548bacb14
Added convenience function PyErr_Format(exception, formatstring, ...) -> NULL.
1997-02-14 17:09:47 +00:00
Guido van Rossum
0d85be19e2
*Don't* kill all local variables on function exit. This will be done
...
by the frameobject dealloc when it is time for the locals to go. When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.
(Hmm... Shouldn't they be copied to the f_locals dictionary?)
1997-02-14 16:32:14 +00:00
Guido van Rossum
e8811f85ed
Added intern() function.
1997-02-14 15:48:05 +00:00
Guido van Rossum
deb0c5e66c
Two small changes:
...
- Use co->... instead of f->f_code->...; save an extra lookup of what
we already have in a local variable).
- Remove test for nlocals > 0 before setting fastlocals to
f->f_localsplus; 0 is a rare case and the assignment is safe even
then.
1997-01-27 23:42:36 +00:00
Guido van Rossum
d0eb429b88
Plug a leak with calling something other than a function or method is
...
called with keyword arguments -- the keyword and value were leaked.
This affected for instance with a __call__() method.
Bug reported and fix supplied by Jim Fulton.
1997-01-27 21:30:09 +00:00
Guido van Rossum
950361c6ca
Patches for (two forms of) optional dynamic execution profiling --
...
i.e., counting opcode frequencies, or (with DXPAIRS defined) opcode
pair frequencies. Define DYNAMIC_EXECUTION_PROFILE on the command
line (for this file and for sysmodule.c) to enable.
1997-01-24 13:49:28 +00:00
Guido van Rossum
8c5df06ec7
Change the control flow for error handling in the function prelude to
...
jump to the "Kill locals" section at the end. Add #ifdef macintosh
bandaid to make sure we call sigcheck() on the Mac.
1997-01-24 04:19:24 +00:00
Guido van Rossum
43f1b8d6e4
Added optional interface for dynamic execution profile (to be gathered
...
in ceval.c).
1997-01-24 04:07:45 +00:00
Guido van Rossum
b3f515af64
Get the line number from PyCode_Addr2Line instead of believing
...
tb_lineno. Store it in tb_lineno for the user.
1997-01-24 04:02:55 +00:00
Guido van Rossum
99d182550b
New magin number (because of linenumber table).
1997-01-24 03:44:53 +00:00
Guido van Rossum
d031c89891
Marshal the line number table of code objects.
1997-01-24 03:44:17 +00:00
Guido van Rossum
da4eb5c3b5
Instead of emitting SET_LINENO instructions, generate a line number
...
table which is incorporated in the code object. This way, the runtime
overhead to keep track of line numbers is only incurred when an
exception has to be reported.
1997-01-24 03:43:35 +00:00
Guido van Rossum
a4240132ec
Kill all local variables on function return. This closes a gigantic
...
leak of memory and file descriptors (thanks for Roj for reporting
that!). Alas, the speed goes down by 5%. :-(
1997-01-21 21:18:36 +00:00
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
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
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
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
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
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