diff options
author | Guido van Rossum <guido@python.org> | 1993-03-30 13:18:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-03-30 13:18:41 (GMT) |
commit | 8b17d6bd89cd79820c76bd88bc064e44fc03a1bd (patch) | |
tree | 3d8fd0cc9e8401bdd79980b52db03bfe3b2431e8 /Objects | |
parent | 0023078a0b751260acdee7be0b029335f7efe888 (diff) | |
download | cpython-8b17d6bd89cd79820c76bd88bc064e44fc03a1bd.zip cpython-8b17d6bd89cd79820c76bd88bc064e44fc03a1bd.tar.gz cpython-8b17d6bd89cd79820c76bd88bc064e44fc03a1bd.tar.bz2 |
Changes to speed up local variables enormously, by avoiding dictionary
lookup (opcode.h, ceval.[ch], compile.c, frameobject.[ch],
pythonrun.c, import.c). The .pyc MAGIC number is changed again.
Added get_menu_text to flmodule.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index cec0502..85c89f6 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -38,6 +38,8 @@ static struct memberlist frame_memberlist[] = { {"f_code", T_OBJECT, OFF(f_code)}, {"f_globals", T_OBJECT, OFF(f_globals)}, {"f_locals", T_OBJECT, OFF(f_locals)}, + {"f_fastlocals",T_OBJECT, OFF(f_fastlocals)}, + {"f_localmap", T_OBJECT, OFF(f_localmap)}, {"f_lasti", T_INT, OFF(f_lasti)}, {"f_lineno", T_INT, OFF(f_lineno)}, {NULL} /* Sentinel */ @@ -82,6 +84,8 @@ frame_dealloc(f) XDECREF(f->f_code); XDECREF(f->f_globals); XDECREF(f->f_locals); + XDECREF(f->f_fastlocals); + XDECREF(f->f_localmap); f->f_back = free_list; free_list = f; } @@ -142,6 +146,8 @@ newframeobject(back, code, globals, locals, nvalues, nblocks) f->f_globals = globals; INCREF(locals); f->f_locals = locals; + f->f_fastlocals = NULL; + f->f_localmap = NULL; if (nvalues > f->f_nvalues || f->f_valuestack == NULL) { XDEL(f->f_valuestack); f->f_valuestack = NEW(object *, nvalues+1); |