diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2006-11-28 22:19:57 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2006-11-28 22:19:57 (GMT) |
commit | cbe33e200d3ca39bad40fee86cd50f0c5d0e8958 (patch) | |
tree | dfdbbd337f6bf772d6f99a7a6ea50aaaab685d00 /generic/tclCompile.h | |
parent | daba26a9640b38dd3f1a6264fab38a6643014605 (diff) | |
download | tcl-cbe33e200d3ca39bad40fee86cd50f0c5d0e8958.zip tcl-cbe33e200d3ca39bad40fee86cd50f0c5d0e8958.tar.gz tcl-cbe33e200d3ca39bad40fee86cd50f0c5d0e8958.tar.bz2 |
* generic/tclBasic.c: TIP #280 implementation, conditional on the define TCL_TIP280.
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclCompCmds.c:
* generic/tclCompExpr.c:
* generic/tclCompile.c:
* generic/tclCompile.h:
* generic/tclExecute.c:
* generic/tclIOUtil.c:
* generic/tclInt.h:
* generic/tclInterp.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclProc.c:
* tests/compile.test:
* tests/info.test:
* tests/platform.test:
* tests/safe.test:
FossilOrigin-Name: a88d79cbf88f04a3f3918625a36a4df1d75704a2
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index de6bf24..1769a76 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.33 2002/10/09 11:54:05 das Exp $ + * RCS: @(#) $Id: tclCompile.h,v 1.33.2.1 2006/11/28 22:20:00 andreas_kupries Exp $ */ #ifndef _TCLCOMPILATION @@ -121,6 +121,33 @@ typedef struct CmdLocation { int numSrcBytes; /* Number of command source chars. */ } CmdLocation; +#ifdef TCL_TIP280 +/* + * TIP #280 + * Structure to record additional location information for byte code. + * This information is internal and not saved. I.e. tbcload'ed code + * will not have this information. It records the lines for all words + * of all commands found in the byte code. The association with a + * ByteCode structure BC is done through the 'lineBCPtr' HashTable in + * Interp, keyed by the address of BC. Also recorded is information + * coming from the context, i.e. type of the frame and associated + * information, like the path of a sourced file. + */ + +typedef struct ECL { + int srcOffset; /* cmd location to find the entry */ + int nline; + int* line; /* line information for all words in the command */ +} ECL; +typedef struct ExtCmdLoc { + int type; /* Context type */ + Tcl_Obj* path; /* Path of the sourced file the command is in */ + ECL* loc; /* Command word locations (lines) */ + int nloc; /* Number of allocated entries in 'loc' */ + int nuloc; /* Number of used entries in 'loc' */ +} ExtCmdLoc; +#endif + /* * CompileProcs need the ability to record information during compilation * that can be used by bytecode instructions during execution. The AuxData @@ -264,6 +291,14 @@ typedef struct CompileEnv { /* Initial storage for cmd location map. */ AuxData staticAuxDataArraySpace[COMPILEENV_INIT_AUX_DATA_SIZE]; /* Initial storage for aux data array. */ +#ifdef TCL_TIP280 + /* TIP #280 */ + 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. */ +#endif } CompileEnv; /* @@ -727,8 +762,14 @@ EXTERN int TclInterpReady _ANSI_ARGS_((Tcl_Interp *interp)); *---------------------------------------------------------------- */ +#ifndef TCL_TIP280 EXTERN int TclCompEvalObj _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); +#else +EXTERN int TclCompEvalObj _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Obj *objPtr, CONST CmdFrame* invoker, + int word)); +#endif /* *---------------------------------------------------------------- @@ -784,9 +825,15 @@ EXTERN void TclInitAuxDataTypeTable _ANSI_ARGS_((void)); EXTERN void TclInitByteCodeObj _ANSI_ARGS_((Tcl_Obj *objPtr, CompileEnv *envPtr)); EXTERN void TclInitCompilation _ANSI_ARGS_((void)); +#ifndef TCL_TIP280 EXTERN void TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp *interp, CompileEnv *envPtr, char *string, int numBytes)); +#else +EXTERN void TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp *interp, + CompileEnv *envPtr, char *string, + int numBytes, CONST CmdFrame* invoker, int word)); +#endif EXTERN void TclInitJumpFixupArray _ANSI_ARGS_(( JumpFixupArray *fixupArrayPtr)); EXTERN void TclInitLiteralTable _ANSI_ARGS_(( @@ -1039,8 +1086,3 @@ EXTERN int TclCompileVariableCmd _ANSI_ARGS_(( # define TCL_STORAGE_CLASS DLLIMPORT #endif /* _TCLCOMPILATION */ - - - - - |