diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-09-20 12:37:19 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-09-20 12:37:19 (GMT) |
commit | c220fbe2ff72c2408a2e9c303975f80d04fd44e7 (patch) | |
tree | 924c0628c3e395cad796069cd9705d3d20155c45 /generic/tclCompile.h | |
parent | fc7d1ca9fea4659cab0c374e75bfb7bb9f68c37e (diff) | |
parent | f521b724666bd391377bcc556d0f9103750931b7 (diff) | |
download | tcl-c220fbe2ff72c2408a2e9c303975f80d04fd44e7.zip tcl-c220fbe2ff72c2408a2e9c303975f80d04fd44e7.tar.gz tcl-c220fbe2ff72c2408a2e9c303975f80d04fd44e7.tar.bz2 |
Added a script-readable bytecode disassembler in tcl::unsupported.
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index fa4a360..01b78d9 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -48,6 +48,13 @@ MODULE_SCOPE int tclTraceCompile; MODULE_SCOPE int tclTraceExec; #endif + +/* + * The type of lambda expressions. Note that every lambda will *always* have a + * string representation. + */ + +MODULE_SCOPE const Tcl_ObjType tclLambdaType; /* *------------------------------------------------------------------------ @@ -238,6 +245,16 @@ typedef struct AuxDataType { AuxDataPrintProc *printProc;/* Callback function to invoke when printing * the aux data as part of debugging. NULL * means that the data can't be printed. */ + AuxDataPrintProc *disassembleProc; + /* Callback function to invoke when doing a + * disassembly of the aux data (like the + * printProc, except that the output is + * intended to be script-readable). The + * appendObj argument should be filled in with + * a descriptive dictionary; it will start out + * with "name" mapped to the content of the + * name field. NULL means that the printProc + * should be used instead. */ } AuxDataType; /* @@ -832,6 +849,12 @@ typedef enum InstOperandType { * variable table. */ OPERAND_AUX4, /* Four byte unsigned index into the aux data * table. */ + OPERAND_OFFSET1, /* One byte signed jump offset. */ + OPERAND_OFFSET4, /* Four byte signed jump offset. */ + OPERAND_LIT1, /* One byte unsigned index into table of + * literals. */ + OPERAND_LIT4, /* Four byte unsigned index into table of + * literals. */ OPERAND_SCLS1 /* Index into tclStringClassTable. */ } InstOperandType; @@ -1165,12 +1188,15 @@ MODULE_SCOPE void TclVerifyLocalLiteralTable(CompileEnv *envPtr); MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr, Tcl_Obj *valuePtr); MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp, - const char *script, - const char *command, int length, - const unsigned char *pc, Tcl_Obj **tosPtr); + const char *script, const char *command, + int length, const unsigned char *pc, + Tcl_Obj **tosPtr); MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp, - const unsigned char *pc, Tcl_Obj **tosPtr); + const unsigned char *pc, Tcl_Obj **tosPtr); MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); +MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, + register Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[], int isLambda); /* |