summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-03-02 10:32:11 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-03-02 10:32:11 (GMT)
commit48983007bc418e8c97a2e3ee2583678ed4a7fad8 (patch)
tree0c0e997fd383d7e41d06b24792e65acc89232733 /generic/tclCompile.h
parent57b319287e05948bc3a93c9517e50e42b59e9f44 (diff)
downloadtcl-48983007bc418e8c97a2e3ee2583678ed4a7fad8.zip
tcl-48983007bc418e8c97a2e3ee2583678ed4a7fad8.tar.gz
tcl-48983007bc418e8c97a2e3ee2583678ed4a7fad8.tar.bz2
Added a scheme to allow aux-data to be printed out for debugging. For this to work, immediate operands referring to aux-data must be identified as such in the instruction descriptor table using OPERAND_AUX4 (all are always 4 bytes).
Rewrote the compiled [dict update] so that it stores critical non-varying data in an aux-data value instead of a (shimmerable) literal. [Bug 1671001]
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r--generic/tclCompile.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index cba0888..b5ad0ba 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.68 2007/01/19 14:06:10 dkf Exp $
+ * RCS: @(#) $Id: tclCompile.h,v 1.69 2007/03/02 10:32:12 dkf Exp $
*/
#ifndef _TCLCOMPILATION
@@ -16,6 +16,8 @@
#include "tclInt.h"
+struct ByteCode; /* Forward declaration. */
+
/*
*------------------------------------------------------------------------
* Variables related to compilation. These are used in tclCompile.c,
@@ -157,6 +159,8 @@ typedef struct ExtCmdLoc {
typedef ClientData (AuxDataDupProc) (ClientData clientData);
typedef void (AuxDataFreeProc) (ClientData clientData);
+typedef void (AuxDataPrintProc)(ClientData clientData,
+ struct ByteCode *codePtr, unsigned int pcOffset);
/*
* We define a separate AuxDataType struct to hold type-related information
@@ -177,6 +181,9 @@ typedef struct AuxDataType {
AuxDataFreeProc *freeProc; /* Callback procedure to invoke when the aux
* data is freed. NULL means no proc need be
* called. */
+ AuxDataPrintProc *printProc;/* Callback function to invoke when printing
+ * the aux data as part of debugging. NULL
+ * means that the data can't be printed. */
} AuxDataType;
/*
@@ -281,8 +288,8 @@ typedef struct CompileEnv {
AuxData staticAuxDataArraySpace[COMPILEENV_INIT_AUX_DATA_SIZE];
/* Initial storage for aux data array. */
/* TIP #280 */
- ExtCmdLoc *extCmdMapPtr; /* Extended command location information
- * for 'info frame'. */
+ ExtCmdLoc *extCmdMapPtr; /* Extended command location information for
+ * 'info frame'. */
int line; /* First line of the script, based on the
* invoking context, then the line of the
* command currently compiled. */
@@ -631,8 +638,10 @@ typedef enum InstOperandType {
* integer, but displayed differently.) */
OPERAND_LVT1, /* One byte unsigned index into the local
* variable table. */
- OPERAND_LVT4 /* Four byte unsigned index into the local
+ OPERAND_LVT4, /* Four byte unsigned index into the local
* variable table. */
+ OPERAND_AUX4, /* Four byte unsigned index into the aux data
+ * table. */
} InstOperandType;
typedef struct InstructionDesc {
@@ -754,6 +763,24 @@ typedef struct JumptableInfo {
MODULE_SCOPE AuxDataType tclJumptableInfoType;
/*
+ * Structure used to hold information about a [dict update] command that is
+ * needed during program execution. These structures are stored in CompileEnv
+ * and ByteCode structures as auxiliary data.
+ */
+
+typedef struct {
+ int length; /* Size of array */
+ int varIndices[1]; /* Array of variable indices to manage when
+ * processing the start and end of a [dict
+ * update]. There is really more than one
+ * entry, and the structure is allocated to
+ * take account of this. MUST BE LAST FIELD IN
+ * STRUCTURE. */
+} DictUpdateInfo;
+
+MODULE_SCOPE AuxDataType tclDictUpdateInfoType;
+
+/*
* ClientData type used by the math operator commands.
*/