Artifacts Associated With Ticket 3098085fffffffff
Ticket change [f3b7008fe6] (rid 129763) by gneumann on 2010-10-29 09:43:25:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The following problem showed up in aolserver, which produces a blueprint of all tcl-commands for initializing per-thread interpreter. This blueprint contains app procs, .... and as well ensembles. When a Tcl ensemble (e.g. info) is recreated, it looses its compileProc, which has the consequence that e.g. "info exists" is not compiled properly anymore. Not sure, if this qualifies as a bug, but it is certainly "unexpected behavior". The problem at hand can be "solved" by reconfiguring instead of redefining preexisting ensembles (my current fix), but i would think that using TclCompileEnsemble() would make as well sense for user ensembles, which could benefit as well from the compiler, when the ensemble contains e.g. "info exists". I would have expected, that all ensembles have the same compileProc. The details: the script below shows the bytecode before and after a scripted ensemble definition. before, "info exists" is compiled to Command 1: "info exists foo" (0) existScalar %v0 # var "foo" (5) done after, it is just the "info command" Command 1: "info exists foo" (0) push1 0 # "info" (2) push1 1 # "exists" (4) push1 2 # "foo" (6) invokeStk1 3 (8) done This was observed with tcl 8.5.9 and tcl 8.6b*, mac os x and debian/ubuntu linux (32 and 64bit) -gustaf neumann ====================================== proc foo {} {info exists foo} puts [::tcl::unsupported::disassemble proc foo] namespace eval ::tcl::info { namespace ensemble create -command ::info -unknown {} -subcommands {} -prefixes 1 -map { args ::tcl::info::args body ::tcl::info::body cmdcount ::tcl::info::cmdcount commands ::tcl::info::commands complete ::tcl::info::complete default ::tcl::info::default exists ::tcl::info::exists frame ::tcl::info::frame functions ::tcl::info::functions globals ::tcl::info::globals hostname ::tcl::info::hostname level ::tcl::info::level library ::tcl::info::library loaded ::tcl::info::loaded locals ::tcl::info::locals nameofexecutable ::tcl::info::nameofexecutable patchlevel ::tcl::info::patchlevel procs ::tcl::info::procs script ::tcl::info::script sharedlibextension ::tcl::info::sharedlibextension tclversion ::tcl::info::tclversion vars ::tcl::info::vars} } proc foo {} {info exists foo} puts [::tcl::unsupported::disassemble proc foo] - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "gneumann"
- subsystem initialized to: "21. [namespace]"
- title initialized to: "ensemble loosing compileProc"
- type initialized to: "RFE"
Ticket change [f41cbd97ad] (rid 129847) by dkf on 2010-11-03 04:38:10:
- icomment:
I know it's awkward, but the problem is that being compilable adds a fairly heavy overhead to the ensemble; every time the ensemble is modified, it causes a flush of all existing bytecodes and a rebuild from source of everything (well, it bumps an epoch counter which has that effect). I didn't want to inflict that cost on everything so non-compiled ensembles are much cheaper to modify (so packages like Snit weren't massively punished) but that has the side effect of meaning that these complexity costs are necessarily borne *somewhere*.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [9fc484da23] (rid 96699) by dkf on 2010-11-03 04:40:34:
- icomment:
Maybe it would be easier to do something smarter... but I don't know what to do right now. This was the best compromise I could think of. :-)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [22764005fd] (rid 130751) by msofer on 2011-01-31 19:40:30:
- assignee changed to: "dkf"
Ticket change [29a23f64b3] (rid 88899) by dkf on 2011-11-17 21:15:40:
- icomment:
data_type - 360894
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "21. [namespace]"
- title changed to: "Create compiled ensembles"
- username: "dkf"
- icomment:
Ticket change [9b76bfb91e] (rid 111129) by dkf on 2012-05-26 20:11:43:
- icomment:
A workaround is to simply update the existing ::info ensemble with a new -map
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [3cbbcb5d70] (rid 120960) by dkf on 2012-05-26 20:11:44:
- priority changed to: "3 Low"