Minor tweaks

db4
Slava Pestov 2008-02-15 02:37:26 -06:00
parent f04eb21ef5
commit 51a589835e
3 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,17 @@
IN: benchmark.compiler
USING: assocs words sequences arrays compiler tools.time
io.styles io prettyprint vocabs kernel sorting generator
optimizer ;
: recompile-with-timings
all-words [ compiled? ] subset
[ dup [ word-dataflow optimize nip drop ] benchmark nip ] { } map>assoc
sort-values 20 tail*
"Worst offenders:" print
standard-table-style
[
[ [ "Word" write ] with-cell [ "Compile time (ms)" write ] with-cell ] with-row
[ [ [ pprint-cell ] each ] with-row ] each
] tabular-output ;
MAIN: recompile-with-timings

View File

@ -4,10 +4,11 @@ USING: vocabs.loader sequences ;
"bootstrap.image"
"tools.annotations"
"tools.crossref"
! "tools.deploy"
"tools.deploy"
"tools.memory"
"tools.profiler"
"tools.test"
"tools.time"
"tools.disassembler"
"editors"
} [ require ] each

View File

@ -1,9 +1,10 @@
IN: tools.disassembler
USING: help.markup help.syntax ;
USING: help.markup help.syntax sequences.private ;
HELP: disassemble
{ $values { "obj" "a word or a pair of addresses" } }
{ $description "Disassembles either a compiled word definition or an arbitrary memory range using " { $snippet "gdb" } "." } ;
{ $description "Disassembles either a compiled word definition or an arbitrary memory range (in the case " { $snippet "obj" } " is a pair of integers) by attaching " { $snippet "gdb" } " to the Factor VM and capturing the output." }
{ $notes "In some cases the Factor compiler emits data inline with code, which can confuse " { $snippet "gdb" } ". This occurs in words which call " { $link dispatch } ", where the jump table addresses are compiled inline. Also on the ARM architecture, various pointers are often compiled inline, and the preceeding instruction jumps over the inline pinter." } ;
ARTICLE: "tools.disassembler" "Disassembling words"
"The " { $vocab-link "tools.disassembler" } " vocabulary integrates Factor with the GNU debugger (" { $snippet "gdb" } ") for viewing the assembly code generated by the compiler. It can be used on both Unix and Windows as long as a working copy of " { $snippet "gdb" } " is installed and available in the " { $snippet "PATH" } "."