diff options
author | mig <mig> | 2013-12-10 11:38:17 (GMT) |
---|---|---|
committer | mig <mig> | 2013-12-10 11:38:17 (GMT) |
commit | 5b08f1d1ef025223ce9bc15d06dbdb88c247822a (patch) | |
tree | d8e1081fccdbf33af9b7ef5d71a3c28a89575b30 /generic/tclExecute.c | |
parent | 49a9c68c2f3e11832b525961440d1d4fb5188d5d (diff) | |
download | tcl-5b08f1d1ef025223ce9bc15d06dbdb88c247822a.zip tcl-5b08f1d1ef025223ce9bc15d06dbdb88c247822a.tar.gz tcl-5b08f1d1ef025223ce9bc15d06dbdb88c247822a.tar.bz2 |
new INST_LMAP_COLLECT, speeds up lmap and eliminates the need for a temp var
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a3083bc..9261f19 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -6345,6 +6345,25 @@ TEBCresume( infoPtr = tmpPtr->internalRep.otherValuePtr; numLists = infoPtr->numLists; NEXT_INST_V(1, numLists+2, 0); + + case INST_LMAP_COLLECT: + /* + * This instruction is only issued by lmap. The stack is: + * - result + * - infoPtr + * - loop counters + * - valLists + * - collecting obj (unshared) + * The instruction lappends the result to the collecting obj. + */ + + tmpPtr = OBJ_AT_DEPTH(1); + infoPtr = tmpPtr->internalRep.otherValuePtr; + numLists = infoPtr->numLists; + + objPtr = OBJ_AT_DEPTH(3 + numLists); + Tcl_ListObjAppendElement(NULL, objPtr, OBJ_AT_TOS); + NEXT_INST_F(1, 1, 0); } case INST_BEGIN_CATCH4: |