2009-06-22 01:24:51 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								! Copyright (C) 2008, 2009 Slava Pestov.
							 | 
						
					
						
							
								
									
										
										
										
											2008-09-15 02:54:48 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								! See http://factorcode.org/license.txt for BSD license.
							 | 
						
					
						
							
								
									
										
										
										
											2008-11-04 18:23:20 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								USING: accessors kernel sequences sets arrays math strings fry
							 | 
						
					
						
							
								
									
										
										
										
											2009-06-22 01:24:51 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								namespaces prettyprint compiler.cfg.linear-scan.live-intervals
							 | 
						
					
						
							
								
									
										
										
										
											2009-07-07 04:28:55 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								compiler.cfg.linear-scan.allocation compiler.cfg assocs ;
							 | 
						
					
						
							
								
									
										
										
										
											2010-02-26 16:28:38 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								FROM: namespaces => set ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-09-15 02:54:48 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								IN: compiler.cfg.linear-scan.debugger
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: check-linear-scan ( live-intervals machine-registers -- )
							 | 
						
					
						
							
								
									
										
										
										
											2009-07-07 04:28:55 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    [
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        [ clone ] map dup [ [ vreg>> ] keep ] H{ } map>assoc
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        live-intervals set
							 | 
						
					
						
							
								
									
										
										
										
											2009-08-30 05:52:01 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        f
							 | 
						
					
						
							
								
									
										
										
										
											2009-07-30 03:13:30 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    ] dip
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    allocate-registers drop ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-11-04 18:23:20 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: picture ( uses -- str )
							 | 
						
					
						
							
								
									
										
										
										
											2009-05-25 17:38:33 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    dup last 1 + CHAR: space <string>
							 | 
						
					
						
							
								
									
										
										
										
											2008-11-04 18:23:20 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    [ '[ CHAR: * swap _ set-nth ] each ] keep ;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: interval-picture ( interval -- str )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    [ uses>> picture ]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    [ vreg>> unparse ]
							 | 
						
					
						
							
								
									
										
										
										
											2009-08-05 19:57:46 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bi 2array ;
							 | 
						
					
						
							
								
									
										
										
										
											2008-11-04 18:23:20 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								: live-intervals. ( seq -- )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    [ interval-picture ] map simple-table. ;
							 |