summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-05-19 19:22:48 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-05-19 19:22:48 (GMT)
commitaa403d0343e71da5ab421de3c453e9cfb28d72dd (patch)
tree05d28738f197d49c7b282fdb14111a2be6621143
parentf2aa46953cedd6fe3b80766c84fb9720ae37f771 (diff)
downloadtcl-aa403d0343e71da5ab421de3c453e9cfb28d72dd.zip
tcl-aa403d0343e71da5ab421de3c453e9cfb28d72dd.tar.gz
tcl-aa403d0343e71da5ab421de3c453e9cfb28d72dd.tar.bz2
Don't cause string rep generation in [list <lit> <lit> ... <lit>] bytecode.
Candidate for merge to trunk to simplify bytecode.
-rw-r--r--generic/tclCompCmdsGR.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index b77c43c..3a25978 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -1210,20 +1210,21 @@ TclCompileListCmd(
valueTokenPtr = TokenAfter(valueTokenPtr);
}
if (listObj != NULL) {
- int len;
- const char *bytes = Tcl_GetStringFromObj(listObj, &len);
+// int len;
+// const char *bytes = Tcl_GetStringFromObj(listObj, &len);
- PushLiteral(envPtr, bytes, len);
- Tcl_DecrRefCount(listObj);
- if (len > 0) {
+// PushLiteral(envPtr, bytes, len);
+ TclEmitPush(TclAddLiteralObj(envPtr, listObj, NULL), envPtr);
+// Tcl_DecrRefCount(listObj);
+// if (len > 0) {
/*
* Force list interpretation!
*/
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_LIST_LENGTH, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
- }
+// TclEmitOpcode( INST_DUP, envPtr);
+// TclEmitOpcode( INST_LIST_LENGTH, envPtr);
+// TclEmitOpcode( INST_POP, envPtr);
+// }
return TCL_OK;
}