Fix overly long bootstrap time
parent
609e5f0cfb
commit
a902349dc4
|
@ -29,7 +29,7 @@ SYMBOL: bootstrap-time
|
|||
|
||||
: compile-remaining ( -- )
|
||||
"Compiling remaining words..." print flush
|
||||
vocabs [ words compile ] each ;
|
||||
vocabs [ words [ compiled? not ] subset compile ] each ;
|
||||
|
||||
: count-words ( pred -- )
|
||||
all-words swap subset length number>string write ;
|
||||
|
|
|
@ -7,11 +7,6 @@ optimizer definitions math compiler.errors threads graphs
|
|||
generic inference ;
|
||||
IN: compiler
|
||||
|
||||
: compiled-usages ( words -- seq )
|
||||
[ [ dup ] H{ } map>assoc dup ] keep [
|
||||
compiled-usage [ nip +inlined+ eq? ] assoc-subset update
|
||||
] with each keys ;
|
||||
|
||||
: ripple-up ( word -- )
|
||||
compiled-usage [ drop queue-compile ] assoc-each ;
|
||||
|
||||
|
@ -56,7 +51,7 @@ IN: compiler
|
|||
[
|
||||
H{ } clone compile-queue set
|
||||
H{ } clone compiled set
|
||||
compiled-usages [ queue-compile ] each
|
||||
[ queue-compile ] each
|
||||
compile-queue get compile-loop
|
||||
compiled get >alist
|
||||
] with-scope ;
|
||||
|
|
|
@ -73,11 +73,17 @@ SYMBOL: post-compile-tasks
|
|||
: after-compilation ( quot -- )
|
||||
post-compile-tasks get push ;
|
||||
|
||||
: call-recompile-hook ( -- )
|
||||
changed-words get keys
|
||||
compiled-usages recompile-hook get call ;
|
||||
|
||||
: call-post-compile-tasks ( -- )
|
||||
post-compile-tasks get [ call ] each ;
|
||||
|
||||
: finish-compilation-unit ( -- )
|
||||
changed-words get keys recompile-hook get call
|
||||
dup [ drop crossref? ] assoc-contains?
|
||||
post-compile-tasks get [ call ] each
|
||||
modify-code-heap
|
||||
call-recompile-hook
|
||||
call-post-compile-tasks
|
||||
dup [ drop crossref? ] assoc-contains? modify-code-heap
|
||||
changed-definitions notify-definition-observers ;
|
||||
|
||||
: with-compilation-unit ( quot -- )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs namespaces sequences kernel ;
|
||||
USING: assocs namespaces sequences kernel words ;
|
||||
IN: inference.state
|
||||
|
||||
! Nesting state to solve recursion
|
||||
|
@ -31,9 +31,6 @@ SYMBOL: current-node
|
|||
! Words that the current dataflow IR depends on
|
||||
SYMBOL: dependencies
|
||||
|
||||
SYMBOL: +inlined+
|
||||
SYMBOL: +called+
|
||||
|
||||
: depends-on ( word how -- )
|
||||
swap dependencies get dup [
|
||||
2dup at +inlined+ eq? [ 3drop ] [ set-at ] if
|
||||
|
|
|
@ -111,9 +111,17 @@ compiled-crossref global [ H{ } assoc-like ] change-at
|
|||
dup compiled-unxref
|
||||
compiled-crossref get delete-at ;
|
||||
|
||||
SYMBOL: +inlined+
|
||||
SYMBOL: +called+
|
||||
|
||||
: compiled-usage ( word -- assoc )
|
||||
compiled-crossref get at ;
|
||||
|
||||
: compiled-usages ( words -- seq )
|
||||
[ [ dup ] H{ } map>assoc dup ] keep [
|
||||
compiled-usage [ nip +inlined+ eq? ] assoc-subset update
|
||||
] with each keys ;
|
||||
|
||||
M: word redefined* ( word -- )
|
||||
{ "inferred-effect" "no-effect" } reset-props ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue