| 
									
										
										
										
											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. | 
					
						
							| 
									
										
										
										
											2014-12-13 19:10:21 -05:00
										 |  |  | USING: accessors arrays assocs | 
					
						
							|  |  |  | compiler.cfg.linear-scan.allocation | 
					
						
							|  |  |  | compiler.cfg.linear-scan.live-intervals fry kernel math | 
					
						
							|  |  |  | namespaces prettyprint sequences strings ;
 | 
					
						
							| 
									
										
										
										
											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-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. ;
 |