| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2008-01-07 16:14:09 -05:00
										 |  |  | growable namespaces.private assocs words generator command-line | 
					
						
							| 
									
										
										
										
											2008-01-09 04:52:08 -05:00
										 |  |  | 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-07 16:14:09 -05: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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-01-07 16:14:09 -05:00
										 |  |  | "cpu." cpu append require | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-24 03:19:38 -05:00
										 |  |  | : enable-compiler ( -- )
 | 
					
						
							|  |  |  |     [ optimized-recompile-hook ] recompile-hook set-global ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : disable-compiler ( -- )
 | 
					
						
							|  |  |  |     [ default-recompile-hook ] recompile-hook set-global ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | enable-compiler | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  | nl
 | 
					
						
							| 
									
										
										
										
											2008-01-12 22:24:27 -05:00
										 |  |  | "Compiling some words to speed up bootstrap..." write flush
 | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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. | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  | { | 
					
						
							|  |  |  |     roll -roll declare not
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     tuple-class-eq? array? hashtable? vector?
 | 
					
						
							|  |  |  |     tuple? sbuf? node? tombstone? | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     array-capacity array-nth set-array-nth | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     wrap probe | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     delegate | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-16 18:42:56 -05:00
										 |  |  |     underlying | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     find-pair-next namestack* | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     bitand bitor bitxor bitnot
 | 
					
						
							| 
									
										
										
										
											2007-12-26 20:21:46 -05:00
										 |  |  | } compile | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  | "." write flush
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-16 15:17:28 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     + 1+ 1- 2/ < <= > >= shift min | 
					
						
							| 
									
										
										
										
											2007-12-26 20:21:46 -05:00
										 |  |  | } compile | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  | "." write flush
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-21 21:18:24 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  |     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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-21 21:18:24 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     . lines
 | 
					
						
							| 
									
										
										
										
											2007-12-26 20:21:46 -05:00
										 |  |  | } compile | 
					
						
							| 
									
										
										
										
											2007-10-05 17:54:25 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-28 21:45:16 -05:00
										 |  |  | "." write flush
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-21 21:18:24 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-10-14 20:38:23 -04:00
										 |  |  |     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
										 |  |  | " done" print flush
 |