summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-01-18 16:19:03 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-01-18 16:19:03 (GMT)
commit4d5446b2dadf9bbe0dfc6c385e6c235a529251c5 (patch)
treefa948ad9dd4df78fe41cf6e4a405ece09de5eabe /generic/tclCompile.c
parent2dbb65a3ede972c2fa6b8527eb2ce3a0ca0bfddc (diff)
downloadtcl-4d5446b2dadf9bbe0dfc6c385e6c235a529251c5.zip
tcl-4d5446b2dadf9bbe0dfc6c385e6c235a529251c5.tar.gz
tcl-4d5446b2dadf9bbe0dfc6c385e6c235a529251c5.tar.bz2
Full bytecode compilation for [lassign]
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 3f76988..ceda90b 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompile.c,v 1.56 2004/01/13 23:15:02 dgp Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.57 2004/01/18 16:19:04 dkf Exp $
*/
#include "tclInt.h"
@@ -269,7 +269,7 @@ InstructionDesc tclInstructionTable[] = {
* stacked objs: stktop is old value, next is new element value, next
* come (operand-2) indices; pushes the new value.
*/
- {"return", 1, -2, 2, {OPERAND_INT4, OPERAND_UINT4}},
+ {"return", 9, -2, 2, {OPERAND_INT4, OPERAND_UINT4}},
/* Compiled [return], code, level are operands; options and result
* are on the stack. */
{"expon", 1, -1, 0, {OPERAND_NONE}},
@@ -278,6 +278,10 @@ InstructionDesc tclInstructionTable[] = {
/* Test that top of stack is a valid list; error if not */
{"invokeExp", INT_MIN, INT_MIN, 2, {OPERAND_UINT4, OPERAND_ULIST1}},
/* Invoke with expansion: <objc,objv> = expanded <op1,top op1> */
+ {"listIndexImm", 5, 0, 1, {OPERAND_IDX4}},
+ /* List Index: push (lindex stktop op4) */
+ {"listRangeImm", 9, 0, 2, {OPERAND_IDX4, OPERAND_IDX4}},
+ /* List Range: push (lrange stktop op4 op4) */
{0}
};
@@ -3392,6 +3396,17 @@ TclPrintInstruction(codePtr, pc)
fprintf(stdout, "0}");
break;
+ case OPERAND_IDX4:
+ opnd = TclGetInt4AtPtr(pc+numBytes); numBytes += 4;
+ if (opnd >= -1) {
+ fprintf(stdout, "%d ", opnd);
+ } else if (opnd == -2) {
+ fprintf(stdout, "end ");
+ } else {
+ fprintf(stdout, "end-%d ", -2-opnd);
+ }
+ break;
+
case OPERAND_NONE:
default:
break;