diff options
author | mig <mig> | 2013-12-05 15:15:23 (GMT) |
---|---|---|
committer | mig <mig> | 2013-12-05 15:15:23 (GMT) |
commit | 8f8438c53e0a086672a12fec00764d770323caed (patch) | |
tree | 5b0ca7d586fc8f68142490db32103d185b81ac99 /generic/tclCompile.c | |
parent | be6ed41db2f292c42a40c9e4da6bbc21884a3b54 (diff) | |
download | tcl-8f8438c53e0a086672a12fec00764d770323caed.zip tcl-8f8438c53e0a086672a12fec00764d770323caed.tar.gz tcl-8f8438c53e0a086672a12fec00764d770323caed.tar.bz2 |
New compiler and bytecodes for foreach and lmap: 70% faster
* speed as measured by http://wiki.tcl.tk/39021: runs in <1/3 the time
* still need to adapt array-set to use this
* assemble.test-16.5 or 16.6 bombs in a purify/symbols build (?)
* removing the old opcodes would force recompilation of old .tbc files or adaptation of tbcload
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 3c8e4ef..7cd9796 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -545,6 +545,16 @@ InstructionDesc const tclInstructionTable[] = { /* Drops an element from the auxiliary stack, popping stack elements * until the matching stack depth is reached. */ + /* New foreach implementation */ + {"foreach_start", 5, +2, 1, {OPERAND_AUX4}}, + /* Initialize execution of a foreach loop. Operand is aux data index + * of the ForeachInfo structure for the foreach command. It pushes 2 + * elements which hold runtime params for foreach_step, they are later + * dropped by foreach_end together with the value lists. */ + {"foreach_step", 1, 0, 0, {OPERAND_NONE}}, + /* "Step" or begin next iteration of foreach loop. */ + {"foreach_end", 1, 0, 0, {OPERAND_NONE}}, + {NULL, 0, 0, 0, {OPERAND_NONE}} }; |