USING: assocs compiler.cfg compiler.cfg.builder.blocks
compiler.cfg.stacks.local compiler.tree help.markup help.syntax literals math
-multiline sequences words ;
+multiline sequences vectors words ;
IN: compiler.cfg.builder
<<
>>
HELP: procedures
-{ $var-description "Used as a temporary storage for the current cfg during construction of all cfgs." } ;
+{ $var-description "A " { $link vector } " used as temporary storage during cfg construction for all procedures being built." } ;
HELP: make-input-map
{ $values { "#shuffle" #shuffle } { "assoc" assoc } }
HELP: record-stack-heights
{ $values { "ds-height" number } { "rs-height" number } { "bb" basic-block } }
-{ $description "Does something." } ;
+{ $description "Sets the data and retain stack heights in relation to the cfg of this basic block." } ;
HELP: ds-heights
{ $var-description "Assoc that records the data stacks height at the entry of each " { $link basic-block } "." } ;
"{ T{ ##inc-d { n 4 } } T{ ##inc-r { n -2 } } }"
}
} ;
+
+ARTICLE: "compiler.cfg.stacks.local" "Local stack analysis"
+"Local stack analysis. We build three sets for every basic block in the CFG:"
+{ $list
+ "peek-set: all stack locations that the block reads before writing"
+ "replace-set: all stack locations that the block writes"
+ "kill-set: all stack locations which become unavailable after the block ends because of the stack height being decremented" }
+"This is done while constructing the CFG." ;
+
+
+ABOUT: "compiler.cfg.stacks.local"
FROM: namespaces => set ;
IN: compiler.cfg.stacks.local
-! Local stack analysis. We build three sets for every basic block
-! in the CFG:
-! - peek-set: all stack locations that the block reads before writing
-! - replace-set: all stack locations that the block writes
-! - kill-set: all stack locations which become unavailable after the
-! block ends because of the stack height being decremented
-! This is done while constructing the CFG.
-
SYMBOLS: peek-sets replace-sets kill-sets ;
SYMBOL: locs>vregs
-USING: compiler.cfg.stacks.local help.markup help.syntax math sequences ;
+USING: compiler.cfg.stacks.local compiler.tree help.markup help.syntax math
+sequences ;
IN: compiler.cfg.stacks
+HELP: ds-push
+{ $values { "vreg" "a virtual register" } }
+{ $description "Used when translating the " { $link #push } " SSA node to CFG form for pushing a literal value onto the data stack." } ;
+
HELP: begin-stack-analysis
{ $description "Initializes a set of variables related to stack analysis of Factor words." }
{ $see-also current-height } ;