summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-01-19 14:06:09 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-01-19 14:06:09 (GMT)
commitb1e9c1d4b650fea5e60a10b7beaad0c893848982 (patch)
tree1d6d0da8a00a3f7253a77e3051f23d247d1fa15d /generic/tclCompile.h
parent04752af27c73732b84dc81b8f2284d5ca83e3962 (diff)
downloadtcl-b1e9c1d4b650fea5e60a10b7beaad0c893848982.zip
tcl-b1e9c1d4b650fea5e60a10b7beaad0c893848982.tar.gz
tcl-b1e9c1d4b650fea5e60a10b7beaad0c893848982.tar.bz2
More efficient issuing of INST_START_CMD instructions. See ChangeLog for discussion
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r--generic/tclCompile.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index a99f501..cba0888 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompile.h,v 1.67 2006/12/13 16:28:06 dkf Exp $
+ * RCS: @(#) $Id: tclCompile.h,v 1.68 2007/01/19 14:06:10 dkf Exp $
*/
#ifndef _TCLCOMPILATION
@@ -281,11 +281,15 @@ typedef struct CompileEnv {
AuxData staticAuxDataArraySpace[COMPILEENV_INIT_AUX_DATA_SIZE];
/* Initial storage for aux data array. */
/* TIP #280 */
- ExtCmdLoc* extCmdMapPtr; /* Extended command location information
+ ExtCmdLoc *extCmdMapPtr; /* Extended command location information
* for 'info frame'. */
- int line; /* First line of the script, based on the
+ int line; /* First line of the script, based on the
* invoking context, then the line of the
* command currently compiled. */
+ int atCmdStart; /* Flag to say whether an INST_START_CMD
+ * should be issued; they should never be
+ * issued repeatedly, as that is significantly
+ * inefficient. */
} CompileEnv;
/*
@@ -957,9 +961,11 @@ MODULE_SCOPE int TclWordSimpleExpansion(Tcl_Token *tokenPtr);
*/
#define TclEmitOpcode(op, envPtr) \
- if ((envPtr)->codeNext == (envPtr)->codeEnd) \
+ if ((envPtr)->codeNext == (envPtr)->codeEnd) { \
TclExpandCodeArray(envPtr); \
+ } \
*(envPtr)->codeNext++ = (unsigned char) (op);\
+ (envPtr)->atCmdStart = ((op) == INST_START_CMD); \
TclUpdateStackReqs(op, 0, envPtr)
/*
@@ -971,8 +977,9 @@ MODULE_SCOPE int TclWordSimpleExpansion(Tcl_Token *tokenPtr);
*/
#define TclEmitInt1(i, envPtr) \
- if ((envPtr)->codeNext == (envPtr)->codeEnd) \
+ if ((envPtr)->codeNext == (envPtr)->codeEnd) { \
TclExpandCodeArray(envPtr); \
+ } \
*(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i))
#define TclEmitInt4(i, envPtr) \
@@ -1004,6 +1011,7 @@ MODULE_SCOPE int TclWordSimpleExpansion(Tcl_Token *tokenPtr);
} \
*(envPtr)->codeNext++ = (unsigned char) (op); \
*(envPtr)->codeNext++ = (unsigned char) ((unsigned int) (i));\
+ (envPtr)->atCmdStart = ((op) == INST_START_CMD); \
TclUpdateStackReqs(op, i, envPtr)
#define TclEmitInstInt4(op, i, envPtr) \
@@ -1019,6 +1027,7 @@ MODULE_SCOPE int TclWordSimpleExpansion(Tcl_Token *tokenPtr);
(unsigned char) ((unsigned int) (i) >> 8); \
*(envPtr)->codeNext++ = \
(unsigned char) ((unsigned int) (i) );\
+ (envPtr)->atCmdStart = ((op) == INST_START_CMD); \
TclUpdateStackReqs(op, i, envPtr)
/*