diff --git a/core/bootstrap/compiler/compiler.factor b/core/bootstrap/compiler/compiler.factor index a0d767a387..cc8a78509b 100755 --- a/core/bootstrap/compiler/compiler.factor +++ b/core/bootstrap/compiler/compiler.factor @@ -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 diff --git a/core/compiler/compiler.factor b/core/compiler/compiler.factor index fb3ec90a74..ed21e0a352 100755 --- a/core/compiler/compiler.factor +++ b/core/compiler/compiler.factor @@ -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 ; diff --git a/core/generator/generator.factor b/core/generator/generator.factor index a1a9c9be81..e085087da0 100755 --- a/core/generator/generator.factor +++ b/core/generator/generator.factor @@ -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 diff --git a/core/inference/known-words/known-words.factor b/core/inference/known-words/known-words.factor index 97a426bb56..d539e09e7d 100755 --- a/core/inference/known-words/known-words.factor +++ b/core/inference/known-words/known-words.factor @@ -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 -- )