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
|
kernel kernel.private layouts assocs words summary arrays
|
||||||
combinators classes.algebra alien alien.c-types alien.structs
|
combinators classes.algebra alien alien.c-types alien.structs
|
||||||
alien.strings alien.arrays alien.complex alien.libraries sets libc
|
alien.strings alien.arrays alien.complex alien.libraries sets libc
|
||||||
continuations.private fry cpu.architecture
|
continuations.private fry cpu.architecture classes
|
||||||
source-files.errors
|
source-files.errors
|
||||||
compiler.errors
|
compiler.errors
|
||||||
compiler.alien
|
compiler.alien
|
||||||
|
@ -18,6 +18,10 @@ compiler.codegen.fixup
|
||||||
compiler.utilities ;
|
compiler.utilities ;
|
||||||
IN: compiler.codegen
|
IN: compiler.codegen
|
||||||
|
|
||||||
|
SYMBOL: insn-counts
|
||||||
|
|
||||||
|
H{ } clone insn-counts set-global
|
||||||
|
|
||||||
GENERIC: generate-insn ( insn -- )
|
GENERIC: generate-insn ( insn -- )
|
||||||
|
|
||||||
SYMBOL: registers
|
SYMBOL: registers
|
||||||
|
@ -54,7 +58,12 @@ SYMBOL: labels
|
||||||
[ word>> init-generator ]
|
[ word>> init-generator ]
|
||||||
[
|
[
|
||||||
instructions>>
|
instructions>>
|
||||||
[ [ regs>> registers set ] [ generate-insn ] bi ] each
|
[
|
||||||
|
[ class insn-counts get inc-at ]
|
||||||
|
[ regs>> registers set ]
|
||||||
|
[ generate-insn ]
|
||||||
|
tri
|
||||||
|
] each
|
||||||
] bi
|
] bi
|
||||||
] with-fixup ;
|
] with-fixup ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue