Fix overly long bootstrap time

db4
Slava Pestov 2008-02-25 03:38:37 -06:00
parent 609e5f0cfb
commit a902349dc4
5 changed files with 21 additions and 15 deletions

View File

@ -29,7 +29,7 @@ SYMBOL: bootstrap-time
: compile-remaining ( -- ) : compile-remaining ( -- )
"Compiling remaining words..." print flush "Compiling remaining words..." print flush
vocabs [ words compile ] each ; vocabs [ words [ compiled? not ] subset compile ] each ;
: count-words ( pred -- ) : count-words ( pred -- )
all-words swap subset length number>string write ; all-words swap subset length number>string write ;

View File

@ -7,11 +7,6 @@ optimizer definitions math compiler.errors threads graphs
generic inference ; generic inference ;
IN: compiler 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 -- ) : ripple-up ( word -- )
compiled-usage [ drop queue-compile ] assoc-each ; compiled-usage [ drop queue-compile ] assoc-each ;
@ -56,7 +51,7 @@ IN: compiler
[ [
H{ } clone compile-queue set H{ } clone compile-queue set
H{ } clone compiled set H{ } clone compiled set
compiled-usages [ queue-compile ] each [ queue-compile ] each
compile-queue get compile-loop compile-queue get compile-loop
compiled get >alist compiled get >alist
] with-scope ; ] with-scope ;

View File

@ -73,11 +73,17 @@ SYMBOL: post-compile-tasks
: after-compilation ( quot -- ) : after-compilation ( quot -- )
post-compile-tasks get push ; 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 ( -- ) : finish-compilation-unit ( -- )
changed-words get keys recompile-hook get call call-recompile-hook
dup [ drop crossref? ] assoc-contains? call-post-compile-tasks
post-compile-tasks get [ call ] each dup [ drop crossref? ] assoc-contains? modify-code-heap
modify-code-heap
changed-definitions notify-definition-observers ; changed-definitions notify-definition-observers ;
: with-compilation-unit ( quot -- ) : with-compilation-unit ( quot -- )

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Slava Pestov. ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: assocs namespaces sequences kernel ; USING: assocs namespaces sequences kernel words ;
IN: inference.state IN: inference.state
! Nesting state to solve recursion ! Nesting state to solve recursion
@ -31,9 +31,6 @@ SYMBOL: current-node
! Words that the current dataflow IR depends on ! Words that the current dataflow IR depends on
SYMBOL: dependencies SYMBOL: dependencies
SYMBOL: +inlined+
SYMBOL: +called+
: depends-on ( word how -- ) : depends-on ( word how -- )
swap dependencies get dup [ swap dependencies get dup [
2dup at +inlined+ eq? [ 3drop ] [ set-at ] if 2dup at +inlined+ eq? [ 3drop ] [ set-at ] if

View File

@ -111,9 +111,17 @@ compiled-crossref global [ H{ } assoc-like ] change-at
dup compiled-unxref dup compiled-unxref
compiled-crossref get delete-at ; compiled-crossref get delete-at ;
SYMBOL: +inlined+
SYMBOL: +called+
: compiled-usage ( word -- assoc ) : compiled-usage ( word -- assoc )
compiled-crossref get at ; 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 -- ) M: word redefined* ( word -- )
{ "inferred-effect" "no-effect" } reset-props ; { "inferred-effect" "no-effect" } reset-props ;