From 51a589835ee3b61d4e9224f19fc2345e1410f446 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 15 Feb 2008 02:37:26 -0600 Subject: [PATCH] Minor tweaks --- extra/benchmark/compiler/compiler.factor | 17 +++++++++++++++++ extra/bootstrap/tools/tools.factor | 3 ++- .../tools/disassembler/disassembler-docs.factor | 5 +++-- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 extra/benchmark/compiler/compiler.factor diff --git a/extra/benchmark/compiler/compiler.factor b/extra/benchmark/compiler/compiler.factor new file mode 100755 index 0000000000..12ac9b8041 --- /dev/null +++ b/extra/benchmark/compiler/compiler.factor @@ -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 diff --git a/extra/bootstrap/tools/tools.factor b/extra/bootstrap/tools/tools.factor index 7b909ea1f6..40d77e03be 100755 --- a/extra/bootstrap/tools/tools.factor +++ b/extra/bootstrap/tools/tools.factor @@ -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 diff --git a/extra/tools/disassembler/disassembler-docs.factor b/extra/tools/disassembler/disassembler-docs.factor index 618413dcbd..f03861a8ed 100755 --- a/extra/tools/disassembler/disassembler-docs.factor +++ b/extra/tools/disassembler/disassembler-docs.factor @@ -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" } "."