summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-05-29 14:37:58 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-05-29 14:37:58 (GMT)
commit38ae5eca7ffd791e3b3b092969700ef6ee56ba19 (patch)
treec7fd0ed23d26f08bc978279b7d85f6251f9810e7 /generic/tclCompCmdsSZ.c
parent8221c0695aa992657960abbd3d850a9503c633ca (diff)
downloadtcl-38ae5eca7ffd791e3b3b092969700ef6ee56ba19.zip
tcl-38ae5eca7ffd791e3b3b092969700ef6ee56ba19.tar.gz
tcl-38ae5eca7ffd791e3b3b092969700ef6ee56ba19.tar.bz2
Stop emitting the instructions INST_*_SCALAR_STK*. They are identical to
their INST_*_STK* counterparts. Having done that, it is clear the "simpleVarName" return from TclPushVarName provides nothing of use to any of its callers. Eliminate that. Also make TPVN return void, instead of int. Bring the TPVN header comments up to date; they were quite rotten.
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r--generic/tclCompCmdsSZ.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index f2017f0..3fb8712 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -126,7 +126,7 @@ TclCompileSetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *varTokenPtr, *valueTokenPtr;
- int isAssignment, isScalar, simpleVarName, localIndex, numWords;
+ int isAssignment, isScalar, localIndex, numWords;
DefineLineInformation; /* TIP #280 */
numWords = parsePtr->numWords;
@@ -145,7 +145,7 @@ TclCompileSetCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(interp, varTokenPtr, envPtr, 0,
- &localIndex, &simpleVarName, &isScalar, 1);
+ &localIndex, &isScalar, 1);
/*
* If we are doing an assignment, push the new value.
@@ -160,12 +160,10 @@ TclCompileSetCmd(
* Emit instructions to set/get the variable.
*/
- if (simpleVarName) {
if (isScalar) {
if (localIndex < 0) {
TclEmitOpcode((isAssignment?
- INST_STORE_SCALAR_STK : INST_LOAD_SCALAR_STK),
- envPtr);
+ INST_STORE_STK : INST_LOAD_STK), envPtr);
} else if (localIndex <= 255) {
TclEmitInstInt1((isAssignment?
INST_STORE_SCALAR1 : INST_LOAD_SCALAR1),
@@ -189,9 +187,6 @@ TclCompileSetCmd(
localIndex, envPtr);
}
}
- } else {
- TclEmitOpcode((isAssignment? INST_STORE_STK : INST_LOAD_STK), envPtr);
- }
return TCL_OK;
}
@@ -2683,7 +2678,7 @@ TclCompileUnsetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *varTokenPtr;
- int isScalar, simpleVarName, localIndex, numWords, flags, i;
+ int isScalar, localIndex, numWords, flags, i;
Tcl_Obj *leadingWord;
DefineLineInformation; /* TIP #280 */
@@ -2724,15 +2719,13 @@ TclCompileUnsetCmd(
*/
PushVarNameWord(interp, varTokenPtr, envPtr, 0,
- &localIndex, &simpleVarName, &isScalar, 1);
+ &localIndex, &isScalar, 1);
/*
* Emit instructions to unset the variable.
*/
- if (!simpleVarName) {
- OP1( UNSET_STK, flags);
- } else if (isScalar) {
+ if (isScalar) {
if (localIndex < 0) {
OP1( UNSET_STK, flags);
} else {