Re: More on byte compilation
- From: "Donal K. Fellows" <donal.k.fellows@xxxxxxxxx>
- Date: 12 Feb 2007 05:30:48 -0800
Christian Gollwitzer wrote:
How did you generate this disassembly? By hand?
Is there a tcl command to do it?
Compile Tcl (preferably the HEAD) with the configure option --enable-
symbols=compile and then use a script like this:
proc dumpCompilations script {
set script "set ::tcl_traceCompile 2;$script"
catch { uplevel 1 $script } msg opt
set ::tcl_traceCompile 0
return -options $opt $msg
}
proc B x { ... }
dumpCompilations {
# Remember, procedures are compiled lazily...
B foo bar anything to trigger compilation
}
Note that you don't want to set tcl_traceCompile when it is compiling
interactive commands; it adds a lot to the noise. Especially if you
get bits of the [history] mechanism in there.
I'm familiar with a few assembly languages, so this
bytecode disassembly looks quite readable to me.
Thanks on the readability point; I've been working to improve it
somewhat in 8.5. :-)
Donal.
.
- References:
- More on byte compilation
- From: call_me_anything
- Re: More on byte compilation
- From: Kevin Kenny
- Re: More on byte compilation
- From: Christian Gollwitzer
- More on byte compilation
- Prev by Date: Re: regexp again :( i am about to explode.....
- Next by Date: Need help on tablelist
- Previous by thread: Re: More on byte compilation
- Next by thread: New tcl books for 8.5?
- Index(es):
Relevant Pages
|
|