diff --git a/basis/command-line/command-line-docs.factor b/basis/command-line/command-line-docs.factor index 3d06bd97b7..5aeb49d6f2 100644 --- a/basis/command-line/command-line-docs.factor +++ b/basis/command-line/command-line-docs.factor @@ -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)." ; diff --git a/vm/factor.c b/vm/factor.c index 27ec80a4eb..1010e923ea 100755 --- a/vm/factor.c +++ b/vm/factor.c @@ -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(); diff --git a/vm/image.h b/vm/image.h index e26a6bb5b4..de5b55f0af 100755 --- a/vm/image.h +++ b/vm/image.h @@ -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);