]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.stacks.padding: docs
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 9 May 2015 23:26:43 +0000 (01:26 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 10 May 2015 03:04:23 +0000 (20:04 -0700)
basis/compiler/cfg/stacks/padding/padding-docs.factor [new file with mode: 0644]
basis/compiler/cfg/stacks/padding/padding-tests.factor
basis/compiler/cfg/stacks/padding/padding.factor

diff --git a/basis/compiler/cfg/stacks/padding/padding-docs.factor b/basis/compiler/cfg/stacks/padding/padding-docs.factor
new file mode 100644 (file)
index 0000000..6ea03a7
--- /dev/null
@@ -0,0 +1,9 @@
+USING: assocs compiler.cfg help.markup help.syntax ;
+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
+{ $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." } ;
index 23721b4a63e7202b58ef84b1afecada16441a39f..b74f07c3f44331adc90f6b45d3bd13b71c2d5662 100644 (file)
@@ -154,6 +154,11 @@ IN: compiler.cfg.stacks.padding.tests
     { { 4 { } } { 0 { } } } T{ ##call-gc } visit-insn
 ] unit-test
 
+
+[
+    { { 2 { -1 0 1 } } { 0 { } } } T{ ##call-gc } visit-insn
+] [ overinitialized-when-gc? ] must-fail-with
+
 ! visit-insn ##peek
 {
     { { 3 { 0 } } { 0 { } } }
@@ -596,16 +601,3 @@ IN: compiler.cfg.stacks.padding.tests
         T{ ##peek { loc R 0 } }
     } following-stack-state
 ] [ vacant-peek? ] must-fail-with
-
-
-
-
-
-
-
-
-
-! ! (scan-c-args) run-test flip
-
-
-! seem good: (gamma-random-float>1)
index 18f86ce3e4a16169bf0cf73ad484f03c81a92e91..2ca0b95a3238256fecaf61cab028b18ee1e8dbe0 100644 (file)
@@ -8,7 +8,7 @@ sequences ;
 QUALIFIED: sets
 IN: compiler.cfg.stacks.padding
 
-ERROR: overinitialized-when-calling seq ;
+ERROR: overinitialized-when-gc seq ;
 ERROR: vacant-when-calling seq ;
 
 : safe-iota ( n -- seq )
@@ -62,7 +62,7 @@ CONSTANT: initial-state { { 0 { } } { 0 { } } }
 
 : ensure-no-overinitialized ( state -- )
     [ second [ 0 < ] filter ] map dup { { } { } } =
-    [ drop ] [ overinitialized-when-calling ] if ;
+    [ drop ] [ overinitialized-when-gc ] if ;
 
 : fill-vacancies ( state -- state' )
     [ fill-stack ] map ;