summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclCompile.c: Fix comments.Miguel Sofer2007-10-201-2/+2
| | | | * generic/tclExecute.c:
* * generic/tclCompExpr.c: Moved a misplaced declaration that blockedKevin B Kenny2007-10-171-5/+9
| | | | | | compilation on VC++. * generic/tclExecute.c: Silenced several VC++ compiler warnings about converting 'long' to 'unsigned short'.
* Minor cleanup of NULL usagedkf2007-09-171-13/+16
|
* * generic/tclDTrace.d (new file): add DTrace provider for Tcl; allowsdas2007-09-131-1/+31
| | | | | | | | | | | | | | | | | | * generic/tclCompile.h: tracing of proc and command entry & * generic/tclBasic.c: return, bytecode execution, object * generic/tclExecute.c: allocation and more; with essentially * generic/tclInt.h: zero cost when tracing is inactive; * generic/tclObj.c: enable with --enable-dtrace configure * generic/tclProc.c: arg (disabled by default, will only * unix/Makefile.in: enable if DTrace is present). * unix/configure.in: [Patch 1793984] * macosx/GNUmakefile: enable DTrace support. * macosx/Tcl-Common.xcconfig: * macosx/Tcl.xcodeproj/project.pbxproj: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
* * generic/tclCompCmds.c (TclCompileDictCmd-update):Miguel Sofer2007-09-111-2/+2
| | | | | | * generic/tclCompile.c (tclInstructionTable): * generic/tclExecute.c (INST_DICT_UPDATE_END): fix stack management in [dict update] [Bug 1786481].
* * generic/tclExecute.c: Corrected an off-by-one error in theKevin B Kenny2007-09-111-3/+25
| | | | | setting of MaxBaseWide for certain powers. [Bug 1767293 - problem reported in comments when bug was reopened].
* * generic/tclCompile.c: fix tclInstructionTable entry forMiguel Sofer2007-09-101-8/+1
| | | | | | | dictUpdateEnd * generic/tclExecute.c: remove unneeded setting of 'cleanup' variable before jumping to checkForCatch.
* * generic/tclInt.h: Removed the "nsName" Tcl_ObjType from thedgp2007-09-091-11/+2
| | | | | | | | | | | | | | | | | | | * generic/tclNamesp.c: registered set. Revised the management of * generic/tclObj.c: the intrep of that Tcl_ObjType. Revised the * tests/obj.test: TclGetNamespaceFromObj() routine to return TCL_ERROR and write a consistent error message when a namespace is not found. [Bug 1588842. Patch 1686862] ***POTENTIAL INCOMPATIBILITY*** For callers of Tcl_GetObjType() on the name "nsName". * generic/tclExecute.c: Update TclGetNamespaceFromObj() callers. * generic/tclProc.c: * tests/apply.test: Updated tests to expect new consistent * tests/namespace-old.test: error message when a namespace is not * tests/namespace.test: found. * tests/upvar.test:
* * generic/tclCompCmds.c: Use the new INST_REVERSE instructiondgp2007-09-091-1/+17
| | | | | | | | | * tests/mathop.test: to correct the compiled versions of math operator commands. [Bug 1724437]. * generic/tclCompile.c: New bytecode instruction INST_REVERSE to * generic/tclCompile.h: reverse the order of N items at the top of * generic/tclExecute.c: stack.
* Fix [Bug 1786481]dkf2007-09-081-1/+4
|
* * generic/tclBasic.c: Removed support for the unmaintaineddgp2007-09-051-17/+1
| | | | | * generic/tclExecute.c: -DTCL_GENERIC_ONLY configuration. [Bug 1264623] * unix/Makefile.in:
* fix warnings about 64bit signed vs unsigned comparisondas2007-09-031-3/+3
|
* * generic/tclCompile.c: Added fflush() calls following all callers ofdgp2007-08-301-1/+2
| | | | | | * generic/tclExecute.c: TclPrintByteCodeObj() so that tcl_traceCompile output is less likely to get mangled when writes to stdout interleave with other code.
* * generic/tclCompExpr.c: Call TclCompileSyntaxError() whendgp2007-08-271-69/+11
| | | | | | | | | | | | | | | | expression syntax errors are found when compiling expressions. With this in place, convert TclCompileExpr to return void, since there's no longer any need to report TCL_ERROR. * generic/tclCompile.c: Update callers. * generic/tclExecute.c: * generic/tclCompCmds.c: New routine TclCompileSyntaxError() * generic/tclCompile.h: to directly compile bytecodes that report a * generic/tclCompile.c: syntax error, rather than (ab)use a call to TclCompileReturnCmd. Also, undo the most recent commit that papered over some issues with that (ab)use. New routine produces a new opcode INST_SYNTAX, which is a minor variation of INST_RETURN_IMM. Also a bit of constification.
* * generic/tclCompile.c: Move the deallocation of local LiteralTabledgp2007-08-271-11/+1
| | | | | * generic/tclCompExpr.c: entries into TclFreeCompileEnv(). * generic/tclExecute.c: Update callers.
* fix warnings about signed vs unsigned comparison (type of sizeof() is size_t ↵das2007-08-271-7/+7
| | | | i.e. unsigned!)
* * generic/tclExecute.c (TclExecuteByteCode): Added code to handleKevin B Kenny2007-08-251-3/+425
| | | | | | | * tests/expr.test (expr-23.48-53) integer exponentiation that results in 32- and 64-bit integer results, avoiding calls to wide integer exponentiation routines in this common case. [Bug 1767293]
* * generic/tclExecute.c (TEBC): disable the new shortcut to frequentMiguel Sofer2007-08-221-3/+1
| | | | INSTs for debug builds. REVERTED (collision with alternative fix)
* Missing init in ParseExpr().dgp2007-08-221-3/+1
| | | | Label needs debug build exposure in TEBC.
* * generic/tclExecute.c (TEBC): disable the new shortcut to frequentMiguel Sofer2007-08-221-2/+4
| | | | INSTs for debug builds.
* * generic/tclExecute.c (INST_SUB): fix usage of the new macro forMiguel Sofer2007-08-201-3/+10
| | | | | overflow detection in sums, adapt to subtraction. Lenghty comment added.
* Swapped the order in the Overflowing macro (created in the last commit byMiguel Sofer2007-08-191-2/+5
| | | | Donal): check first the condition most likely to fail in its usage by [incr].
* Make Miguel's overflow-detection more mnemonic with a macro.dkf2007-08-191-73/+86
|
* * generic/tclExecute.c: changed the check for overflow in sums,Miguel Sofer2007-08-191-18/+12
| | | | | | | | | | | reducing objsize, number of branches and cache misses (according to cachegrind). Non-overflow for s=a+b: previous ((a >= 0 || b >= 0 || s < 0) && (s >= 0 || b < 0 || a < 0)) now (((a^s) >= 0) || ((a^b) < 0)) This expresses: "a and s have the same sign or else a and b have different sign".
* * generic/tclExecute.c: check the two most frequent instructionsMiguel Sofer2007-08-161-1/+17
| | | | before the switch. Reduces both runtime and obj size a tiny bit.
* * generic/tclExecute.c (INST_INVOKE*): peephole opt, do not getMiguel Sofer2007-08-141-1/+6
| | | | the interp's result if it will be pushed/popped.
* * generic/tclExecute.c: Provide DECACHE/CACHE protection to thedgp2007-08-131-1/+3
| | | | * tests/trace.test: Tcl_LogCommandInfo() call. [Bug 1773040]
* * generic/tclExecute.c (INST_STORE_ARRAY):Miguel Sofer2007-08-091-24/+13
| | | | | * tests/trace.test (trace-2.6): whole array write traces on compiled local variables were not firing [Bug 1770591]
* * generic/tclExecute.c: Corrected failure to compile/linkdgp2007-08-081-2/+2
| | | | in the -DNO_WIDE_TYPE configuration.
* * generic/tclExecute.c: Corrected improper use of bignum argumentsdgp2007-08-081-7/+14
| | | | * tests/expr.test: to *SHIFT operations. [Bug 1770224].
* fix breakage in TCL_COMPILE_DEBUG builddas2007-08-051-9/+11
|
* Abstracted the 'offsetof' to a TclOffset macro as per Tk_Offset to permitpatthoyts2007-08-011-2/+2
| | | | compilation with MSVC6 and anything else that may not define this macro.
* VarReform [Patch 1750051]Miguel Sofer2007-07-311-237/+250
| | | | *** POTENTIAL INCOMPATIBILITY *** (tclInt.h and tclCompile.h)
* * generic/tclBasic.c (TEOvI, GetCommandSource):Miguel Sofer2007-07-241-34/+16
| | | | | | | | | | * generic/tclExecute.c (TEBC, TclGetSrcInfoForCmd): * generic/tclInt.h: * generic/tclTrace.c (TclCheck(Interp|Execution)Traces): Removed the need for TEBC to inspect the command before calling TEOvI, leveraging the TIP 282 infrastructure. Moved the generation of a correct nul-terminated command string away from the trace code, back into TEOvI/GetCommandSource.
* * generic/tclBasic.c: Removed dead code, including thedgp2007-06-281-237/+1
| | | | | | | | | | | | | * generic/tclExecute.c: entire file tclMathOp.c. * generic/tclInt.h: * generic/tclMathOp.c (removed): * generic/tclTestObj.c: * win/tclWinFile.c: * unix/Makefile.in: Updated to reflect deletion of tclMathOp.c. * win/Makefile.in: * win/makefile.bc: * win/makefile.vc:
* * generic/tclExecute.c: Safety checks to avoid crashes in thedgp2007-06-261-8/+7
| | | | | TclStack* routines when called with an incompletely initialized interp. [Bug 1743302]
* * generic/tclExecute.c: Revised TclStackRealloc() signature to betterdgp2007-06-221-6/+23
| | | | | | | * generic/tclInt.h: parallel (and fall back on) Tcl_Realloc. * generic/tclNamesp.c (TclResetShadowesCmdRefs): Replaced ckrealloc based allocations with TclStackRealloc allocations.
* * generic/tclBasic.c (TEOvI): Made sure that leaveMiguel Sofer2007-06-211-4/+16
| | | | | | | * generic/tclExecute.c (INST_INVOKE): traces that were created * tests/trace.test (trace-36.2): during execution of an originally untraced command do not fire [Bug 1740962], partial fix.
* * generic/tclInt.decls: Revised the interfaces of the routinesdgp2007-06-201-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclExecute.c: TclStackAlloc and TclStackFree to make them easier for callers to use (or more precisely, harder to misuse). TclStackFree now takes a (void *) argument which is the pointer intended to be freed. TclStackFree will panic if that's not actually the memory the call will free. TSA/TSF also now tolerate receiving (interp == NULL), in which case they simply fall back to be calls to Tcl_Alloc/Tcl_Free. * generic/tclIntDecls.h: make genstubs * generic/tclBasic.c: Updated callers * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclIOCmd.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclProc.c: * generic/tclTrace.c: * unix/tclUnixPipe.c:
* improve comments on Tcl stack managementMiguel Sofer2007-06-191-1/+12
|
* adding comments to GrowEvaluationStackMiguel Sofer2007-06-191-1/+13
|
* * generic/tclCmdIL.c (InfoFrameCmd):Miguel Sofer2007-06-181-3/+3
| | | | | | | * generic/tclCmdMZ.c (Tcl_SwitchObjCmd): * generic/tclCompile.c (TclInitCompileEnv): * generic/tclProc.c (Tcl_ProcObjCmd, SetLambdaFromAny): Moved the CmdFrame off the C stack and onto the Tcl stack.
* * generic/tclExecute.c (TEBC): Moved the CmdFrame off the C stackMiguel Sofer2007-06-181-19/+20
| | | | and onto the Tcl stack, between the catch and the execution stacks
* Fix [Bug 1738542]dkf2007-06-171-136/+173
|
* * generic/tclCompCmds.c: Simplified [variable] compiler andMiguel Sofer2007-06-151-36/+39
| | | | | * generic/tclExecute.c: executor. Missed updates to "there is always a valid frame".
* * generic/tclCompile.c: reverted TclEvalObjvInternal andMiguel Sofer2007-06-151-9/+3
| | | | | | | | | | | | * generic/tclExecute.c: INST_INVOKE to essentially what they were * generic/tclBasic.c: previous to the commit of 2007-04-03 [Patch 1693802] and the subsequent optimisations, as they break the new trace tests described below. * generic/trace.test: added tests 36 to 38 for dynamic trace creation and addition. These tests expose a change in dynamics due to a recent round of optimisations. The "correct" behaviour is not described in docs nor TIP 62.
* * generic/tclCompile.c: SetByteCodeFromAny() can no longer returndgp2007-06-141-9/+4
| | | | | * generic/tclExecute.c: any code other than TCL_OK, so remove code * generic/tclProc.c: that formerly handled exceptional codes.
* * generic/tclExecute.c (TclCompEvalObj): missed update to "thereMiguel Sofer2007-06-141-6/+2
| | | | | | | | | is always a valid frame". * generic/tclProc.c (TclObjInterpProcCore): call TEBC directly instead of going through TclCompEvalObj - no need to check the compilation's freshness, this has already been done. This improves speed and should also provide some relief to [Bug 1066755].
* * generic/tclExecute.c: comments added to explain iPtr->numLevelsMiguel Sofer2007-06-111-2/+5
| | | | management.
* * generic/tclBasic.c: Further TEOvI split, creating a newMiguel Sofer2007-06-101-14/+3
| | | | | | | * generic/tclCompile.h: TclEvalObjvKnownCommand() function to * generic/tclExecute.c: handle commands that are already known and are not traced. INST_INVOKE now calls into this function instead of inlining parts of TEOvI. Same perf, better isolation.