summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclBasic.c: added new CompileProc invocations to basichobbs2001-05-171-231/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command initialization. * generic/tclCompCmds.c: added new compile commands for append, lappend, lindex and llength. Refactored set and incr compile commands to use new TclPushVarName function for handling the varname component during compilation (also used by append and lappend). Changed string compile command to compile toplevel code as well (when possible). * generic/tclCompile.c: added new instruction enums * generic/tclCompile.h: added debug info for new instructions * generic/tclExecute.c (TclExecuteByteCode): moved elemPtr to toplevel var (oft-used). Added definitions for new bytecode instructions INST_LIST_INDEX, INST_LIST_LENGTH, INST_APPEND_SCALAR1, INST_APPEND_SCALAR4, INST_APPEND_ARRAY1, INST_APPEND_ARRAY4, INST_APPEND_ARRAY_STK, INST_APPEND_STK, INST_LAPPEND_SCALAR1, INST_LAPPEND_SCALAR4, INST_LAPPEND_ARRAY1, INST_LAPPEND_ARRAY4, INST_LAPPEND_ARRAY_STK, INST_LAPPEND_STK. Refactored repititious code for reuse with INST_LOAD_STK (same as INST_LOAD_SCALAR_STK), INST_STORE_STK (same as INST_STORE_SCALAR_STK). Updated INST_STR_CMP with style of fix of 2001-04-06 Fellows [Bug #219201] as that fix only affected the runtime eval'ed "string" (string compare is normally byte-compiled now). We may want to back these out for speed in the future, noting the problems with \x00 comparisons in the docs. * generic/tclInt.h: declarations for new compile commands. * generic/tclVar.c: change TclGetIndexedScalar, TclGetElementOfIndexedArray, TclSetElementOfIndexedArray and TclSetIndexedScalar to use flags. The Set functions now support TCL_APPEND_ELEMENT and TCL_LIST_ELEMENT as well. * generic/tclInt.decls: * generic/tclIntDecls.h: minor signature changes for above.
* rand() gets != seeds in != threads [Bug 416643]Miguel Sofer2001-05-071-2/+8
|
* Avoid panic when there are extra items in the tcl stackMiguel Sofer2001-04-071-3/+7
| | | | [Bug #406709, Patch #414470]
* Added some casts to ClientData that are apparently needed on somedkf2001-03-131-5/+5
| | | | architectures for a clean compile.
* Fixed bug that could leave saved data for [info level] pointing intodkf2001-03-021-10/+34
| | | | unallocated memory.
* 2000-12-14 Don Porter <dgp@users.sourceforge.net>dgp2000-12-141-21/+33
| | | | | | | | | | * generic/tclExecute.c: * tests/expr-old.test: Re-wrote Tcl's [expr rand()] and [expr srand($seed)] implementations, fixing a range error on some 64-bit platforms. Added tests that detect the bug. The rewrite changes the seed -> sequence map on 64-bit platforms, only for seed >= 2^31, a slight incompatibility. [Bug 121072, Patch 102781]
* * docs/scan.n:hobbs2000-12-101-10/+12
| | | | | | | * tests/scan.test: * generic/tclScan.c (Tcl_ScanObjCmd): changed %o and %x to use strtoul instead of strtol to correctly preserve scan<>format conversion of large integers. [Patch #102663, Bug #124600]
* Logical negation "!" can now handle string booleans, provided thosedkf2000-11-241-1/+7
| | | | | values are placed in variables. Resolves bug #119153 as most people will experience it.
* * generic/tclExecute.c (TclExecuteByteCode): INST_STR_INDEX fixedhobbs2000-09-061-13/+32
| | | | | | pedantic cast warning. Corrected support for building with -DTCL_COMPILE_STATS. Added efficiency check of object equality.
* * generic/tclExecute.c (TclExecuteByteCode INST_STR_CMP): addedhobbs2000-06-061-1/+5
| | | | | test of iResult return from memcmp, as memcmp isn't required to return only -1,0,1.
* * generic/tclCompExpr.c: changed INST_STREQ -> INST_STR_EQ,hobbs2000-05-261-40/+168
| | | | | | | | | | | | | | | INST_STRNEQ -> INST_STR_NEQ * generic/tclCompile.c: added streq, strneq, strcmp, strlen & strmatch to the compiled stats instructionTable * generic/tclCompile.h: added instructions INST_STR_CMP, INST_STR_INDEX, INST_STR_MATCH * generic/tclCompCmds.c: added byte compiler support for [string compare|match|index]. * generic/tclExecute.c: Changed INST_STR_(N)EQ to return an Int object and not bother trying to reuse the top stack object. Added INST_STR_CMP, INST_STR_INDEX, INST_STR_MATCH bytecode ops. Extended evalstats output info with Tcl_IsShared stat info.
* * generic/tclInt.h: Added function prototypes forericm2000-05-231-1/+20
| | | | | | | | | | | | | | | | | | | | | | TclCompileStringCmd and TclCompileReturnCmd. * generic/tclCompile.h: Added definition of INST_STRLEN opcode and updated LAST_INST_OPCODE value. * generic/tclBasic.c: Added information about TclCompileStringCmd and TclCompileReturnCmd to BuiltInCmds table. * generic/tclExecute.c (TclExecuteByteCode): Added support for the INST_STRLEN opcode. * generic/tclCompCmds.c (TclCompileStringCmd): Basic implementation of byte-compiled [string] command. Not all subcommands are implemented; those that are not an out-line compiled. (TclCompileReturnCmd): Byte-compiled implementation of [return] command. Only "simple" returns are byte-compiled; in particular, if the -code, -errorinfo or -errorcode flags are used, the command is not byte-compiled.
* * doc/expr.n:hobbs2000-05-091-2/+53
| | | | | | | | | | | | * tests/expr.test: * tests/expr-old.test: added tests for 'eq' and 'ne' * generic/tclExecute.c: * generic/tclCompile.h: added INST_STREQ and INST_STRNEQ opcodes that do strict string comparisons. * generic/tclCompExpr.c: added 'eq' and 'ne' string comparison operators. * generic/tclParseExpr.c (GetLexeme): added 'eq' and 'ne' expr parse terms (string (in)equality check).
* * tests/namespace.test:hobbs2000-03-271-22/+31
| | | | | | | | | * generic/tclNamesp.c (Tcl_Export): added a uniq'ing test to the export list so only one instance of each export pattern would exist in the list. * generic/tclExecute.c (TclExecuteByteCode): optimized case for the empty string in ==/!= comparisons
* * tests/var.test:hobbs1999-12-121-35/+52
| | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c: fixed problem where setting to {} array would intermittently not work. (Fontaine) [Bug: 3339] * generic/tclCmdMZ.c: * generic/tclExecute.c: optimized INST_TRY_CVT_TO_NUMERIC to recognize boolean objects. (Spjuth) [Bug: 2815] * tests/info.test: * tests/parseOld.test: * generic/tclCmdAH.c: * generic/tclProc.c: changed Tcl_UplevelObjCmd (uplevel) and Tcl_EvalObjCmd (eval) to use TCL_EVAL_DIRECT in the single arg case as well, to take advantage of potential pure list input optimization. This means that it won't get byte compiled though, which should be acceptable. * generic/tclBasic.c: made Tcl_EvalObjEx pure list object aware in the TCL_EVAL_DIRECT case for efficiency. * generic/tclUtil.c: made Tcl_ConcatObj pure list object aware, and return a list object in that case [Bug: 2098 2257] * generic/tclMain.c: changed Tcl_Main to not constantly reuse the commandPtr object (interactive case) as it could be shared. (Fellows)
* * tests/expr-old.test:hobbs1999-12-041-228/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/parseExpr.test: * tests/string.test: * generic/tclGet.c: * generic/tclInt.h: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclUtil.c: * generic/tclExecute.c: added TclCheckBadOctal routine to enhance error message checking for when users use invalid octal numbers (like 08), as well as replumbed the Expr*Funcs with a new VerifyExprObjType to simplify type handling. * tests/expr.test: * generic/tclCompile.c: fixed 'bad code length' error for 'expr + {[incr]}' case, with new test case [Bug: 3736] and seg fault on 'expr + {[error]}' (different cause) that was caused by a correct optimization that didn't correctly track how it was modifying the source string in the opt. The optimization was removed, which means that: expr 1 + {[string length abc]} will be not be compiled inline as before, but this should be written: expr {1 + [string length abc]} which will be compiled inline for speed. This prevents expr 1 + {[mindless error]} from seg faulting, and only affects optimizations for degenerate cases [Bug: 3737]
* * tests/execute.test:stanton1999-06-161-4/+4
| | | | | | * generic/tclExecute.c (TclExecuteByteCode): Fixed crash caused by a bug in INST_LOAD_SCALAR1 where the scalar index was read as a signed 1 byte value instead of unsigned. [Bug: 2243]
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-922/+1125
|
* eliminated purify warning and other lintstanton1998-11-191-2/+7
|
* Replaced SCCS strings, fixed binary filescore_8_0_3stanton1998-09-141-1/+1
|
* - modified to use the AuxDataType setup.escoffon1998-07-011-3/+5
|
* removed dead codestanton1998-06-181-3/+0
|
* Initial revisionrjohnson1998-03-261-0/+4929