summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-07-08 15:39:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-07-08 15:39:55 (GMT)
commitc5f6c28026fcea560f1ca456c9ac4f8b7239e902 (patch)
tree1b2539fbf2866550c2ce95c51b5ab8eaae3cc77f
parentd8459f08677700f376c5e39328895bd98bb5d7d1 (diff)
downloadtcl-c5f6c28026fcea560f1ca456c9ac4f8b7239e902.zip
tcl-c5f6c28026fcea560f1ca456c9ac4f8b7239e902.tar.gz
tcl-c5f6c28026fcea560f1ca456c9ac4f8b7239e902.tar.bz2
Move TIP 280 and command extent housekeeping to the periphery.
-rw-r--r--generic/tclCompile.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 052dc8e..388b8a0 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -1780,6 +1780,29 @@ CompileCommandTokens(
assert (numWords > 0);
+ /* Pre-Compile */
+
+ envPtr->numCommands++;
+ EnterCmdStartData(envPtr, cmdIdx,
+ parsePtr->commandStart - envPtr->source, startCodeOffset);
+
+ /*
+ * TIP #280. Scan the words and compute the extended location
+ * information. The map first contain full per-word line
+ * information for use by the compiler. This is later replaced by
+ * a reduced form which signals non-literal words, stored in
+ * 'wlines'.
+ */
+
+ EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source,
+ parsePtr->tokenPtr, parsePtr->commandStart,
+ parsePtr->commandSize, parsePtr->numWords, cmdLine,
+ clNext, &wlines, envPtr);
+ wlineat = eclPtr->nuloc - 1;
+
+ envPtr->line = eclPtr->loc[wlineat].line[0];
+ envPtr->clNext = eclPtr->loc[wlineat].next[0];
+
/* Do we know the command word? */
Tcl_IncrRefCount(cmdObj);
tokenPtr = parsePtr->tokenPtr;
@@ -1809,29 +1832,6 @@ CompileCommandTokens(
}
/* If cmdPtr != NULL, we will try to call cmdPtr->compileProc */
- /* Pre-Compile */
-
- envPtr->numCommands++;
- EnterCmdStartData(envPtr, cmdIdx,
- parsePtr->commandStart - envPtr->source, startCodeOffset);
-
- /*
- * TIP #280. Scan the words and compute the extended location
- * information. The map first contain full per-word line
- * information for use by the compiler. This is later replaced by
- * a reduced form which signals non-literal words, stored in
- * 'wlines'.
- */
-
- EnterCmdWordData(eclPtr, parsePtr->commandStart - envPtr->source,
- parsePtr->tokenPtr, parsePtr->commandStart,
- parsePtr->commandSize, parsePtr->numWords, cmdLine,
- clNext, &wlines, envPtr);
- wlineat = eclPtr->nuloc - 1;
-
- envPtr->line = eclPtr->loc[wlineat].line[0];
- envPtr->clNext = eclPtr->loc[wlineat].next[0];
-
if (cmdPtr) {
int savedNumCmds = envPtr->numCommands;
int update = 0;
@@ -2031,15 +2031,15 @@ CompileCommandTokens(
}
finishCommand:
+ if (cmdKnown) {
+ Tcl_DecrRefCount(cmdObj);
+ }
+
TclEmitOpcode(INST_POP, envPtr);
EnterCmdExtentData(envPtr, cmdIdx,
parsePtr->term - parsePtr->commandStart,
(envPtr->codeNext-envPtr->codeStart) - startCodeOffset);
- if (cmdKnown) {
- Tcl_DecrRefCount(cmdObj);
- }
-
/*
* TIP #280: Free full form of per-word line data and insert the
* reduced form now