compiler.cfg.stacks.*: rename trace-stack-state2 -> trace-stack-state
parent
0d57734dab
commit
2f71e91dce
|
@ -1,6 +1,6 @@
|
|||
USING: accessors arrays assocs combinators.short-circuit
|
||||
USING: accessors assocs combinators.short-circuit
|
||||
compiler.cfg.instructions compiler.cfg.registers compiler.cfg.rpo
|
||||
compiler.cfg.stacks compiler.cfg.stacks.padding kernel math sequences ;
|
||||
compiler.cfg.stacks compiler.cfg.stacks.padding kernel sequences ;
|
||||
IN: compiler.cfg.stacks.clearing
|
||||
|
||||
: state>clears ( state -- clears )
|
||||
|
@ -19,6 +19,6 @@ IN: compiler.cfg.stacks.clearing
|
|||
[ [ clearing-insns ] keep suffix ] with map V{ } concat-as ;
|
||||
|
||||
: clear-uninitialized ( cfg -- )
|
||||
[ trace-stack-state2 ] keep [
|
||||
[ trace-stack-state ] keep [
|
||||
[ visit-insns ] change-instructions drop
|
||||
] with each-basic-block ;
|
||||
|
|
|
@ -4,6 +4,6 @@ IN: compiler.cfg.stacks.padding
|
|||
HELP: initial-state
|
||||
{ $description "Initially the stack bottom is at 0 for both the data and retain stacks and no replaces have been registered." } ;
|
||||
|
||||
HELP: trace-stack-state2
|
||||
HELP: trace-stack-state
|
||||
{ $values { "cfg" cfg } { "assoc" assoc } }
|
||||
{ $description "Outputs an assoc with the instruction numbers as keys and as values two tuples of the data and retain stacks shapes before that instruction. All instructions in the cfg gets numbered as a side-effect." } ;
|
||||
|
|
|
@ -121,10 +121,10 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
] [ vacant-peek? ] must-fail-with
|
||||
|
||||
: following-stack-state ( insns -- state )
|
||||
T{ ##branch } suffix insns>cfg trace-stack-state2
|
||||
T{ ##branch } suffix insns>cfg trace-stack-state
|
||||
>alist [ first ] sort-with last second ;
|
||||
|
||||
! trace-stack-state2
|
||||
! trace-stack-state
|
||||
{
|
||||
H{
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
T{ ##inc f D: 2 }
|
||||
T{ ##peek f f D: 2 }
|
||||
T{ ##inc f D: 0 }
|
||||
} insns>cfg trace-stack-state2
|
||||
} insns>cfg trace-stack-state
|
||||
] unit-test
|
||||
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
}
|
||||
} [
|
||||
V{ T{ ##safepoint } T{ ##prologue } T{ ##branch } }
|
||||
insns>cfg trace-stack-state2
|
||||
insns>cfg trace-stack-state
|
||||
] unit-test
|
||||
|
||||
! The peek "causes" the vacant locations to become populated.
|
||||
|
@ -172,7 +172,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
T{ ##peek { loc D: 3 } }
|
||||
T{ ##branch }
|
||||
}
|
||||
insns>cfg trace-stack-state2
|
||||
insns>cfg trace-stack-state
|
||||
] unit-test
|
||||
|
||||
: cfg1 ( -- cfg )
|
||||
|
@ -193,7 +193,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
{ 2 { { 1 { } } { 0 { } } } }
|
||||
{ 3 { { 1 { } } { 0 { } } } }
|
||||
}
|
||||
} [ cfg1 trace-stack-state2 ] unit-test
|
||||
} [ cfg1 trace-stack-state ] unit-test
|
||||
|
||||
! Same cfg structure as the bug1021:run-test word but with
|
||||
! non-datastack instructions mostly omitted.
|
||||
|
@ -271,7 +271,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
{ 22 { { 4 { } } { 0 { } } } }
|
||||
}
|
||||
} [
|
||||
bug1021-cfg trace-stack-state2
|
||||
bug1021-cfg trace-stack-state
|
||||
] unit-test
|
||||
|
||||
! Same cfg structure as the bug1289:run-test word but with
|
||||
|
@ -409,7 +409,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
{ 31 { { 2 { 0 } } { 1 { } } } }
|
||||
{ 32 { { 2 { 0 } } { 0 { } } } }
|
||||
}
|
||||
} [ bug1289-cfg trace-stack-state2 ] unit-test
|
||||
} [ bug1289-cfg trace-stack-state ] unit-test
|
||||
|
||||
: bug-benchmark-terrain-cfg ( -- cfg )
|
||||
H{
|
||||
|
@ -578,7 +578,7 @@ IN: compiler.cfg.stacks.padding.tests
|
|||
{ 36 { { -1 { } } { 0 { } } } }
|
||||
}
|
||||
} [
|
||||
bug-benchmark-terrain-cfg trace-stack-state2
|
||||
bug-benchmark-terrain-cfg trace-stack-state
|
||||
] unit-test
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2015 Björn Lindqvist.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays assocs compiler.cfg.dataflow-analysis
|
||||
compiler.cfg.instructions compiler.cfg.linearization compiler.cfg.registers
|
||||
compiler.cfg.instructions compiler.cfg.linearization
|
||||
compiler.cfg.stacks.local fry kernel math math.order namespaces
|
||||
sequences ;
|
||||
QUALIFIED: sets
|
||||
|
@ -99,7 +99,7 @@ M: padding join-sets ( sets bb dfa -- set )
|
|||
: uniquely-number-instructions ( cfg -- )
|
||||
cfg>insns [ swap insn#<< ] each-index ;
|
||||
|
||||
: trace-stack-state2 ( cfg -- assoc )
|
||||
: trace-stack-state ( cfg -- assoc )
|
||||
H{ } clone stack-record set
|
||||
[ uniquely-number-instructions ] [ compute-padding-sets ] bi
|
||||
stack-record get ;
|
||||
|
|
|
@ -19,7 +19,7 @@ HELP: fill-gc-maps
|
|||
|
||||
HELP: state>gc-data
|
||||
{ $values { "state" sequence } { "gc-data" sequence } }
|
||||
{ $description "Takes a stack state on the format given by " { $link trace-stack-state2 } " and emits an array containing two bit-patterns with locations on the data and retain stacks to scrub." } ;
|
||||
{ $description "Takes a stack state on the format given by " { $link trace-stack-state } " and emits an array containing two bit-patterns with locations on the data and retain stacks to scrub." } ;
|
||||
|
||||
HELP: vacant>bits
|
||||
{ $values
|
||||
|
|
|
@ -16,5 +16,5 @@ IN: compiler.cfg.stacks.vacant
|
|||
swap state>gc-data first2 -rot >>scrub-d swap >>scrub-r drop ;
|
||||
|
||||
: fill-gc-maps ( cfg -- )
|
||||
[ trace-stack-state2 ] [ cfg>insns [ gc-map-insn? ] filter ] bi
|
||||
[ trace-stack-state ] [ cfg>insns [ gc-map-insn? ] filter ] bi
|
||||
[ [ insn#>> of ] [ gc-map>> ] bi set-gc-map ] with each ;
|
||||
|
|
Loading…
Reference in New Issue