Skip to content
Tcl Source Code Artifact [394c114588]
Login

Artifact [394c114588]

Artifact 394c11458808c3cb691eb4423d47ab5d34950b7b:

Ticket change [394c114588] - New ticket [1661637fffffffff|1661637fff] <i>direct compile of pure list scripts</i>. by dgp on 2007-02-16 16:09:00.
D 2007-02-16T16:09:00
J assignee msofer
J cmimetype text/plain
J comment \nThe\sattached\spatch\smodifies\nTclSetBytecodeFromAny()\sso\nthat\swhen\sthe\svalue\swe\sare\ncompiling\sis\salready\sa\spure\nlist,\swe\sproduce\sbytecode\ndirectly,\sand\sdon't\sgo\sthrough\nthe\swaste\sof\sreparsing\sthe\nstring\srep,\sand\srecreating\nword\svalues\sout\sof\sthe\stokens\nproduced\sby\sparsing.\n\nThis\smeans\swe\sdon't\sshimmer\naway\sany\spossibly\svaluable\ninternal\sreps\sin\sthe\selements\nof\sthe\slist.\n\nAs\sa\ssimple\sexample:\n\nset\sns\s::foo\nnamespace\seval\s$ns\s{}\nnamespace\sexists\s$ns\nnamespace\seval\s[list\snamespace\sexists\s$ns]\n\nThe\sfirst\s[namespace\sexists]\scaches\nconverts\svalue\s"::foo"\sto\sthe\s"nsName"\nTcl_ObjType\swith\sa\scached\sreference\nto\sthe\sNamespace\sthat\sname\srepresents.\n\nWithout\sthis\spatch,\sthat\sinternal\srep\ndata\sis\slost\swhen\s[namespace\seval]\nbytecode\scompiles\sthe\ssecond\n[namespace\sexists]\scommand,\sand\sthe\nnamespace\shas\sto\sbe\slooked\sup\sfrom\nstring\svalue\sagain.\n\nWith\sthis\spatch,\sthe\svalue\s$ns\scompiles\ndirectly\sinto\sthe\sbytecode,\sand\swhen\nINST_INVOKE_STK1\sexecutes\sthe\scompiled\n[namespace\sexists]\scommand,\sit\sgets\nthe\scached\sintrep\sdata.\n\nThis\sis\sjust\sa\ssimple\sexample\sto\nillustrate\sthe\sgeneral\sprinciple\sthat\nwe\sought\sto\skeep\sintreps\sif\sit's\nreasonably\seasy\sand\sthere's\snot\sa\sreason\nnot\sto.\n\nThis\sprinciple\shas\salready\sproved\nits\sworth\sfor\sTCL_EVAL_DIRECT\scompiles,\nand\sinspired\slots\sof\s[list\s$cmd\s$arg]\ncoding\sstyle\sout\sthere.\s\sIt's\sstrange\nthat\sthe\ssame\sstyle\shas\snot\suntil\snow\nbeen\ssupported\sin\sthe\sbytecompiling\nbranches.
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 47.\sBytecode\sCompiler
J title direct\scompile\sof\spure\slist\sscripts
J type RFE
K 1661637fffffffffffffffffffffffffffffffff
U dgp
Z 67642c1b5f3dfa36e9894c496a71a4eb