summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclExecute.c (INST_DICT_*): stop 2 compilerMiguel Sofer2005-07-231-2/+3
| | | | warnings for uninitialised variables.
* Improve the incrementer code for INST_DICT_INCR_IMM, removing a gcc-ism.dkf2005-07-221-9/+25
|
* Compiler for [dict] and related changes.dkf2005-07-211-4/+525
|
* Purely style-guide cleansingdkf2005-07-111-2163/+2063
|
* * generic/tclExecute.c (TclExecuteByteCode):mdejong2005-07-091-49/+141
| | | | | | | | | | | | | | | | | Reimplement long and wide type integer division and modulus operations so that the smallest and largest integer values are handled properly. The divide operation is more efficient since it no longer does a modulus or negation and only checks for a remainder when the quotient will be a negative number. The modulus operation is now a bit more complex because of a number of special cases dealing with the smallest and largest integers. * tests/expr.test: Add test cases for division and modulus operations on the smallest and largest integer values for 32 and 64 bit types. [Patch 1230205]
* * generic/tclExecute.c (TclExecuteByteCode):mdejong2005-06-291-5/+29
| | | | | | | | | | | When parsing an integer operand for a unary minus expression operator, check for a wide integer that is actually LONG_MIN. If found, convert it back to a long int type. * tests/expr.test: Add constraint for 32bit long int type and 64bit wide int type. Add tests that parse the smallest/largest long int and wide int values.
* typosdkf2005-06-201-1/+2
|
* Add compilation for TIP#90-style [catch] requiring a new opcode [Bug1219112]dkf2005-06-201-153/+149
|
* * generic/tclBasic.c (Tcl_ExprBoolean): Rewrite as wrapper arounddgp2005-05-181-46/+31
| | | | | | | | | | | | | | | | Tcl_ExprBooleanObj. * generic/tclCmdMZ.c ([string is boolean/true/false]): Rewrite dropping string-based Tcl_GetBoolean call, so that internal reps are kept for subsequent quick boolean operations. * generic/tclExecute.c: Dropped most special handling of the "boolean" Tcl_ObjType, since that type should now be rarely encountered. * doc/BoolObj.3: Rewrite of documentation dropping many details about the internals of Tcl_Objs. Shorter documentation focuses on the function and use of the routines.
* * generic/tclBasic.c: Dropped the TCL_NO_MATH configuration.dgp2005-05-131-4/+2
| | | | | | * generic/tclBinary.c: It's believed this has not been working * generic/tclExecute.c: in a long time. Tcl needs math.h. * unix/Makefile.in: [RFE 1200680].
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-865/+32
|
* * generic/tclExecute.c (ExponLong, ExponWide): fixed special caseMiguel Sofer2005-05-101-3/+3
| | | | 'i**0' for i>0 [Bug 1198892]
* fix commentsMiguel Sofer2005-04-251-2/+5
|
* * generic/tclExecute.c: fix for [Bug 1189274].Miguel Sofer2005-04-251-2/+2
|
* The 2005-04-21 changes to Tcl_GetBooleanFromObj were done to bringdgp2005-04-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | it into agreement with its docs. Further investigation reveals it was the docs that were incorrect. * doc/BoolObj.3: Corrections to the documentation of Tcl_GetBooleanFromObj to bring it into agreement with what this public interface has always done, including noting the difference in function between Tcl_GetBooleanFromObj and Tcl_GetBoolean. * generic/tclGet.c: Revised Tcl_GetBoolean to no longer be a wrapper around Tcl_GetBooleanFromObj (different function!). * generic/tclObj.c: Removed TclGetTruthValueFromObj routine that was added yesterday. Revisions so that only Tcl_GetBoolean-approved values get the "boolean" Tcl_ObjType. This retains the fix for [Bug 1187123]. * generic/tclInt.h: Revert most recent change. * generic/tclBasic.c: * generic/tclCompCmds.c: * generic/tclDictObj.c: * generic/tclExecute.c: * tests/obj.test:
* * generic/tclGet.c: Radical code simplification. Converteddgp2005-04-211-5/+5
| | | | | | | | | | | | | | | | | | Tcl_GetFoo() routines into wrappers around Tcl_GetFooFromObj(). Reduces code duplication, and the resulting potential for inconsistency. * generic/tclObj.c: Several changes: - Fixed Tcl_GetBooleanFromObj to agree with its documentation and with Tcl_GetBoolean, accepting only "0" and "1" and not other numeric strings. [Bug 1187123] - Added new private routine TclGetTruthValueFromObj to perform the more permissive conversion of numeric values to boolean that is needed by the [expr] machinery. * generic/tclInt.h (TclGetTruthValueFromObj): New routine. * generic/tclExecute.c: Updated callers to call new routine. * tests/obj.test: Corrected bad tests that actually expected values like "47" and "0xac" to be accepted as booleans.
* * generic/tclExecute.c: missing semicolons caused failure toMiguel Sofer2005-04-151-3/+3
| | | | compile with TCL_COMPILE_DEBUG.
* fix in last commitMiguel Sofer2005-04-091-6/+7
|
* * generic/tclExecute.c: fix possible leak of expansion Tcl_ObjsMiguel Sofer2005-04-091-3/+12
|
* * generic/tclExecute.c (ExprSrandFunc): Replaced incursions into thedgp2005-04-051-6/+2
| | | | | | | * generic/tclUtil.c (TclGetIntForIndex): intreps of numeric types with simpler calls of Tcl_GetIntFromObj and Tcl_GetLongFromObj, now that those routines are better behaved wrt shimmering. [Patch 1177219]
* * generic/tclExecute.c: small opts in obj handlingMiguel Sofer2005-04-041-61/+46
|
* Changed the internal representation of lists to (a) reduce the malloc/freeMiguel Sofer2005-04-021-5/+4
| | | | | | | | calls at list creation (from 2 to 1), (b) reduce the cost of handling empty lists (we now never create a list internal rep for them), (c) allow refcounting of the list internal rep. The latter permits insuring that the pointers returned by Tcl_ListObjGetElements remain valid even if the object shimmers away from its original list type. This is [Patch 1158008]
* slight reduction in cost of INST_START_CMDMiguel Sofer2005-04-011-7/+29
|
* * generic/tclExecute.c:Miguel Sofer2005-04-011-4/+11
| | | | | * generic/tclInt.h: ExecEnv now stores two Tcl_Obj* pointing to the constants "0" and "1", for use by TEBC.
* * generic/tclExecute.c:Miguel Sofer2005-04-011-82/+96
| | | | | | | | | * generic/tclInt.h: * generic/tclObj.c: * generic/tclStringObj.c: defined new internal macros for creating and setting frequently used obj types (int,long, wideInt, double, string). Changed TEBC to use eg 'TclNewIntObj(objPtr, i)' to avoid the function call in 'objPtr = Tcl_NewIntObj(i)'
* * generic/tclExecute.c (INST_JUMP_TRUE/FALSE): replacedMiguel Sofer2005-03-311-70/+58
| | | | "test and branch" with "compute index into table"
* * generic/tclExecute.c: fixed INST_PUSH1's debugging code (wrongMiguel Sofer2005-03-141-2/+2
| | | | obj ref passed to TRACE_WITH_OBJ).
* * generic/tclExecute.c: new peephole optimisation for INST_PUSH1;Miguel Sofer2005-03-071-6/+27
| | | | | fixed the peephole opt in INST_POP so that it is not used when TCL_COMPILE_DEBUG is defined.
* * generic/tclExecute.c (TclCompEvalObj): Removed stray statementdgp2005-02-011-2/+1
| | | | left behind in prior code reorganization.
* Avoid sharing cmdName literals accross namespaces, and generalise usage ofMiguel Sofer2004-12-241-2/+2
| | | | the TclRegisterNewLiteral macro [Patch 1090905]
* * generic/tclTest.c: Added two new functions to allocate memoryMiguel Sofer2004-12-151-1/+82
| | | | | | | | | | from the execution stack (TclStackAlloc, TclStackFree). Added functions TclPushStackFrame and TclPopStackFrame that do the work of Tcl_PushCallFrame and Tcl_PopCallFrame, but using frames allocated in the execution stack - i.e., heap instead of C-stack. The core uses these two new functions exclusively; the old ones remain for backwards compat, as at least two popular extensions (itcl, xotcl) are known to use them.
* * generic/tclInt.h: Moved verification of ptrdiff_t typedef fromdgp2004-11-121-7/+1
| | | | | * generic/tclExecute.c: multiple .c files into one common header where * generic/tclVar.c: it is verifiably after tclConfig.h inclusion.
* Final fix for NaN != NaN bug. Thanks to Miguel Sofer for his improved patch.dkf2004-11-021-10/+62
| | | | [Bug 761471]
* Remove unused labeldkf2004-11-011-2/+1
|
* Fix for [Bug 761471]; NaN is now *never* equal to NaN...dkf2004-11-011-19/+5
|
* fix for execution stack corruption [Bug 1055676]. Credit dgp for detectiveMiguel Sofer2004-10-281-1/+3
| | | | work and fix.
* * 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
|