Work in progress
parent
f624726e8e
commit
2a24567546
|
@ -13,15 +13,12 @@ IN: bootstrap.compiler
|
|||
0 profiler-prologue set-global
|
||||
] when
|
||||
|
||||
: compile* [ compiled? not ] subset compile ;
|
||||
|
||||
! Compile a set of words ahead of our general
|
||||
! compile-all. This set of words was determined
|
||||
! semi-empirically 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.
|
||||
! Compile a set of words ahead of the full compile.
|
||||
! This set of words was determined semi-empirically
|
||||
! 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.
|
||||
{
|
||||
roll -roll declare not
|
||||
|
||||
|
@ -39,24 +36,22 @@ IN: bootstrap.compiler
|
|||
find-pair-next namestack*
|
||||
|
||||
bitand bitor bitxor bitnot
|
||||
} compile*
|
||||
} compile
|
||||
|
||||
{
|
||||
+ 1+ 1- 2/ < <= > >= shift min
|
||||
} compile*
|
||||
} compile
|
||||
|
||||
{
|
||||
new nth push pop peek hashcode* = get set
|
||||
} compile*
|
||||
} compile
|
||||
|
||||
{
|
||||
. lines
|
||||
} compile*
|
||||
} compile
|
||||
|
||||
{
|
||||
malloc free memcpy
|
||||
} compile*
|
||||
} compile
|
||||
|
||||
[ compile ] recompile-hook set-global
|
||||
|
||||
FORGET: compile*
|
||||
[ recompile ] recompile-hook set-global
|
||||
|
|
|
@ -44,7 +44,7 @@ SYMBOL: compiler-hook
|
|||
dup assoc-empty?
|
||||
[ drop ] [ dup delete-any (compile) compile-loop ] if ;
|
||||
|
||||
: compile ( words -- )
|
||||
: recompile ( words -- )
|
||||
[
|
||||
H{ } clone compile-queue set
|
||||
H{ } clone compiled set
|
||||
|
@ -53,13 +53,16 @@ SYMBOL: compiler-hook
|
|||
compiled get >alist modify-code-heap
|
||||
] with-scope ; inline
|
||||
|
||||
: compile ( words -- )
|
||||
[ compiled? not ] subset recompile ;
|
||||
|
||||
: compile-quot ( quot -- word )
|
||||
H{ } clone changed-words [
|
||||
define-temp dup 1array compile
|
||||
define-temp dup 1array recompile
|
||||
] with-variable ;
|
||||
|
||||
: compile-call ( quot -- )
|
||||
compile-quot execute ;
|
||||
|
||||
: compile-all ( -- )
|
||||
all-words compile ;
|
||||
all-words recompile ;
|
||||
|
|
|
@ -21,7 +21,8 @@ SYMBOL: compiled
|
|||
: queue-compile ( word -- )
|
||||
{
|
||||
{ [ dup compiled get key? ] [ drop ] }
|
||||
{ [ dup compound? not ] [ f swap compiled get set-at ] }
|
||||
{ [ dup primitive? ] [ drop ] }
|
||||
{ [ dup deferred? ] [ drop ] }
|
||||
{ [ t ] [ dup compile-queue get set-at ] }
|
||||
} cond ;
|
||||
|
||||
|
@ -49,7 +50,7 @@ t compiled-stack-traces? set-global
|
|||
pick begin-compiling [
|
||||
roll compiling-word set
|
||||
pick compiling-label set
|
||||
init-generator
|
||||
compiling-word get init-generator
|
||||
call
|
||||
literal-table get >array
|
||||
word-table get >array
|
||||
|
|
|
@ -10,7 +10,7 @@ namespaces namespaces.private parser prettyprint quotations
|
|||
quotations.private sbufs sbufs.private sequences
|
||||
sequences.private slots.private strings strings.private system
|
||||
threads.private tuples tuples.private vectors vectors.private
|
||||
words assocs ;
|
||||
words words.private assocs ;
|
||||
|
||||
! Shuffle words
|
||||
: infer-shuffle-inputs ( shuffle node -- )
|
||||
|
|
Loading…
Reference in New Issue