summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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.
* Removed variables that are no longer used.dgp2003-10-211-2/+1
|
* * generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routinedgp2003-10-141-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | that appends a Tcl_Obj to the errorInfo, saving the caller the trouble of extracting the string rep. * generic/tclStringObj.c (TclAppendLimitedToObj): New internal routine that supports truncated appends with optional ellipsis marking. This single routine supports UTF-8-safe truncated appends needed in several places throughout the Tcl source code, mostly for error and stack messages. Clean fix for [Bug 760872]. * generic/tclInt.h: Declarations for new internal routines. * generic/tclCmdMZ.c: Updated callers to use the new routines. * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclProc.c: * generic/tclStringObj.c: * mac/tclMacResource.c: * library/init.tcl: Updated ::errorInfo cleanup in [unknown] to reflect slight modifications to Tcl_LogCommandInfo(). Corrects failing init-4.* tests.
* fix for [Bug 816641] - faulty execution and catch stack management.Miguel Sofer2003-10-041-19/+16
|
* fix failure of previous commit on Alpha platformMiguel Sofer2003-09-231-26/+18
|
* * generic/tclExecute.c:Miguel Sofer2003-09-231-158/+146
| | | | | | * generic/tclInt.h: changed the evaluation-stack addressing mode, from array-style to pointer-style; the catch stack and evaluation stack are now contiguous in memory. [Patch 457449]
* * generic/tclExecute.c: adding (DE)CACHE_STACK_INFO() pairs to protect all ↵Miguel Sofer2003-09-191-17/+77
| | | | | | calls that may cause traces on ::errorInfo or ::errorCode to corrupt the stack [Bug 804681] ----------------------------------------------------------------------
* TIP#123 Implementation based on work by Arjen Markus. [Patch 655176]dkf2003-09-121-11/+200
|
* * generic/tclexecute.c (INST_INVOKE, INST_EVAL, INST_PUSH_RESULT):Miguel Sofer2003-08-051-4/+30
| | | | | | | | added a Tcl_ResetResult(interp) at each point where the interp's result is pushed onto the stack, to avoid keeping an extra reference that may cause costly Tcl_Obj duplication [Bug 781585] Detected by Franco Violi, analyzed by Peter Spjuth and Donal Fellows.
* Modified expression of tests and added comments for easier understandingdgp2003-06-271-7/+40
| | | | by future maintainers.
* fix for previous commitMiguel Sofer2003-06-101-1/+2
|
* * generic/tclBasic.c:Miguel Sofer2003-06-101-3/+5
| | | | | | | * generic/tclExecute.c: let TclExecuteObjvInternal call TclInterpReady instead of relying on its callers to do so; fix for the part of [Bug 495830] that is new in 8.4. * tests/interp.test: Added tests 18.9 (knownbug) and 18.10
* * generic/tclBasic.c: Implementation of TIP 90, whichdgp2003-05-051-2/+11
| | | | | | | | | | | | | | | | * generic/tclCmdAH.c: extends the [catch] and [return] * generic/tclCompCmds.c: commands to enable creation of a * generic/tclExecute.c: proc that is a replacement for * generic/tclInt.h: [return]. [Patch 531640] * generic/tclProc.c: * generic/tclResult.c: * tests/cmdAH.test: * tests/cmdMZ.test: * tests/error.test: * tests/proc-old.test: * library/tcltest/tcltest.tcl: The -returnCodes option to [test] failed to recognize the symbolic name "ok" for return code 0.
* Made [incr] able to accept and work with wide increments [Bug 728838]dkf2003-04-281-27/+56
|
* * generic/tclExecute.c (ExprCallMathFunc): remove incorrecthobbs2003-04-181-2/+2
| | | | extraneous cast from Tcl_WideAsDouble.
* * generic/tcl.h Made changes so that the "wideInt" Tcl_ObjTypedgp2003-04-161-190/+63
| | | | | | | | | | | | | | | | | | | | | | * generic/tclObj.c is defined on all platforms, even those where * generic/tclPort.h TCL_WIDE_INT_IS_LONG is defined. Also made the Tcl_Value struct have a wideValue field on all platforms. This is a ***POTENTIAL INCOMPATIBILITY*** for TCL_WIDE_INT_IS_LONG platforms because that struct changes size. This is the same TIP 72 incompatibility that was seen on other platforms at the 8.4.0 release, when this change should have happened as well. [Bug 713562] * generic/tclInt.h: New internal macros TclGetWide() and TclGetLongFromWide() to deal with both forms of the "wideInt" Tcl_ObjType, so that conditional TCL_WIDE_INT_IS_LONG code is confined to the header file. * generic/tclCmdAH.c: Replaced most coding that was conditional * generic/tclCmdIL.c: on TCL_WIDE_INT_IS_LONG with code that * generic/tclExecute.c: works across platforms, sometimes using * generic/tclTest.c: the new macros above to do it. * generic/tclUtil.c: * generic/tclVar.c: