summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* 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:
* * generic/tclExecute.c (INST_RETURN): Bytecompiled [return] faileddgp2003-04-011-1/+2
| | | | | | to reset iPtr->returnCode, causing tests parse-18.17 and parse-18.21 to fail strangely. * tests/parse.test (parse-18.21): Corrected now functioning test.
* * generic/tclCompCmds.c (TclCompileReturnCmd): Alternative fix fordgp2003-03-191-1/+3
| | | | | | | * generic/tclCompile.c (INST_RETURN): [Bug 633204] that uses a new * generic/tclCompile.h (INST_RETURN): bytecode INST_RETURN to * generic/tclExecute.c (INST_RETURN): properly bytecode the [return] command to something that returns TCL_RETURN.
* * generic/tclBasic.c (Tcl_EvalTokensStandard):dgp2003-03-131-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdMZ.c (Tcl_SubstObj): * generic/tclCompCmds.c (TclCompileSwitchCmd): * generic/tclCompExpr.c (CompileSubExpr): * generic/tclCompile.c (TclSetByteCodeFromAny,TclCompileScript, TclCompileTokens,TclCompileCmdWord): * generic/tclCompile.h (TclCompileScript): * generic/tclExecute.c (TclCompEvalObj): * generic/tclInt.h (Interp,TCL_BRACKET_TERM,TclSubstTokens): * generic/tclParse.c (ParseTokens,Tcl_SubstObj,TclSubstTokens): * tests/subst.test (2.4, 8.7, 8.8, 11.4, 11.5): Substantial refactoring of Tcl_SubstObj to make use of the same parsing and substitution procedures as normal script evaluation. Tcl_SubstObj() moved to tclParse.c. New routine TclSubstTokens() created in tclParse.c which implements all substantial functioning of Tcl_EvalTokensStandard(). TclCompileScript() loses its "nested" argument, the Tcl_Interp struct loses its termOffset field and the TCL_BRACKET_TERM flag in the evalFlags field, all of which were only used (indirectly) by Tcl_SubstObj(). Tests subst-8.7,8.8,11.4,11.5 modified to accomodate the only behavior change: reporting of parse errors now takes precedence over [return] and [continue] exceptions. All other behavior should
* * generic/tclCompile.c (TclCompileExprWords): remove unusedMiguel Sofer2003-02-191-3/+1
| | | | | | | | | variable "range" [Bug 664743] * generic/tclExecute.c (ExprSrandFunc): remove unused variable "result" [Bug 664743] * generic/tclStringObj.c (UpdateStringOfString): remove unused variable "length" [Bug 664751] * tests/execute.test (execute-7.30): fix for [Bug 664775]
* * generic/tclExecute.c (TclExecuteByteCode INST_STR_MATCH):hobbs2003-02-181-3/+9
| | | | | | | | | | | | * generic/tclCmdMZ.c (Tcl_StringObjCmd STR_MATCH): * generic/tclUtf.c (TclUniCharMatch): * generic/tclInt.decls: add private TclUniCharMatch function that * generic/tclIntDecls.h: does string match on counted unicode * generic/tclStubInit.c: strings. Tcl_UniCharCaseMatch has the * tests/string.test: failing that it can't handle strings or * tests/stringComp.test: patterns with embedded NULLs. Added tests that actually try strings/pats with NULLs. TclUniCharMatch should be TIPed and made public in the next minor version rev.
* * generic/tclExecute.c (TclExecuteByteCode): When anmdejong2003-02-061-1/+2
| | | | | | | | | | | | | error is encountered reading the increment value during a compiled call to incr, add a "(reading increment)" error string to the errorInfo variable. This makes the errorInfo variable set by the compiled incr command match the value set by the non-compiled version. * tests/incr-old.test: Change errorInfo result for the compiled incr command case to match the modified implementation. * tests/incr.test: Add tests to make sure the compiled and non-compiled errorInfo messages are the same.
* * generic/tclExecute.c (TclExprFloatError): Use the IS_NAN macrodgp2003-01-081-2/+2
| | | | for greater clarity of code.
* * generic/tclExecute.c (TclExecuteByteCode): improve INST_STR_CMPhobbs2002-11-121-10/+19
| | | | | to use memcmp in the one-byte/char case, also use direct index for INST_STR_INDEX in that case.
* Removing more CONST-related warnings.dkf2002-09-241-11/+12
|
* * generic/tclExecute.c: bugfix (reading freed memory). TestsuiteMiguel Sofer2002-08-011-22/+18
| | | | passed on linux/i386, compile-13.1 hung on linux/alpha.
* * generic/tclInt.h (USE_THREAD_ALLOC): for unshared objects,Miguel Sofer2002-08-011-19/+73
|
* Comment formatting fixesdkf2002-07-311-46/+46
|
* * generic/tclExecute.c: fixed Tcl_Obj leak in code correspondingMiguel Sofer2002-07-271-2/+2
| | | | to the macro NEXT_INST_V(x, 0, 1) [Bug 587495].
* * generic/tclExecute.c:Miguel Sofer2002-07-261-6/+55
| | | | | * tests/expr-old.test: fix for erroneous error messages in [expr], [Bug 587140] reported by Martin Lemburg.
* * generic/tclExecute.c: restoring full TCL_COMPILE_DEBUGMiguel Sofer2002-07-241-239/+117
| | | | functionality.
* * generic/tclExecute.c: restoring the tcl_traceCompile functionalityMiguel Sofer2002-07-241-1/+7
| | | | | | while I repair tcl_traceExec. The core now compiles and runs also under TCL_COMPILE_DEBUG, but execution in the bytecode engine can still not be traced.
* Allowed parser to recognise 'Inf' as a floating-point number. [Bug 218000]dkf2002-07-221-2/+19
| | | | Also produce better error messages when this happens.
* Global symbols are now all either prefixed with 'tcl' (or 'Tcl' or ...) or ↵dkf2002-07-191-7/+6
| | | | have file-scope.
* Minor changes to make things build with SunPro CC...dkf2002-07-171-2/+6
|
* variable access optimisationsMiguel Sofer2002-07-171-240/+410
|
* using the new variable name caching possibilities when setting errorMiguel Sofer2002-07-161-1/+9
| | | | results in (Tcl_AddObjErrorInfo) and (TclUpdateReturnInfo)
* Fix for bug 579284; registered math funcs can now correctly return wide-ints.dkf2002-07-101-4/+8
|
* * generic/tclExecute.c (TclCompEvalObj): clarified and simplified theMiguel Sofer2002-06-201-49/+39
| | | | logic for compilation/recompilation.
* Added parens for claritydgp2002-06-201-2/+2
|
* generic/tclExecute.c (TEBC): removing unused "for(;;)" loop; improvedMiguel Sofer2002-06-191-2581/+2562
| | | | comments; re-indentation.
* * generic/tclExecute.c (TEBC): elimination of duplicated code in theMiguel Sofer2002-06-181-545/+416
| | | | | | non-immediate INST_INCR instructions; elimination of 103 (!) TclDecrRefCount macros. The different instructions now jump back to a common "DecrRefCount zone" at the topof the loop.