1 ! Copyright (C) 2007, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors compiler cpu.architecture vocabs.loader system
4 sequences namespaces parser kernel kernel.private classes
5 classes.private arrays hashtables vectors classes.tuple sbufs
6 hashtables.private sequences.private math classes.tuple.private
7 growable namespaces.private assocs words command-line vocabs io
8 io.encodings.string prettyprint libc splitting math.parser
9 compiler.units math.order compiler.tree.builder
10 compiler.tree.optimizer ;
11 IN: bootstrap.compiler
13 ! Don't bring this in when deploying, since it will store a
14 ! reference to 'eval' in a global variable
16 "alien.remote-control" require
19 "cpu." cpu name>> append require
23 : compile-uncompiled ( words -- )
24 [ compiled>> not ] filter compile ;
27 "Compiling..." write flush
29 ! Compile a set of words ahead of the full compile.
30 ! This set of words was determined semi-empirically
31 ! using the profiler. It improves bootstrap time
32 ! significantly, because frequenly called words
33 ! which are also quick to compile are replaced by
34 ! compiled definitions as soon as possible.
36 roll -roll declare not
38 array? hashtable? vector?
39 tuple? sbuf? tombstone?
41 array-nth set-array-nth
51 bitand bitor bitxor bitnot
57 + 1+ 1- 2/ < <= > >= shift
63 new-sequence nth push pop peek
75 memq? split harvest sift cut cut-slice start index clone
76 set-at reverse push-all class number>string string>number
82 lines prefix suffix unclip new-assoc update
83 word-prop set-word-prop 1array 2array 3array ?nth
89 . malloc calloc free memcpy
92 { build-tree } compile-uncompiled
94 { optimize-tree } compile-uncompiled
96 vocabs [ words compile-uncompiled "." write flush ] each