diff options
author | dkf <dkf@noemail.net> | 2013-12-23 18:32:17 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2013-12-23 18:32:17 (GMT) |
commit | 7396a7efe9e54eef7f07fe5fbf3139dfbb946e47 (patch) | |
tree | 6282fcbeda8091900bc7600acae7bdba8824a3d1 /generic/tclCompile.h | |
parent | 7fed7231c23202de9144bcb28ec4745e418b40e8 (diff) | |
parent | 26ac7a1630fdd3773756193d5d558190c13ae05e (diff) | |
download | tcl-7396a7efe9e54eef7f07fe5fbf3139dfbb946e47.zip tcl-7396a7efe9e54eef7f07fe5fbf3139dfbb946e47.tar.gz tcl-7396a7efe9e54eef7f07fe5fbf3139dfbb946e47.tar.bz2 |
merge trunk
FossilOrigin-Name: 9dfb1c05dd807950c20b8a6fa685c06a5d7f9612
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index b2a4b52..6226f7f 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -1074,7 +1074,7 @@ MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr, MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr); MODULE_SCOPE int TclLog2(int value); #endif -MODULE_SCOPE void TclOptimizeBytecode(CompileEnv *envPtr); +MODULE_SCOPE void TclOptimizeBytecode(void *envPtr); #ifdef TCL_COMPILE_DEBUG MODULE_SCOPE void TclPrintByteCodeObj(Tcl_Interp *interp, Tcl_Obj *objPtr); @@ -1089,8 +1089,6 @@ MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp, Tcl_Token *varTokenPtr, CompileEnv *envPtr, int flags, int *localIndexPtr, int *isScalarPtr); -MODULE_SCOPE int TclRegisterLiteral(CompileEnv *envPtr, - char *bytes, int length, int flags); MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr); MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp, const char *name, Namespace *nsPtr); @@ -1181,6 +1179,21 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); (envPtr)->currStackDepth += (delta); \ } while (0) +#define TclGetStackDepth(envPtr) \ + ((envPtr)->currStackDepth) + +#define TclSetStackDepth(depth, envPtr) \ + (envPtr)->currStackDepth = (depth) + +#define TclCheckStackDepth(depth, envPtr) \ + do { \ + int dd = (depth); \ + if (dd != (envPtr)->currStackDepth) { \ + Tcl_Panic("bad stack depth computations: is %i, should be %i", \ + (envPtr)->currStackDepth, dd); \ + } \ + } while (0) + /* * Macro used to update the stack requirements. It is called by the macros * TclEmitOpCode, TclEmitInst1 and TclEmitInst4. @@ -1321,6 +1334,18 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); } while (0) /* + * If the expr compiler finished with TRY_CONVERT, macro to remove it when the + * job is done by the following instruction. + */ + +#define TclClearNumConversion(envPtr) \ + do { \ + if (*(envPtr->codeNext - 1) == INST_TRY_CVT_TO_NUMERIC) { \ + envPtr->codeNext--; \ + } \ + } while (0) + +/* * Macros to update a (signed or unsigned) integer starting at a pointer. The * two variants depend on the number of bytes. The ANSI C "prototypes" for * these macros are: |