Add -pic= command line argument

db4
Slava Pestov 2009-04-28 16:58:19 -05:00
parent e940f6fd8b
commit 3985b18026
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,4 @@
USING: help.markup help.syntax parser vocabs.loader strings
command-line.private ;
USING: help.markup help.syntax parser vocabs.loader strings ;
IN: command-line
HELP: run-bootstrap-init
@ -53,6 +52,7 @@ ARTICLE: "runtime-cli-args" "Command line switches for the VM"
{ { $snippet "-aging=" { $emphasis "n" } } "Size of aging generation (1), megabytes" }
{ { $snippet "-tenured=" { $emphasis "n" } } "Size of oldest generation (2), megabytes" }
{ { $snippet "-codeheap=" { $emphasis "n" } } "Code heap size, megabytes" }
{ { $snippet "-pic=" { $emphasis "n" } } "Maximum inline cache size. Setting of 0 disables inline caching, > 1 enables polymorphic inline caching" }
{ { $snippet "-securegc" } "If specified, unused portions of the data heap will be zeroed out after every garbage collection" }
}
"If an " { $snippet "-i=" } " switch is not present, the default image file is used, which is usually a file named " { $snippet "factor.image" } " in the same directory as the runtime executable (on Windows and Mac OS X) or the current directory (on Unix)." ;

View File

@ -66,6 +66,7 @@ void init_parameters_from_args(F_PARAMETERS *p, int argc, F_CHAR **argv)
else if(factor_arg(argv[i],STRING_LITERAL("-aging=%d"),&p->aging_size));
else if(factor_arg(argv[i],STRING_LITERAL("-tenured=%d"),&p->tenured_size));
else if(factor_arg(argv[i],STRING_LITERAL("-codeheap=%d"),&p->code_size));
else if(factor_arg(argv[i],STRING_LITERAL("-pic=%d"),&p->max_pic_size));
else if(STRCMP(argv[i],STRING_LITERAL("-securegc")) == 0) p->secure_gc = true;
else if(STRCMP(argv[i],STRING_LITERAL("-fep")) == 0) p->fep = true;
else if(STRNCMP(argv[i],STRING_LITERAL("-i="),3) == 0) p->image_path = argv[i] + 3;
@ -99,6 +100,8 @@ void init_factor(F_PARAMETERS *p)
p->tenured_size <<= 20;
p->code_size <<= 20;
p->max_pic_size = 3;
/* Disable GC during init as a sanity check */
gc_off = true;
@ -118,6 +121,7 @@ void init_factor(F_PARAMETERS *p)
init_stacks(p->ds_size,p->rs_size);
load_image(p);
init_c_io();
init_inline_caching(p->max_pic_size);
#ifndef FACTOR_DEBUG
init_signals();

View File

@ -35,6 +35,7 @@ typedef struct {
bool fep;
bool console;
bool stack_traces;
CELL max_pic_size;
} F_PARAMETERS;
void load_image(F_PARAMETERS *p);