factor/core/bootstrap/compiler/compiler.factor

80 lines
1.6 KiB
Factor
Raw Normal View History

2008-01-01 14:54:14 -05:00
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2007-10-29 01:12:27 -04:00
USING: compiler cpu.architecture vocabs.loader system sequences
namespaces parser kernel kernel.private classes classes.private
2007-09-20 18:09:08 -04:00
arrays hashtables vectors tuples sbufs inference.dataflow
hashtables.private sequences.private math tuples.private
growable namespaces.private assocs words generator command-line
vocabs io prettyprint libc compiler.units ;
2007-12-24 21:54:45 -05:00
IN: bootstrap.compiler
2007-09-20 18:09:08 -04:00
! Don't bring this in when deploying, since it will store a
! reference to 'eval' in a global variable
"deploy-vocab" get [
"alien.remote-control" require
] unless
2007-09-20 18:09:08 -04:00
"cpu." cpu append require
2007-09-20 18:09:08 -04:00
nl
"Compiling some words to speed up bootstrap..." write
2007-12-26 20:21:46 -05:00
! 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
2007-09-20 18:09:08 -04:00
tuple-class-eq? array? hashtable? vector?
tuple? sbuf? node? tombstone?
2007-09-20 18:09:08 -04:00
array-capacity array-nth set-array-nth
2007-09-20 18:09:08 -04:00
wrap probe
2007-09-20 18:09:08 -04:00
delegate
2007-09-20 18:09:08 -04:00
underlying
2007-09-20 18:09:08 -04:00
find-pair-next namestack*
2007-09-20 18:09:08 -04:00
bitand bitor bitxor bitnot
2007-12-26 20:21:46 -05:00
} compile
2007-09-20 18:09:08 -04:00
"." write flush
2007-12-16 15:17:28 -05:00
{
+ 1+ 1- 2/ < <= > >= shift min
2007-12-26 20:21:46 -05:00
} compile
2007-09-20 18:09:08 -04:00
"." write flush
{
new nth push pop peek
} compile
"." write flush
{
hashcode* = get set
2007-12-26 20:21:46 -05:00
} compile
2007-09-20 18:09:08 -04:00
2008-01-01 14:54:14 -05:00
"." write flush
{
. lines
2007-12-26 20:21:46 -05:00
} compile
"." write flush
{
malloc free memcpy
2007-12-26 20:21:46 -05:00
} compile
2007-09-20 18:09:08 -04:00
2008-01-01 14:54:14 -05:00
[ compiled-usages recompile ] recompile-hook set-global
2008-01-01 14:54:14 -05:00
" done" print flush