Add deploy-word-defs? deploy flag to make lsys happy

release
Slava Pestov 2007-11-04 22:52:25 -05:00
parent 667f26249e
commit 206bf56b30
4 changed files with 48 additions and 10 deletions

View File

@ -9,10 +9,11 @@ ARTICLE: "deploy-config" "Deployment configuration"
{ $subsection deploy-config }
{ $subsection set-deploy-config }
"A utility word is provided to load the configuration, change a flag, and store it back to disk:"
{ $subsection set-deploy-flag } ;
{ $subsection set-deploy-flag }
"The " { $link "ui.tools.deploy" } " provides a graphical way of editing the configuration." ;
ARTICLE: "deploy-flags" "Deployment flags"
"There are two types of flags. The first set controls the major subsystems which are to be included in the deployment image:"
"There are two sets of deployment flags. The first set controls the major subsystems which are to be included in the deployment image:"
{ $subsection deploy-math? }
{ $subsection deploy-compiler? }
{ $subsection deploy-ui? }
@ -34,10 +35,26 @@ HELP: deploy-word-props?
$nl
"Off by default. Enable this if the heuristics strip out required word properties." } ;
HELP: deploy-c-types?
{ $description "Deploy flag. If set, the deploy tool retains the " { $link c-types } " table."
HELP: deploy-word-defs?
{ $description "Deploy flag. If set, the deploy tool retains word definition quotations for words compiled with the optimizing compiler. Otherwise, word definitions are stripped from words compiled with the optimizing compiler."
$nl
"Off by default. Disable this if your program calls " { $link c-type } ", " { $link heap-size } ", " { $link <c-object> } ", " { $link <c-array> } ", " { $link malloc-object } ", or " { $link malloc-array } " with a C type name which is not a literal pushed directly at the call site. In this situation, the compiler is unable to fold away the C type lookup, and thus must use the global table at runtime." } ;
"Off by default. During normal execution, the word definition quotation of a word compiled with the optimizing compiler is not used, so disabling this flag can save space. However, some libraries introspect word definitions dynamically (for example, " { $link "inverse" } ") and so programs using these libraries must retain word definition quotations." } ;
HELP: deploy-c-types?
{ $description "Deploy flag. If set, the deploy tool retains the " { $link c-types } " table, otherwise this table is stripped out, saving space."
$nl
"Off by default."
$nl
"The optimizing compiler is able to fold away calls to various words which take a C type as an input if the C type is a literal string:"
{ $list
{ $link c-type }
{ $link heap-size }
{ $link <c-object> }
{ $link <c-array> }
{ $link malloc-object }
{ $link malloc-array }
}
"If your program looks up C types dynamically or from words which do not have a stack effect, you must enable this flag, because in these situations the C type lookup is not folded away and the global table must be consulted at runtime." } ;
HELP: deploy-math?
{ $description "Deploy flag. If set, the deployed image will contain support for " { $link ratio } " and " { $link complex } " types."
@ -45,7 +62,7 @@ $nl
"On by default. Often the programmer will use rationals without realizing it. A small amount of space can be saved by stripping these features out, but some code may require changes to work properly." } ;
HELP: deploy-compiler?
{ $description "Deploy flag. If set, words in the deployed image will be compiled when possible."
{ $description "Deploy flag. If set, words in the deployed image will be compiled with the optimizing compiler when possible."
$nl
"On by default. Most programs should be compiled, not only for performance but because features which depend on the C library interface only function after compilation." } ;
@ -55,10 +72,27 @@ $nl
"Off by default. Programs wishing to use the UI must be deployed with this flag on." } ;
HELP: deploy-io
{ $description "The level of I/O support required by the deployed image." } ;
{ $description "The level of I/O support required by the deployed image:"
{ $table
{ "Value" "Description" }
{ "1" "No input/output" }
{ "2" "Basic ANSI C streams" }
{ "3" "Non-blocking streams and networking" }
}
"The default value is 1, basic ANSI C streams. This enables basic console and file I/O, however more advanced features such are not available." } ;
HELP: deploy-reflection
{ $description "The level of reflection support required by the deployed image." } ;
{ $description "The level of reflection support required by the deployed image."
{ $table
{ "Value" "Description" }
{ "1" "No reflection" }
{ "2" "Retain word names" }
{ "3" "Prettyprinter" }
{ "4" "Debugger" }
{ "5" "Parser" }
{ "6" "Full environment" }
}
"The defalut value is 1, no reflection. Programs which use the above features will need to be deployed with a higher level of reflection support." } ;
HELP: default-config
{ $values { "assoc" assoc } }

View File

@ -40,6 +40,7 @@ SYMBOL: deploy-reflection
: strip-globals? deploy-reflection get 6 < ;
SYMBOL: deploy-word-props?
SYMBOL: deploy-word-defs?
SYMBOL: deploy-c-types?
SYMBOL: deploy-vm
@ -53,6 +54,7 @@ SYMBOL: deploy-image
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-word-defs? f }
{ deploy-c-types? f }
! default value for deploy.app
{ "stop-after-last-window?" t }

View File

@ -76,9 +76,10 @@ IN: tools.deploy.shaker
: strip-words ( props -- )
[ word? ] instances
deploy-word-props? get [ nip ] [ tuck strip-word-props ] if
deploy-word-props? get [ 2dup strip-word-props ] unless
deploy-word-defs? get [ dup strip-word-defs ] unless
strip-word-names? [ dup strip-word-names ] when
strip-word-defs ;
2drop ;
: strip-environment ( retain-globals -- )
strip-globals? [

View File

@ -35,6 +35,7 @@ TUPLE: deploy-gadget vocab settings ;
deploy-compiler? get "Use optimizing compiler" <checkbox> gadget,
deploy-math? get "Rational and complex number support" <checkbox> gadget,
deploy-word-props? get "Include word properties" <checkbox> gadget,
deploy-word-defs? get "Include word definitions" <checkbox> gadget,
deploy-c-types? get "Include C types" <checkbox> gadget, ;
: deploy-settings-theme