From aa403d0343e71da5ab421de3c453e9cfb28d72dd Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 19 May 2015 19:22:48 +0000 Subject: Don't cause string rep generation in [list ... ] bytecode. Candidate for merge to trunk to simplify bytecode. --- generic/tclCompCmdsGR.c | 19 ++++++++++--------- 1 file 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; } -- cgit v0.12 From a7e3535ca4d1e594e6d61e9f3c2305a3f49b7f33 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 19 May 2015 20:29:47 +0000 Subject: Tidier version. --- generic/tclCompCmdsGR.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 3a25978..b9c655b 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -1210,21 +1210,7 @@ TclCompileListCmd( valueTokenPtr = TokenAfter(valueTokenPtr); } if (listObj != NULL) { -// int len; -// const char *bytes = Tcl_GetStringFromObj(listObj, &len); - -// 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); -// } + TclEmitPush(TclAddLiteralObj(envPtr, listObj, NULL), envPtr); return TCL_OK; } -- cgit v0.12