summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-03-30 13:18:41 (GMT)
committerGuido van Rossum <guido@python.org>1993-03-30 13:18:41 (GMT)
commit8b17d6bd89cd79820c76bd88bc064e44fc03a1bd (patch)
tree3d8fd0cc9e8401bdd79980b52db03bfe3b2431e8 /Include
parent0023078a0b751260acdee7be0b029335f7efe888 (diff)
downloadcpython-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 'Include')
-rw-r--r--Include/ceval.h1
-rw-r--r--Include/frameobject.h2
-rw-r--r--Include/opcode.h14
3 files changed, 9 insertions, 8 deletions
diff --git a/Include/ceval.h b/Include/ceval.h
index bec6681..a9f79b5 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -28,6 +28,7 @@ object *call_object PROTO((object *, object *));
object *getglobals PROTO((void));
object *getlocals PROTO((void));
+void mergelocals PROTO((void));
void printtraceback PROTO((object *));
void flushline PROTO((void));
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 4d17267..d46b454 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -36,6 +36,8 @@ typedef struct _frame {
codeobject *f_code; /* code segment */
object *f_globals; /* global symbol table (dictobject) */
object *f_locals; /* local symbol table (dictobject) */
+ object *f_fastlocals; /* fast local variables (listobject) */
+ object *f_localmap; /* local variable names (dictobject) */
object **f_valuestack; /* malloc'ed array */
block *f_blockstack; /* malloc'ed array */
int f_nvalues; /* size of f_valuestack */
diff --git a/Include/opcode.h b/Include/opcode.h
index 67c0b82..0f08760 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -72,10 +72,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define RAISE_EXCEPTION 81
#define LOAD_LOCALS 82
#define RETURN_VALUE 83
-/*
-#define REQUIRE_ARGS 84
-#define REFUSE_ARGS 85
-*/
+
#define BUILD_FUNCTION 86
#define POP_BLOCK 87
#define END_FINALLY 88
@@ -113,14 +110,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define LOAD_LOCAL 115 /* Index in name list */
#define LOAD_GLOBAL 116 /* Index in name list */
-#define LOAD_FAST 117 /* Local variable number */
-#define STORE_FAST 118 /* Local variable number */
-#define RESERVE_FAST 119 /* Number of local variables */
-
#define SETUP_LOOP 120 /* Target address (absolute) */
#define SETUP_EXCEPT 121 /* "" */
#define SETUP_FINALLY 122 /* "" */
+#define RESERVE_FAST 123 /* Number of local variables */
+#define LOAD_FAST 124 /* Local variable number */
+#define STORE_FAST 125 /* Local variable number */
+#define DELETE_FAST 126 /* Local variable number */
+
#define SET_LINENO 127 /* Current line number */
/* Comparison operator codes (argument to COMPARE_OP) */