bootstrap.compiler: add -debug-compiler switch which loads compiler but doesn't compile any words

db4
Slava Pestov 2009-08-20 03:48:03 -05:00
parent 9ef8f6c81d
commit a3631f1878
1 changed files with 59 additions and 55 deletions

View File

@ -35,16 +35,18 @@ gc
: compile-unoptimized ( words -- ) : compile-unoptimized ( words -- )
[ optimized? not ] filter compile ; [ optimized? not ] filter compile ;
nl "debug-compiler" get [
"Compiling..." write flush
! Compile a set of words ahead of the full compile. nl
! This set of words was determined semi-empirically "Compiling..." write flush
! using the profiler. It improves bootstrap time
! significantly, because frequenly called words ! Compile a set of words ahead of the full compile.
! which are also quick to compile are replaced by ! This set of words was determined semi-empirically
! compiled definitions as soon as possible. ! using the profiler. It improves bootstrap time
{ ! significantly, because frequenly called words
! which are also quick to compile are replaced by
! compiled definitions as soon as possible.
{
not ? not ?
2over roll -roll 2over roll -roll
@ -63,55 +65,57 @@ nl
namestack* namestack*
layout-of layout-of
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
bitand bitor bitxor bitnot bitand bitor bitxor bitnot
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
+ 2/ < <= > >= shift + 2/ < <= > >= shift
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
new-sequence nth push pop last flip new-sequence nth push pop last flip
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
hashcode* = equal? assoc-stack (assoc-stack) get set hashcode* = equal? assoc-stack (assoc-stack) get set
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
memq? split harvest sift cut cut-slice start index clone memq? split harvest sift cut cut-slice start index clone
set-at reverse push-all class number>string string>number set-at reverse push-all class number>string string>number
like clone-like like clone-like
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
lines prefix suffix unclip new-assoc update lines prefix suffix unclip new-assoc update
word-prop set-word-prop 1array 2array 3array ?nth word-prop set-word-prop 1array 2array 3array ?nth
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
{ {
malloc calloc free memcpy malloc calloc free memcpy
} compile-unoptimized } compile-unoptimized
"." write flush "." write flush
vocabs [ words compile-unoptimized "." write flush ] each vocabs [ words compile-unoptimized "." write flush ] each
" done" print flush " done" print flush
] unless