From 2f71e91dcead52a778c9610288e44350e91ed917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Fri, 9 Sep 2016 08:06:02 +0200 Subject: [PATCH] compiler.cfg.stacks.*: rename trace-stack-state2 -> trace-stack-state --- .../cfg/stacks/clearing/clearing.factor | 6 +++--- .../cfg/stacks/padding/padding-docs.factor | 2 +- .../cfg/stacks/padding/padding-tests.factor | 18 +++++++++--------- .../compiler/cfg/stacks/padding/padding.factor | 4 ++-- .../cfg/stacks/vacant/vacant-docs.factor | 2 +- basis/compiler/cfg/stacks/vacant/vacant.factor | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/basis/compiler/cfg/stacks/clearing/clearing.factor b/basis/compiler/cfg/stacks/clearing/clearing.factor index 86ff38a549..d3310072bb 100644 --- a/basis/compiler/cfg/stacks/clearing/clearing.factor +++ b/basis/compiler/cfg/stacks/clearing/clearing.factor @@ -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 ; diff --git a/basis/compiler/cfg/stacks/padding/padding-docs.factor b/basis/compiler/cfg/stacks/padding/padding-docs.factor index 6ea03a7023..edf0b612f8 100644 --- a/basis/compiler/cfg/stacks/padding/padding-docs.factor +++ b/basis/compiler/cfg/stacks/padding/padding-docs.factor @@ -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." } ; diff --git a/basis/compiler/cfg/stacks/padding/padding-tests.factor b/basis/compiler/cfg/stacks/padding/padding-tests.factor index 49c34313b1..0b01075319 100644 --- a/basis/compiler/cfg/stacks/padding/padding-tests.factor +++ b/basis/compiler/cfg/stacks/padding/padding-tests.factor @@ -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 diff --git a/basis/compiler/cfg/stacks/padding/padding.factor b/basis/compiler/cfg/stacks/padding/padding.factor index 6daa64ec5c..9bc5d9a8c4 100644 --- a/basis/compiler/cfg/stacks/padding/padding.factor +++ b/basis/compiler/cfg/stacks/padding/padding.factor @@ -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 ; diff --git a/basis/compiler/cfg/stacks/vacant/vacant-docs.factor b/basis/compiler/cfg/stacks/vacant/vacant-docs.factor index 0670195b38..b49f13bae3 100644 --- a/basis/compiler/cfg/stacks/vacant/vacant-docs.factor +++ b/basis/compiler/cfg/stacks/vacant/vacant-docs.factor @@ -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 diff --git a/basis/compiler/cfg/stacks/vacant/vacant.factor b/basis/compiler/cfg/stacks/vacant/vacant.factor index 32806425e3..d6dcc9e7ad 100644 --- a/basis/compiler/cfg/stacks/vacant/vacant.factor +++ b/basis/compiler/cfg/stacks/vacant/vacant.factor @@ -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 ;