summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-12-18 18:20:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-12-18 18:20:56 (GMT)
commit339c995c5ac6bf497980352ad05e8462519be1ee (patch)
treef02daf534eefe6f9e5fbde7625d9d77fb0cd81af /generic/tclCompile.c
parent85c73dc9ce50fd5ec5798a10173e29ab8e2c1bd1 (diff)
parent2111573919f6f8e8327c705b2df11131b2bf6b95 (diff)
downloadtcl-bug_0b874c344d.zip
tcl-bug_0b874c344d.tar.gz
tcl-bug_0b874c344d.tar.bz2
merge trunkbug_0b874c344d
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 3c8e4ef..525571d 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -545,6 +545,17 @@ 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}},
+ {"lmap_collect", 1, -1, 0, {OPERAND_NONE}},
+
{NULL, 0, 0, 0, {OPERAND_NONE}}
};
@@ -754,7 +765,9 @@ TclSetByteCodeFromAny(
* instruction generator boundaries.
*/
- TclOptimizeBytecode(&compEnv);
+ if (iPtr->extra.optimizer) {
+ (iPtr->extra.optimizer)(&compEnv);
+ }
/*
* Invoke the compilation hook procedure if one exists.