From 58edcddea85eb07eb21d8f494d1d762f2dabb844 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 2 Oct 2008 06:41:17 -0500 Subject: [PATCH] Debugging tree shaker --- basis/tools/deploy/shaker/shaker.factor | 14 ++++++++++---- basis/tools/deploy/shaker/strip-cocoa.factor | 9 ++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index f3177a76e1..7c02e87209 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -85,8 +85,8 @@ IN: tools.deploy.shaker ] change-props drop ] each ] [ - "Remaining word properties:" print - [ props>> keys ] gather . + "Remaining word properties:\n" show + [ props>> keys ] gather unparse show ] [ H{ } clone '[ [ [ _ [ ] cache ] map ] change-props drop @@ -360,15 +360,21 @@ SYMBOL: deploy-vocab init-hooks get values concat % , strip-io? [ \ flush , ] unless - ] [ ] make "Boot quotation: " write dup . flush + ] [ ] make "Boot quotation: " show dup unparse show set-boot-quot ; +: init-stripper ( -- ) + t "quiet" set-global + f output-stream set-global ; + : strip ( -- ) - strip-c-io + init-stripper strip-libc strip-cocoa strip-debugger strip-init-hooks + strip-c-io + f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore deploy-vocab get vocab-main set-boot-quot* stripped-word-props >r stripped-globals strip-globals diff --git a/basis/tools/deploy/shaker/strip-cocoa.factor b/basis/tools/deploy/shaker/strip-cocoa.factor index 2cf803e270..d5249dc20c 100755 --- a/basis/tools/deploy/shaker/strip-cocoa.factor +++ b/basis/tools/deploy/shaker/strip-cocoa.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: cocoa cocoa.messages cocoa.application cocoa.nibs assocs namespaces kernel kernel.private words compiler.units sequences -ui ui.cocoa init ; +init vocabs ; IN: tools.deploy.shaker.cocoa : pool ( obj -- obj' ) \ pool get [ ] cache ; @@ -23,9 +23,12 @@ IN: cocoa.application H{ } clone \ pool [ global [ - stop-after-last-window? set + "stop-after-last-window?" "ui" lookup set - [ "MiniFactor.nib" load-nib ] cocoa-init-hook set-global + "ui.cocoa" vocab [ + [ "MiniFactor.nib" load-nib ] + "cocoa-init-hook" "ui.cocoa" lookup set-global + ] when ! Only keeps those methods that we actually call sent-messages get super-sent-messages get assoc-union