Re: More on byte compilation



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.

.



Relevant Pages

  • Re: question about compiling Expect script with freewrap: invalid command spawn
    ... > I want to compile my scripts for distribution. ... and then compiled one of my little script. ... does freewrap only support TCL ... when I run the file with error parameters, ...
    (comp.lang.tcl)
  • Re: long double in C89?
    ... >> compile time for conforming to any standard (no equivalent of ... Oh, I do (I use GNU autoconf which generates a 'configure' script, ... environment (or at least a Bourne shell equivalent and several standard ...
    (comp.lang.c)
  • Re: compiling dcraw, a raw file to ppm convertor
    ... I'm using dcraw -4 to convert to a liniar ppm image now then converting it ... I want my script to produce file names ... GNU Humour 'Technical Thug' ... > Compile your own libjpeg and compile the app against that instead of ...
    (comp.sys.sgi.admin)
  • Re: Massive Memory Structures
    ... (Solaris on sparc, Solaris on x86_64) ... script, I get an out of memory error and the script dies. ... what options do I need to compile in to make this happen. ... It will create a 5g test file, ...
    (comp.lang.perl.misc)
  • Re: building 2.4.1 on HPUX
    ... It turns out, that I did not need to edit the setup.py script, I could just ... ignore the compile time INFO statements regarding Tk/Tcl libs and includes.. ... I did need to modify the Modules/Setup file however... ...
    (comp.lang.python)