Skip to content
Tcl Source Code Check-in [8727b42c2c]
Login

Check-in [8727b42c2c]

Overview
Comment: Patch 876451: restores performance of [return]. Also allows forms such as [return -code error $msg] to be bytecompiled. * generic/tclInt.h: Factored Tcl_ReturnObjCmd() into two pieces: * generic/tclCmdMZ.c: TclMergeReturnOptions(), which can parse the options to [return], check their validity, and create the corresponding return options dictionary, and TclProcessReturn(), which takes that return options dictionary and performs the [return] operation. * generic/tclCompCmds.c: Rewrote TclCompileReturnCmd() to call TclMergeReturnOptions() at compile time so the return options dictionary is computed at compile time (when it is fully known). The dictionary is pushed on the stack along with the result, and the code and level values are included in the bytecode as operands. Also supports optimized compilation of un-[catch]ed [return]s from procs with default options into the INST_DONE instruction. * generic/tclExecute.c: Rewrote INST_RETURN instruction to retrieve the code and level operands, pop the return options from the stack, and call TclProcessReturn() to perform the [return] operation. * generic/tclCompile.h: New utilities include TclEmitInt4 macro * generic/tclCompile.c: and TclWordKnownAtCompileTime().
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8727b42c2ce485832b263a35304846b1b59acfc7
User & Date: dgp on 2004-01-13 23:15:02.000
Other Links: manifest | tags
Context
2004-01-13
23:37
* generic/tclCmdMZ.c (Tcl_SwitchObjCmd): Silence compiler warnings. check-in: b986a19bed user: dgp tags: trunk
23:15
Patch 876451: restores performance of [return]. Also allows forms such as [return -... check-in: 8727b42c2c user: dgp tags: trunk
17:13
more detail check-in: ea75b3a19d user: dgp tags: trunk
Changes