diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2003-03-05 22:31:16 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2003-03-05 22:31:16 (GMT) |
commit | e4cd55ecc463e7976f7d9ef3a54b2fb969751de2 (patch) | |
tree | 5d0b3c72d7b244d7ab119815c7ae33c63b7600f8 /generic/tclCompile.h | |
parent | 880c8a7c3f2373e130125a14d03ca020521fea1e (diff) | |
download | tcl-e4cd55ecc463e7976f7d9ef3a54b2fb969751de2.zip tcl-e4cd55ecc463e7976f7d9ef3a54b2fb969751de2.tar.gz tcl-e4cd55ecc463e7976f7d9ef3a54b2fb969751de2.tar.bz2 |
The [switch] command is now bytecode compiled, at least in the most common
case. There's room for improvement in the future, of course. [Patch #644819]
Also adds another macro to help with jump offset fixups.
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index de6bf24..8d5e209 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.34 2003/03/05 22:31:23 dkf Exp $ */ #ifndef _TCLCOMPILATION @@ -980,6 +980,20 @@ EXTERN int TclCompileVariableCmd _ANSI_ARGS_(( #define TclUpdateInstInt4AtPc(op, i, pc) \ *(pc) = (unsigned char) (op); \ TclStoreInt4AtPtr((i), ((pc)+1)) + +/* + * Macro to fix up a forward jump to point to the current + * code-generation position in the bytecode being created (the most + * common case). The ANSI C "prototypes" for this macro is: + * + * EXTERN int TclFixupForwardJumpToHere _ANSI_ARGS_((CompileEnv *envPtr, + * JumpFixup *fixupPtr, int threshold)); + */ + +#define TclFixupForwardJumpToHere(envPtr, fixupPtr, threshold) \ + TclFixupForwardJump((envPtr), (fixupPtr), \ + (envPtr)->codeNext-(envPtr)->codeStart-(fixupPtr)->codeOffset, \ + (threshold)) /* * Macros to get a signed integer (GET_INT{1,2}) or an unsigned int @@ -1039,8 +1053,3 @@ EXTERN int TclCompileVariableCmd _ANSI_ARGS_(( # define TCL_STORAGE_CLASS DLLIMPORT #endif /* _TCLCOMPILATION */ - - - - - |