Fix quotation pooling

db4
Slava Pestov 2008-12-08 21:24:45 -06:00
parent e8027742cf
commit 833d9f9c0b
5 changed files with 29 additions and 22 deletions

View File

@ -394,11 +394,11 @@ SYMBOL: deploy-vocab
deploy-vocab get vocab-main set-boot-quot*
stripped-word-props
stripped-globals strip-globals
strip-words
compress-byte-arrays
compress-quotations
compress-strings
compress-wrappers ;
compress-wrappers
strip-words ;
: (deploy) ( final-image vocab config -- )
#! Does the actual work of a deployment in the slave

View File

@ -985,7 +985,8 @@ void primitive_become(void)
}
gc();
iterate_code_heap(relocate_code_block);
compile_all_words();
}
CELL find_all_words(void)

View File

@ -44,25 +44,7 @@ void do_stage1_init(void)
print_string("*** Stage 2 early init... ");
fflush(stdout);
CELL words = find_all_words();
REGISTER_ROOT(words);
CELL i;
CELL length = array_capacity(untag_object(words));
for(i = 0; i < length; i++)
{
F_WORD *word = untag_word(array_nth(untag_array(words),i));
REGISTER_UNTAGGED(word);
default_word_code(word,false);
UNREGISTER_UNTAGGED(word);
update_word_xt(word);
}
UNREGISTER_ROOT(words);
iterate_code_heap(relocate_code_block);
compile_all_words();
userenv[STAGE2_ENV] = T;
print_string("done\n");

View File

@ -522,3 +522,26 @@ void primitive_quotation_xt(void)
F_QUOTATION *quot = untag_quotation(dpeek());
drepl(allot_cell((CELL)quot->xt));
}
void compile_all_words(void)
{
CELL words = find_all_words();
REGISTER_ROOT(words);
CELL i;
CELL length = array_capacity(untag_object(words));
for(i = 0; i < length; i++)
{
F_WORD *word = untag_word(array_nth(untag_array(words),i));
REGISTER_UNTAGGED(word);
if(word->compiledp == F)
default_word_code(word,false);
UNREGISTER_UNTAGGED(word);
update_word_xt(word);
}
UNREGISTER_ROOT(words);
iterate_code_heap(relocate_code_block);
}

View File

@ -5,3 +5,4 @@ F_FIXNUM quot_code_offset_to_scan(CELL quot, F_FIXNUM offset);
void primitive_array_to_quotation(void);
void primitive_quotation_xt(void);
void primitive_jit_compile(void);
void compile_all_words(void);