compiler.codegen: collect instruction statistics
							parent
							
								
									9fa71959b5
								
							
						
					
					
						commit
						31555b05cf
					
				| 
						 | 
				
			
			@ -4,7 +4,7 @@ USING: namespaces make math math.order math.parser sequences accessors
 | 
			
		|||
kernel kernel.private layouts assocs words summary arrays
 | 
			
		||||
combinators classes.algebra alien alien.c-types alien.structs
 | 
			
		||||
alien.strings alien.arrays alien.complex alien.libraries sets libc
 | 
			
		||||
continuations.private fry cpu.architecture
 | 
			
		||||
continuations.private fry cpu.architecture classes
 | 
			
		||||
source-files.errors
 | 
			
		||||
compiler.errors
 | 
			
		||||
compiler.alien
 | 
			
		||||
| 
						 | 
				
			
			@ -18,6 +18,10 @@ compiler.codegen.fixup
 | 
			
		|||
compiler.utilities ;
 | 
			
		||||
IN: compiler.codegen
 | 
			
		||||
 | 
			
		||||
SYMBOL: insn-counts
 | 
			
		||||
 | 
			
		||||
H{ } clone insn-counts set-global
 | 
			
		||||
 | 
			
		||||
GENERIC: generate-insn ( insn -- )
 | 
			
		||||
 | 
			
		||||
SYMBOL: registers
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +58,12 @@ SYMBOL: labels
 | 
			
		|||
        [ word>> init-generator ]
 | 
			
		||||
        [
 | 
			
		||||
            instructions>>
 | 
			
		||||
            [ [ regs>> registers set ] [ generate-insn ] bi ] each
 | 
			
		||||
            [
 | 
			
		||||
                [ class insn-counts get inc-at ]
 | 
			
		||||
                [ regs>> registers set ]
 | 
			
		||||
                [ generate-insn ]
 | 
			
		||||
                tri
 | 
			
		||||
            ] each
 | 
			
		||||
        ] bi
 | 
			
		||||
    ] with-fixup ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue