summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclExecute.c (IllegalExprOperandType,TclExecuteByteCode):dgp2004-10-251-37/+2
| | | | | | | | | | | | | Removed several DECACHE_INFO/CACHE_INFO pairs that are no longer needed for protection because routines like Tcl_SetErrorCode() and Tcl_AddErrorInfo() can no longer re-enter bytecode execution. * generic/tclResult.c (TclProcessReturn): Bug fix. Be sure that a missing -errorinfo option when code == TCL_ERROR causes the errorInfo field to get reset. * tests/thread.test (thread-4.4): Test depended on a ::errorInfo value initialized to "". Added code to test to setup that requirement.
* defined new macros to get/set the flags of variables.Miguel Sofer2004-10-251-24/+12
|
* Whitespace policedkf2004-10-221-25/+25
|
* Standardize way of calling object freeIntRepProcs...dkf2004-10-221-3/+3
|
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp):dgp2004-10-181-6/+1
| | | | | | | | | | | | * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclCmdMZ.c (TclMergeReturnOptions,TclProcessReturn): * generic/tclCompCmds.c (TclCompileReturnCmd): * generic/tclExecute.c (TclCompEvalObj): * generic/tclInt.h (Interp): * generic/tclProc.c (TclUpdateReturnInfo): Place primary storage of the -level and -code information in private fields of the Interp struct, rather than in a DictObj. This should significantly improve performance of TclUpdateReturnInfo.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclEvalObjvInternal,Tcl_LogCommandInfo,TclAddObjErrorInfo): * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclEvent.c (BgError,ErrAssocData,Tcl_BackgroundError, HandleBgErrors,BgErrorDeleteProc): * generic/tclExecute.c (TclCreateExecEnv,TclDeleteExecEnv): * generic/tclIOUtil.c (comments only): * generic/tclInt.h (ExecEnv,Interp, ERR_IN_PROGRESS): * generic/tclInterp.c ([tclInit]): * generic/tclMain.c (comments only): * generic/tclNamesp.c (Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace): * generic/tclProc.c (TclUpdateReturnInfo): * generic/tclResult.c (Tcl_ResetResult,TclTransferResult): * generic/tclTrace.c (CallVarTraces): Reworked management of the "errorInfo" data of an interp. That information is now primarily stored in a new private (Tcl_Obj *) field of the Interp struct, rather than using a global variable ::errorInfo as the primary storage. The ERR_IN_PROGRESS flag bit value is no longer required to manage the value in its new location, and is removed. Variable traces are established to support compatibility for any code expecting the ::errorInfo variable to hold the information. ***POTENTIAL INCOMPATIBILITY*** Code that sets traces on the ::errorInfo variable may notice a difference in timing of the firing of those traces. Code that uses the value ERR_IN_PROGRESS.
* Core of implementation of TIP#201 ('in' and 'ni' operators)dkf2004-10-081-1/+66
|
* Formatting fixes.dkf2004-10-061-8/+8
|
* * generic/tclBasic.c:dgp2004-10-061-43/+31
| | | | | | | | | | | | | | | | | | | | | * generic/tclBinary.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclDictObj.c: * generic/tclEncoding.c: * generic/tclExecute.c: * generic/tclFCmd.c: * generic/tclHistory.c: * generic/tclIndexObj.c: * generic/tclInterp.c: It is a poor practice to directly set or append to the value of the objResult of an interp, because that value might be shared, and in that circumstance a Tcl_Panic() will be the result. Searched for example of this practice and replaced with safer alternatives, often using the Tcl_AppendResult() routine that dkf just rehabilitated.
* * generic/tclBasic.c: Corrections to the 2004-09-21 commitdgp2004-09-241-1/+2
| | | | | | | | * generic/tclExecute.c: regarding ERR_ALREADY_LOGGED. That commit * generic/tclNamesp.c: caused Tk test send-10.7 to fail. Added * tests/namespace.test (25.7,8): tests in the Tcl test suite * tests/pkg.test (2.25,26): to catch this error without the aid of Tk in the future.
* * generic/tclExecute.c (INST_START_CMD):Miguel Sofer2004-09-221-2/+3
| | | | | * tests/proc.test (7.2-3): fix for [Bug 729692] was incorrect whenever a loop exception was returned.
* * generic/tclBasic.c: Reworked management of the interpdgp2004-09-211-6/+1
| | | | | | | | | | | | | | * generic/tclCompile.c: flag ERR_ALREADY_LOGGED, to reduce * generic/tclExecute.c: its exposure. Still left several * generic/tclNamesp.c: references that are just too nice on performace to do away with. These changes also resolve an inconsistency in the ::errorInfo values produced by [namespace eval x error foo bar] and [namespace eval x {error foo bar}]. * generic/tclExecute.c (TclCompEvalObj): Simplified the TclCompEvalObj routine. Much housekeeping now reliably happens elsewhere. [Patch 1031949]
* * generic/tclExecute.c (TclCompEvalObj): Simplifieddgp2004-09-211-62/+13
| | | | | the TclCompEvalObj routine. Much housekeeping now reliably happens elsewhere. [Patch 1031949]
* Fix silly mistakes :} and make sure that the original bug is a test case.dkf2004-09-181-13/+17
|
* Make sure large shifts shift for real. [Bug 868467]dkf2004-09-181-7/+72
|
* * generic/tclExecute.c (INST_CONCAT1): fix for [Bug 1025834];Miguel Sofer2004-09-111-37/+55
| | | | avoid unnecessary string copies.
* * generic/tclExecute.c (INST_CONCAT1): added a peepholeMiguel Sofer2004-09-101-1/+15
| | | | | | optimisation for concatting an empty string. This enables replacing the idiom 'K $x [set x {}]' by '$x[set x {}]' for fastest execution.
* * generic/tclExecute.c (TEBC): fixed leak of expandNestList objsMiguel Sofer2004-07-111-1/+15
| | | | | when there is an error while an expansion is in progress (code added at checkForCatch).
* added support for wide integers to round(); [Bug 908375], reported byMiguel Sofer2004-07-031-40/+36
| | | | Hemang Lavana.
* * generic/tclCompile.c:Miguel Sofer2004-06-081-3/+3
| | | | * generic/tclExecute.c: handle warning [Bug 969066]
* better (?) #ifdeferry for the last fixMiguel Sofer2004-05-271-1/+6
|
* * generic/tclExecute.c:Miguel Sofer2004-05-271-3/+4
| | | | | * generic/tclVar.c: using (ptrdiff_t) instead of (int) casting to correct compiler warnings [Bug 961657], reported by Bob Techentin.
* * generic/tclExecute.c (VerifyExprObjType): use GET_WIDE_OR_INT tohobbs2004-05-251-2/+3
| | | | | | properly have tclIntType used for smaller values. This corrects TclX bug 896727 and any other 3rd party extension that created math functions but was not yet WIDE_INT aware in them.
* One more fix; this time it really does let this file build...dkf2004-05-211-9/+15
|
* Make TCL_COMPILE_DEBUG path through TEBC work...dkf2004-05-211-7/+7
|
* Variables should only ever be declarated at the start of a block...dkf2004-05-211-3/+3
|
* 2004-05-21 Miguel Sofer <msofer@users.sf.net>Miguel Sofer2004-05-211-1114/+1275
| | | | | | | | | | * generic/tclExecute.c (TclExecuteByteCode): reorganised TEBC automatic variables, defining them in tight blocks instead of at the function level. This has three purposes: - it simplifies the analysis of individual instructions - it is preliminary work to the non-recursive engine - it allows a better register allocation by the optimiser; under gcc3.3, this results in up to 10% runtime in some tests
* * generic/tclExecute.c (TclExecuteByteCode): added comments toMiguel Sofer2004-05-181-21/+56
| | | | classify the variables according to their use in TEBC.
* Improved TIP#143 tests and now track the number of bytecoded commands better.dkf2004-05-171-2/+3
|
* (FIXED PATCH)Miguel Sofer2004-05-171-12/+12
| | | | | * generic/tclExecute.c (TclExecuteByteCode): remove one level of indirection for compiledLocals addressing.
* oops ... reverting last (buggy) commitMiguel Sofer2004-05-171-10/+12
|
* * generic/tclExecute.c (TclExecuteByteCode): remove one level ofMiguel Sofer2004-05-171-12/+10
| | | | indirection for compiledLocals addressing.
* * generic/tclExecute.c (INST_CALL_FUNC1): bugfix; restoredMiguel Sofer2004-05-161-1/+3
| | | | | (DE)CACHE_STACK_INFO pair around the call - the user defined math function could cause a recursive call to TEBC.
* * generic/tclBasic.c (Tcl_DeleteInterp):Miguel Sofer2004-05-161-3/+8
| | | | | | * generic/tclExecute.c (INST_START_CMD): interp deletion now modifies the compileEpoch, eliminating the need for the check for interp deletion in INST_START_CMD.
* * generic/tclCompile.h:Miguel Sofer2004-05-161-99/+90
| | | | | | | | | | | * generic/tclCompile.c: * generic/tclExecute.c: changed implementation of {expand}, last chance while in alpha as ... ***POTENTIAL INCOMPATIBILITY*** Scripts precompiled with ProComp under previous tcl8.5a versions may malfunction due to changed instruction numbers for INST_LIST_INDEX_IMM, INST_LIST_RANGE_IMM and INST_START_CMD.
* * generic/tclExecute.h:Miguel Sofer2004-05-141-250/+74
| | | | | | | * generic/tclCompile.h: the math functions receive a pointer to top of the stack (tosPtr) instead of the execution environment (eePtr). First step towards a change in the execution stack management - it is now only used within TEBC.
* TIP#143 implementation; still needs docs and more tests...dkf2004-05-131-22/+59
|
* Optimisations for INST_START_CMD [Bug 926164].Miguel Sofer2004-05-121-25/+34
| | | | | | | | | * generic/tclCompile.c (TclCompileScript): avoid emitting INST_START_CMD as the first instruction in a bytecoded Tcl_Obj. It is not needed, as the checks are done before calling TEBC. * generic/tclExecute.c (TclExecuteByteCode): runtime peephole optimisation: check at INST_POP if the next instruction is INST_START_CMD, in which case we fall through.
* Patch 922727 committed. Implements three changes:dgp2004-04-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed):
* * generic/tclExecute.c (TEBC): reverting to the previous methodMiguel Sofer2004-03-301-14/+36
| | | | | for async tests in TEBC, as the new method turned out to be too costly. Async tests now run every 64 instructions.
* * generic/tclCompile.c: New instruction code INST_START_CMDMiguel Sofer2004-03-301-34/+46
| | | | | | | | | * generic/tclCompile.h: that allows checking the bytecode's * generic/tclExecute.c: validity [Bug 729692] and the interp's * tests/interp.test (18.9): readyness [Bug 495830] before running * tests/proc.test (7.1): the command. It also changes the * tests/rename.test (6.1): mechanics of the async tests in TEBC, doing it now at command start instead of every 16 instructions.
* Full bytecode compilation for [lassign]dkf2004-01-181-1/+120
|
* Patch 876451: restores performance of [return]. Also allows formsdgp2004-01-131-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* * generic/tclCompExpr.c (CompileLandOrLorExpr): new logic, fewerMiguel Sofer2004-01-121-4/+18
| | | | | | | instructions. As a side effect, the instructions INST_LOR and INST_LAND are now never used. * generic/tclExecute.c (INST_JUMP*): small optimisation; fix a bug in debug code.
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-14/+14
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* Miguel's masking bits had the wrong sense. I should have spotteddkf2003-11-161-2/+2
| | | | this, but he did instead...
* D'oh! instructionCount is post-incremented, not pre-incremented...dkf2003-11-161-3/+4
|
* Miguel Sofer's patch (with small revisions) to make sure the bytecode enginedkf2003-11-161-1/+36
| | | | checks for async events fairly frequently. [Bug 746722]
* * doc/ParseCmd.3: Implementation of TIP 157. Adds recognitiondgp2003-11-141-13/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/Tcl.n: of the new leading {expand} syntax on words. * generic/tcl.h: Parses such words as the new Tcl_Token type * generic/tclBasic.c: TCL_TOKEN_EXPAND_WORD. Updated Tcl_EvalEx * generic/tclCompile.c: and the bytecode compiler/execution engine * generic/tclCompile.h: to recognize the new token type. New opcodes * generic/tclExecute.c: INST_LIST_VERIFY and INST_INVOKE_EXP and a new * generic/tclParse.c: operand type OPERAND_ULIST1 are defined. Docs * generic/tclTest.c: and tests are included. * tests/basic.test: * tests/compile.test: * tests/parse.test: * library/auto.tcl: Replaced several [eval]s used to perform * library/package.tcl: argument expansion with the new syntax. * library/safe.tcl: In the test files lindex.test and lset.test, * tests/cmdInfo.test: replaced use of [eval] to force direct * tests/encoding.test: string evaluation with use of [testevalex] * tests/execute.test: which more directly and robustly serves the * tests/fCmd.test: same purpose. * tests/http.test: * tests/init.test: * tests/interp.test: * tests/io.test: * tests/ioUtil.test: * tests/iogt.test: * tests/lindex.test: * tests/lset.test: * tests/namespace-old.test: * tests/namespace.test: * tests/pkg.test: * tests/pkgMkIndex.test: * tests/proc.test: * tests/reg.test: * tests/trace.test: * tests/upvar.test: * tests/winConsole.test: * tests/winFCmd.test:
* * generic/tclExecute.c (NEXT_INST macros): replaced macro variableMiguel Sofer2003-10-281-10/+10
| | | | "result" by "resultHandling" to avoid confusion.