summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate various gcc warnings (in -Wextra mode)nijtmans2009-11-181-12/+12
|
* Revert mistaken commitdgp2009-11-161-7/+1
|
* (forward port) Fix [Bug 2891556] and improve test to detect similar ↵ferrieux2009-11-161-1/+7
| | | | manifestations in the future. Add tcltest support for finalization.
* * generic/tclBasic.c: Plug another leak in TCL_EVAL_DIRECTandreas_kupries2009-11-101-9/+9
| | | | | evaluation. Forward port from Tcl 8.5 branch, change by Don Porter.
* * generic/tclBasic.c (TclEvalObjEx): Moved the #280 decrement ofandreas_kupries2009-11-091-8/+7
| | | | | | | refCount for the file path out of the branch after the whole conditional, closing a memory leak. Added clause on structure type to prevent seg.faulting. Forward port from valgrinding the Tcl 8.5 branch.
* [Bug 2889593]: Make [expr round()] give the right error.dkf2009-10-311-2/+2
|
* * generic/tclBasic.c: Completed the NR-enabling of [subst].dgp2009-09-111-2/+2
| | | | | | | | | * generic/tclCmdMZ.c: [Bug 2314561]. * generic/tclCompCmds.c: * generic/tclCompile.c: * generic/tclInt.h: * tests/coroutine.test: * tests/parse.test:
* * generic/tclCompCmds.c (TclCompileSubstCmd): Added a bytecodedgp2009-09-041-2/+2
| | | | | | | | | | | | | * generic/tclBasic.c: compiler routine for the [subst] command. * generic/tclCmdMZ.c: This is a partial solution to the need to * generic/tclCompile.c: NR-enable [subst] since bytecode execution is * generic/tclCompile.h: already NR-enabled. [Bug 2314561] Two new * generic/tclExecute.c: bytecode instructions, INST_NOP and * generic/tclInt.h: INST_RETURN_CODE_BRANCH were added to support * generic/tclParse.c: the new routine. INST_RETURN_CODE_BRANCH is * tests/basic.test: likely to be useful in any future effort to * tests/info.test: add a bytecode compiler routine for [try]. * tests/parse.test:
* * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-14/+148
| | | | | | | | | | | | | | | | | | | | | | | Tcl_EvalEx, TclEvalEx, TclAdvanceContinuations, TclNREvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, TclListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript, TclCompileTokens): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclParse.c (TclSubstTokens, Tcl_SubstObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-24): Extended the parser, compiler, and execution engine with code and attendant data structures tracking the position of continuation lines which are not visible in the resulting script Tcl_Obj*'s, to properly account for them while counting lines for #280.
* TIP #353 IMPLEMENTATIONdgp2009-08-121-2/+2
| | | | | | | | | | | | | | * doc/NRE.3: New public routine Tcl_NRExprObj() permits * generic/tcl.decls: extension commands to evaluate Tcl expressions * generic/tclBasic.c: in NR-enabled command procedures. * generic/tclCmdAH.c: * generic/tclExecute.c: * generic/tclInt.h: * generic/tclObj.c: * tests/expr.test: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c:
* Added *unsupported* command to report an object's representation.dkf2009-08-021-2/+4
|
* fix SunCC warningdas2009-07-231-2/+2
|
* * generic/tclBinary.c: Removed unused variables.dgp2009-07-161-2/+2
| | | | | | | | | | | | | | | | | | * generic/tclCmdIL.c: * generic/tclCompile.c: * generic/tclExecute.c: * generic/tclHash.c: * generic/tclIOUtil.c: * generic/tclVar.c: * generic/tclBasic.c: Silence compiler warnings about ClientData. * generic/tclProc.c: * generic/tclScan.c: Typo in ACCEPT_NAN configuration. * generic/tclStrToD.c: Set floating point control register on MIPS systems so that the gradual underflow expected by Tcl is in effect. [Bug 2819200]
* fix 64bit int <-> ptr cast warningsdas2009-07-141-3/+3
|
* * generic/tclInt.h (TclNRSwitchObjCmd):Kevin B Kenny2009-07-141-2/+2
| | | | | | | * generic/tclBasic.c (builtInCmds): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd): * tests/switch.test (switch-15.1): Make non-bytecoded [switch] command aware of NRE. [Bug 2821401]
* * generic/tclCompile.c (TclInitCompileEnv, EnterCmdWordIndex,andreas_kupries2009-07-141-70/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclCleanupByteCode, TclCompileScript): * generic/tclExecute.c (TclCompileObj, TclExecuteByteCode): * tclCompile.h (ExtCmdLoc): * tclInt.h (ExtIndex, CFWordBC, CmdFrame): * tclBasic.c (DeleteInterpProc, TclArgumentBCEnter, TclArgumentBCRelease, TclArgumentGet, SAVE_CONTEXT, RESTORE_CONTEXT, NRCoroutineExitCallback, TclNRCoroutineObjCmd): * generic/tclCmdAH.c (TclNRForObjCmd, TclNRForIterCallback, ForNextCallback): * generic/tclCmdMZ.c (TclNRWhileObjCmd): Extended the bytecode compiler initialization to recognize the compilation of whole files (NRE enabled 'source' command) and switch to the counting of absolute lines in that case. Further extended the bytecode compiler to track the start line in the generated information, and modified the bytecode execution to recompile an object if the location as per the calling context doesn't match the location saved in the bytecode. This part could be optimized more by using more memory to keep all possibilities which occur around, or by just adjusting the location information instead of a total recompile. Reworked the handling of literal command arguments in bytecode to be saved (compiler) and used (execution) per command (See the TCL_INVOKE_STK* instructions), and not per the whole bytecode. This, and the previous change remove the problems with location data caused by literal sharing (across whole files, but also proc bodies). Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex). The last change causes the hashtable 'lineLABCPtr' to be state which has to be kept per coroutine, like the CmdFrame stack. Reworked the coroutine support code to create, delete and switch the information as needed. Further reworked the tailcall command as well, it has to pop its own arguments when run in a bytecode context to keep a proper stack in 'lineLABCPtr'. Fixed the mishandling of line information in the NRE-enabled 'for' and 'while' commands introduced when both were made to share their iteration callbacks without taking into account that the loop body is found in different words of the command. Introduced a separate data structure to hold all the callback information, as we went over the limit of 4 direct client-data values for NRE callbacks. The above fixes [Bug 1605269].
* Fix [Bug 2414858].dkf2009-05-081-1/+9
|
* * generic/tclBasic.c: Let coroutines start with a much smallerMiguel Sofer2009-05-081-3/+8
| | | | | * generic/tclCompile.h: stack: 200 words (previously was 2000, * generic/tclExecute.c: the same as interps)
* * generic/tclBasic.c (TclObjInvoke): Make sure that a null objProcMiguel Sofer2009-04-301-2/+7
| | | | is not used, use Tcl_NRCallObjProc instead [Bug 2486550].
* * generic/tclBasic.c: NR-enable the handling of unknown commandsMiguel Sofer2009-03-221-19/+44
| | | | [Bug 2502037].
* * generic/tclBasic.c: fixed "leaks" in aliases, imports andMiguel Sofer2009-03-211-2/+7
| | | | | | | * generic/tclInt.h: ensembles. Only remaining known leak * generic/tclInterp.c: is in ensemble unknown dispatch (as it * generic/tclNamesp.c: not NR-enabled) * tests/tailcall.test:
* * generic/tclBasic.c: Fix for (among others) [Bug 2699087]Miguel Sofer2009-03-211-23/+33
| | | | | | | | | * generic/tclCmdAH.c: Tailcalls now perform properly even from * generic/tclExecute.c: within [eval]ed scripts. * generic/tclInt.h: More tests missing, as well as proper exploration and testing of the interaction with "redirectors" like interp-alias (suspect that it does not happen in constant space) and pure-eval commands.
* * generic/tcl.h:Miguel Sofer2009-03-191-53/+49
| | | | | | | | | | | | | | * generic/tclInt.h: * generic/tclBasic.c: * generic/tclExecute.c: * generic/tclNamesp.c (Tcl_PopCallFrame): Rewritten tailcall implementation, ::unsupported::atProcExit is (temporarily?) gone. The new approach is much simpler, and also closer to being correct. This commit fixes [Bug 2649975] and [Bug 2695587]. * tests/coroutine.test: Moved the tests to their own files, * tests/tailcall.test: removed the unsupported.test. Added * tests/unsupported.test: tests for the fixed bugs.
* * generic/tclBasic.c (TclNRCoroutineObjCmd): fix Tcl_Obj leak.Miguel Sofer2009-03-111-2/+1
| | | | Diagnose and fix thx to GPS.
* Move the implementation of [try] from Tcl to C. Not yet bytecoded.dkf2009-03-091-1/+2
|
* - eliminate some unnessary type castsnijtmans2009-02-031-10/+10
| | | | | - some internal const decorations - spacing
* Apply resolution for [Bug 2529157]. Fix another location in tclBasic.c wheredkf2009-01-281-40/+44
| | | | only the objProc case was handled and not the nreProc case.
* * generic/tclBasic.c (Tcl_DeleteCommandFromToken): Reverteddgp2009-01-141-1/+10
| | | | | | | | most of the substance of my 2009-01-12 commit. NULLing the objProc field of a Command when deleting it is important so that tests for certain classes of commands don't return false positives when applied to deleted command tokens. Overall change is now just replacement of a false comment with a true one.
* Move [throw] implementation into C.dkf2009-01-131-1/+2
|
* * generic/tclBasic.c (Tcl_DeleteCommandFromToken): One consequencedgp2009-01-121-11/+1
| | | | | | | | | | | | of the NRE rewrite is that there are now situations where a NULL objProc field in a Command struct is perfectly normal. Removed an outdated comment in Tcl_DeleteCommandFromToken that claimed we use (cmdPtr->objPtr == NULL) as a test of command validity. In fact we use (cmdPtr->flags & CMD_IS_DELETED) to perform that test. Also removed the setting to NULL, since any extension following the advice of the old comment is going to be broken by NRE anyway, and needs to shift to flag-based testing (or stop intruding into such internal matters). Part of [Bug 2486550].
* Style fixes (unfouling whitespace, sorting comments, removing useless casts, ↵dkf2009-01-091-4/+3
| | | | etc.)
* Make [source] NRE-aware to enable [yield]. [Bug 2412068]dkf2009-01-051-2/+2
|
* don't use ckfree((void *)...) butnijtmans2008-12-171-3/+3
| | | | ckfree((char *)...)
* Make a bad zlib install less fatal to rest of Tcl for now.dkf2008-12-121-1/+8
|
* First hack at TIP#234dkf2008-12-111-1/+5
|
* Implement TIP#335dkf2008-12-051-1/+25
|
* CONSTify TclDTraceInfonijtmans2008-10-281-17/+17
| | | | Eliminate some -Wstrings-write warnings
* Check syntax of [info coroutine] args, i.e. there are none.dkf2008-10-191-39/+36
|
* * generic/tclBasic (TclInfoCoroutineCmd):Miguel Sofer2008-10-081-5/+8
| | | | | | * tests/unsupported.test: arrange for [info coroutine] to return {} when a coroutine is running but the resume command has been deleted [Bug 2153080]
* * generic/tclBasic.c: Move [tailcall], [coroutine] andMiguel Sofer2008-10-071-22/+15
| | | | | | * generic/tclCmdIL.c: [yield] out of ::tcl::unsupported * tests/info.test: and into global scope: TIPs #327 * tests/unsupported.test: and #328
* Implemented TIP#195 - tcl::prefix command. [Patch 1040206]dkf2008-10-031-1/+2
|
* TIP #330 IMPLEMENTATIONdgp2008-10-021-3/+3
| | | | | | | | | | * generic/tcl.h: Remove the "result" and "freeProc" fields * generic/tclBasic.c: from the default public declaration of the * generic/tclResult.c: Tcl_Interp struct. Code should no longer * generic/tclStubLib.c: be accessing these fields. Access can be * generic/tclTest.c: restored by defining USE_INTERP_RESULT, but * generic/tclUtil.c: that should only be a temporary migration aid. *** POTENTIAL INCOMPATIBILITY ***
* * generic/tclBasic.c: Fix the numLevels computations onMiguel Sofer2008-09-281-4/+14
| | | | | * generic/tclInt.h: coroutine yield/resume * tests/unsupported.test:
* * generic/tclBasic.c: move TclResetCancellation to be called onMiguel Sofer2008-09-171-2/+16
| | | | | | returning to level 0, as opposed to it being called on starting a command at level 0. Add a call on returning via Tcl_EvalObjEx to fix [Bug 2114165].
* * tests/nre.test: add missing constraints; enable test of foreachMiguel Sofer2008-09-101-3/+2
| | | | | | | | | recursion. * generic/tclBasic.c: * generic/tclCompile.h: * generic/tclExecute.c (INST_EVAL_STK): fix for [Bug 2102930], wrong numLevels when evaling a canonical list.
* * generic/tclBasic.c (InfoCoroutine):Miguel Sofer2008-08-261-1/+32
| | | | | | * tests/unsupported.test: new command that returns the FQN of the currently executing coroutine. Lives as infoCoroutine under unsupported, but is designed to become a subcommand of [info]
* * generic/tclBasic.c (NRInterpCoroutine): store the caller'sMiguel Sofer2008-08-251-2/+2
| | | | | eePtr, stop assuming the coroutine is invoked from the same execEnv where it was created.
* NRE-enable non-compiled [foreach]. [Bug 2017632]dkf2008-08-241-2/+2
|
* * generic/tclBasic.c: Removed unused var; fixed functionMiguel Sofer2008-08-231-3/+1
| | | | | | * generic/tclOOInt.h: pointer declarations (why did gcc start * generic/tclOOMethod.c: complaining all of a sudden?) * generic/tclProc.c:
* * generic/tclBasic.c: Set special errocodes: COROUTINE_BUSY,Miguel Sofer2008-08-231-1/+3
| | | | COROUTINE_CANT_YIELD, COROUTINE_ILLEGAL_YIELD.