summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.h
Commit message (Collapse)AuthorAgeFilesLines
* Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\ | | | | cause more harm than good. Purged them (except in zlib files).
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\ | | | | | | more harm than good. Purged them.
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | | | | more harm than good. Purged them.
| | * * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, ListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-22): Extended parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script's, to properly account for them while counting lines for #280, during direct and compiled execution.
| | * * generic/tclBasic.c (DeleteInterpProc,TclArgumentBCEnter,andreas_kupries2009-07-141-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclArgumentBCRelease, TclArgumentGet): * generic/tclCompile.c (EnterCmdWordIndex, TclCleanupByteCode, TclInitCompileEnv, TclCompileScript): * generic/tclCompile.h (ExtCmdLoc): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclInt.h (ExtIndex, CFWordBC): * tests/info.test (info-39.0): Backport of some changes made to the Tcl head, to handle literal sharing better. The code here is much simpler (trimmed down) compared to the head as the 8.4 branch is not bytecode compiling whole files, and doesn't compile eval'd code either. 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 removes the problems with location data caused by literal sharing in proc bodies. Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex).
| | * * generic/tclCompile.h: add support for debug logging of DTracedas2008-08-141-2/+111
| | | | | | | | | | | | | | | * generic/tclBasic.c: 'proc', 'cmd' and 'inst' probes (does _not_ require a platform with DTrace).
| | * * generic/tclCompile.c: Made the new TclEnterCmdWordIndexandreas_kupries2008-07-221-4/+1
| | | | | | | | | | | | * generic/tclCompile.h: static.
| | * * generic/tclBasic.c: Reworked the handling of bytecode literalsandreas_kupries2008-07-221-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c: for #280 to fix the abysmal performance * generic/tclCompile.h: for deep recursion, replaced the linear * generic/tclExecute.c: search through the whole stack with * generic/tclInt.h: another hashtable and simplified the data structure used by the compiler (array instead of hashtable). Incidentially this also fixes the memory leak reported via [Bug 2024937].
| | * * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: frame), added the ability to track the * generic/tclCompCmds.c: absolute location of literal procedure * generic/tclCompile.c: arguments, and making this information * generic/tclCompile.h: available to uplevel, eval, and * generic/tclInterp.c: siblings. This allows proper tracking of * generic/tclInt.h: absolute location through custom (Tcl-coded) * generic/tclNamesp.c: control structures based on uplevel, etc. * generic/tclProc.c:
| | * * generic/tclDTrace.d (new file): add DTrace provider for Tcl; allowsdas2007-09-131-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/Makefile: enable DTrace support. * unix/configure: autoconf-2.13
| | * * generic/tclBasic.c: TIP #280 implementation, conditional on the define ↵andreas_kupries2006-11-281-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCL_TIP280. * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclProc.c: * tests/compile.test: * tests/info.test: * tests/platform.test: * tests/safe.test:
| * | * generic/tclCompile.c: [Bug 2933089]: A literal sharing problem withandreas_kupries2010-02-021-1/+5
| | | | | | | | | | | | | | | | | | * generic/tclCompile.h: 'info frame' affects not only 8.6 but 8.5 as * generic/tclExecute.h: well. Backported the fix done in 8.6, without * tests/info.test: changes. New testcase info-39.1.
| * | * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, TclListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * 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 parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script Tcl_Obj*'s, to properly account for them while counting lines for #280.
| * | * generic/tclBasic.c (DeleteInterpProc,TclArgumentBCEnter,andreas_kupries2009-07-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclArgumentBCRelease, TclArgumentGet): * generic/tclCompile.c (EnterCmdWordIndex, TclCleanupByteCode, TclInitCompileEnv, TclCompileScript): * generic/tclCompile.h (ExtCmdLoc): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclInt.h (ExtIndex, CFWordBC): * tests/info.test (info-39.0): Backport of some changes made to the Tcl head, to handle literal sharing better. The code here is much simpler (trimmed down) compared to the head as the 8.5 branch is not bytecode compiling whole files, and doesn't compile eval'd code either. 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 removes the problems with location data caused by literal sharing in proc bodies. Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex).
| * | typodas2008-08-141-4/+1
| | |
| * | * generic/tclCompile.h: add support for debug logging of DTracedas2008-08-141-2/+122
| | | | | | | | | | | | | | | * generic/tclBasic.c: 'proc', 'cmd' and 'inst' probes (does _not_ require a platform with DTrace).
| * | * generic/tclCompile.c: Made the new TclEnterCmdWordIndexandreas_kupries2008-07-221-4/+1
| | | | | | | | | | | | * generic/tclCompile.h: static, and ansified.
| * | * generic/tclBasic.c: Reworked the handling of bytecode literalsandreas_kupries2008-07-221-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c: for #280 to fix the abysmal performance * generic/tclCompile.h: for deep recursion, replaced the linear * generic/tclExecute.c: search through the whole stack with * generic/tclInt.h: another hashtable and simplified the data structure used by the compiler (array instead of hashtable). Incidentially this also fixes the memory leak reported via [Bug 2024937].
| * | * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: frame), added the ability to track the * generic/tclCompCmds.c: absolute location of literal procedure * generic/tclCompile.c: arguments, and making this information * generic/tclCompile.h: available to uplevel, eval, and * generic/tclInterp.c: siblings. This allows proper tracking of * generic/tclInt.h: absolute location through custom (Tcl-coded) * generic/tclNamesp.c: control structures based on uplevel, etc. * generic/tclProc.c:
* | | [Patch 2995655] Report inner contexts in [info errorstack]ferrieux2010-10-201-1/+9
| | |
* | | * generic/tclBasic.c: [Patch 3072080] (minus the itclMiguel Sofer2010-09-271-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdIL.c: update): a saner NRE. * generic/tclCompExpr.c: * generic/tclCompile.c: This makes TclNRExecuteByteCode * generic/tclCompile.h: (ex TEBC) to be a normal NRE * generic/tclExecute.c: citizen: it loses its special status. * generic/tclInt.decls: The logic flow within the BC engine is * generic/tclInt.h: simplified considerably. * generic/tclIntDecls.h: * generic/tclObj.c: * generic/tclProc.c: * generic/tclTest.c:
* | | * generic/tclBasic.c: Redesign of [tailcall] toMiguel Sofer2010-08-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: (a) fix #3047235 * generic/tclCompile.h: (b) enable fix for #3046594 * generic/tclExecute.c: (c) enable recursive tailcalls * generic/tclInt.h: * generic/tclNamesp.c: * tests/tailcall.test:
* | | * generic/tclCompExpr.c: Slight change in the literal sharingMiguel Sofer2010-04-291-5/+5
| | | | | | | | | | | | | | | | | | * generic/tclCompile.c: mechanism to avoid shimmering of * generic/tclCompile.h: command names. * generic/tclLiteral.c:
* | | Convert many multi-line macros to use the best-practice do-while(0) formdkf2010-02-251-151/+183
| | |
* | | Hive off the ensemble code into its own file.dkf2010-02-131-1/+89
| | | | | | | | | | | | Split the [switch] compiler for sanity's sake.
* | | Make the [unset] command be bytecode compiled.dkf2010-01-301-2/+8
| | |
* | | * generic/tclCompile.h: NRE-enable direct eval on BC spoilageMiguel Sofer2010-01-211-1/+3
| | | | | | | | | | | | | | | * generic/tclExecute.c: [Bug 2910748] * tests/nre.test:
* | | * generic/tclBasic.c: Fix lerak of coroutines on namespaceMiguel Sofer2010-01-031-1/+2
| | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.h: deletion, [Bug 2724403]. Added a test * generic/tclNamesp.c: for this leak, and also a test for * tests/coroutine.test: leaks on namespace deletion. * tests/namespace.test:
* | | * generic/tclCompCmds.c (TclCompileSubstCmd): Added a bytecodedgp2009-09-041-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | * generic/tclCompile.c (TclInitCompileEnv, EnterCmdWordIndex,andreas_kupries2009-07-141-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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].
* | | * generic/tclBasic.c: Let coroutines start with a much smallerMiguel Sofer2009-05-081-2/+2
| | | | | | | | | | | | | | | * generic/tclCompile.h: stack: 200 words (previously was 2000, * generic/tclExecute.c: the same as interps)
* | | [Bug 218977] Tcl_DbCkfree needs a return valuenijtmans2009-02-271-9/+9
| | | | | | | | | | | | don't use CONST84/CONST86 in internal header files
* | | CONSTify TclPrintInstruction and TclpNativeJoinPath (TIP #27)nijtmans2009-01-221-2/+2
| | | | | | | | | | | | | | | {unix win} in *.decls is equivalent to {generic} tclGetDate.y, tclDate.c: single internal const decoration
* | | CONSTify TclDTraceInfonijtmans2008-10-281-3/+3
| | | | | | | | | | | | Eliminate some -Wstrings-write warnings
* | | Letting CONST die a slow and graceful death, since NO_CONST wasnijtmans2008-10-221-4/+4
| | | | | | | | | | | | broken since 8.4 and no-one complained about it.
* | | * generic/tclCompile.h: Declare the internal tclInstructionTabledgp2008-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclExecute.c: to simply be "const", not CONST86. * generic/tclCmdAH.c: whitespace. * generic/tclCmdIL.c: Uninitialized variable warning. * generic/tclTest.c: const correctness warning.
* | | CONSTify char* DTrace probe argumentsdas2008-10-101-5/+3
| | |
* | | undo "fix warnings from 2008-10-05 constification" (tclExecute.c 1.414), butnijtmans2008-10-071-3/+3
| | | | | | | | | | | | | | | in stead modify two macro's in tclCompile.h with the same affect, but now without polluting C-code with type casts.
* | | * generic/tclInt.decls: CONSTified the AuxDataType argumentnijtmans2008-10-051-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompCmds.c: of TclCreateAuxData and * generic/tclCompile.c TclRegisterAuxDataType and the return * generic/tclCompile.h values of TclGetAuxDataType and * generic/tclExecute.c TclGetInstructionTable * ChangeLog * generic/tclIntDecls.h: regenerated This change complies with TIP #27 (even though it only involves internal function, so this is not even necessary).
* | | * tests/nre.test: add missing constraints; enable test of foreachMiguel Sofer2008-09-101-1/+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: Implementation of [coroutine] and [yield]Miguel Sofer2008-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: commands (in tcl::unsupported). * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclInt.h: * tests/unsupported.test:
* | | fix unused variable warnings when USE_DTRACE is not defineddas2008-08-141-4/+4
| | |
* | | typodas2008-08-141-2/+4
| | |
* | | * generic/tclBasic.c (TclNREvalObjv, Tcl_NRCallObjProc): DTrace probesdas2008-08-141-8/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclProc.c (TclNRInterpProcCore, InterpProcNR2): for NRE. [Bug 2017160] * generic/tclBasic.c (TclDTraceInfo): add two extra arguments to * generic/tclCompile.h: DTrace 'info' probes for tclOO * generic/tclDTrace.d: method & class/object info. * generic/tclCompile.h: add support for debug logging of DTrace * generic/tclBasic.c: 'proc', 'cmd' and 'inst' probes (does _not_ require a platform with DTrace).
* | | * generic/tclBasic.c: slight cleanupMiguel Sofer2008-08-091-1/+2
| | | | | | | | | | | | | | | * generic/tclCompile.h: * generic/tclExecute.c:
* | | duh ... committed only the ChangeLog entry, not the restMiguel Sofer2008-08-041-3/+5
| | |
* | | made function staticMiguel Sofer2008-08-031-3/+1
| | |
* | | * generic/tclBasic.c: new unsupported command atProcExitMiguel Sofer2008-08-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.h: that shares the implementation with * generic/tclExecute.c: tailcall. Fixed a segfault in * generic/tclInt.h: tailcalls. Tests added. * generic/tclInterp.c: * generic/tclNamesp.c: * tests/unsupported.test:
* | | * generic/tclBasic.c: Improved tailcalls and tests.Miguel Sofer2008-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclTest.c: * tests/NRE.test: