1 USING: classes compiler.tree help.markup help.syntax kernel math math.intervals
3 IN: compiler.tree.propagation.info
8 { "interval" interval }
9 { "literal" "a literal value" }
10 { "literal?" boolean }
12 { $description "If interval has zero length and the class is sufficiently precise, we can turn it into a literal." } ;
15 { $values { "obj" object } { "class" class } }
16 { $description "Handle forgotten tuples and singleton classes properly." } ;
18 HELP: node-input-infos
19 { $values { "node" node } { "seq" sequence } }
20 { $description "Lists the value infos for the input variables of an SSA tree node. For " { $link #call } " nodes, the inputs represents the values on the stack when the word is called." } ;
22 HELP: node-output-infos
23 { $values { "node" node } { "seq" sequence } }
24 { $description "Lists the value infos for the output variables of an SSA tree node." } ;
27 { $values { "value" integer } { "info" value-info-state } }
28 { $description "Gets the value info for the given SSA value. If none is found then a null empty interval is returned." } ;
31 { $values { "info1" value-info } { "info2" value-info } { "?" boolean } }
32 { $description "Checks if the first value info is equal to, or smaller than the second one." } ;
34 HELP: value-info-state
35 { $class-description "Represents constraints the compiler knows about the input and output variables to an SSA tree node. It has the following slots:"
37 { { $slot "class" } { "Class of values the variable can take." } }
38 { { $slot "interval" } { "Range of values the variable can take." } }
39 { { $slot "literal" } { "Literal value, if present." } }
40 { { $slot "literal?" } { "Whether the value of the variable is known at compile-time or not." } }
41 { { $slot "slots" } { "If the value is a literal tuple or fixed length type, then slots is a " { $link sequence } " of " { $link value-info-state } " encoding what is known about its slots at compile-time." } }
43 "Don't mutate value infos you receive, always construct new ones. We don't declare the slots read-only to allow cloning followed by writing, and to simplify constructors."
47 { $var-description "Assoc stack of current value --> info mapping" } ;
50 { $values { "interval" interval } { "class" class } { "interval'" interval } }
51 { $description "Wraps an interval to the given numeric types interval." } ;
53 ARTICLE: "compiler.tree.propagation.info" "Value info data type and operations"
60 "Value info operations:"
67 ABOUT: "compiler.tree.propagation.info"