-USING: alien alien.c-types compiler.tree effects help.markup help.syntax
+USING: alien alien.c-types compiler.tree help.markup help.syntax
quotations sequences ;
IN: stack-checker.alien
}
} ;
+HELP: infer-alien-assembly
+{ $description "Infers " { $link alien-assembly } " calls." } ;
+
HELP: infer-alien-invoke
{ $description "Appends the necessary SSA nodes for performing an " { $link alien-invoke } " call to the IR tree being constructed." } ;
"]"
}
} ;
+
+ARTICLE: "stack-checker.alien" "Inferring alien words" "This vocab contains code for inferring the words that form part of the alien FFI: " { $link alien-invoke } ", " { $link alien-indirect } ", " { $link alien-assembly } " and " { $link alien-callback } ". The words performing the inferring are:"
+{ $subsections
+ infer-alien-invoke
+ infer-alien-indirect
+ infer-alien-assembly
+ infer-alien-callback
+} ;
+
+ABOUT: "stack-checker.alien"
HELP: with-infer
{ $values { "quot" quotation } { "effect" effect } { "visitor" "a visitor, if any" } }
{ $description "Initializes the inference engine and then runs the given quotation which is supposed to perform the inferencing." } ;
+
+ARTICLE: "stack-checker.backend" "Stack effect inference implementation"
+"Contains words for manipulating the compile-time data and retainstacks:"
+{ $subsections
+ peek-d
+ pop-d
+ pop-literal
+ pop-r
+ push-d
+ push-literal
+ push-r
+} ;
+
+ABOUT: "stack-checker.backend"
-USING: compiler.tree effects help.markup help.syntax quotations sequences
-stack-checker.values stack-checker.visitor ;
+USING: compiler.tree effects help.markup help.syntax sequences
+stack-checker.backend stack-checker.values stack-checker.visitor ;
IN: stack-checker.state
+HELP: (meta-d)
+{ $var-description "Compile-time datastack." } ;
+
+HELP: (meta-r)
+{ $var-description "Compile-time retainstack." } ;
+
HELP: terminated?
{ $var-description "Did the current control-flow path throw an error?" } ;
HELP: commit-literals
{ $description "Outputs all remaining literals to the current " { $link stack-visitor } " as " { $link #push } " instructions. They are also pushed onto the compile-time data stack." }
-{ $see-also meta-d } ;
+{ $see-also meta-d literals } ;
HELP: input-count
-{ $var-description "Number of inputs current word expects from the stack." } ;
+{ $var-description "Number of inputs current word expects from the stack. The value is set by the word " { $link introduce-values } "." } ;
HELP: meta-d
{ $values { "stack" sequence } }
HELP: (push-literal)
{ $values { "obj" "a literal" } }
{ $description "Pushes a literal value to the end of the current " { $link stack-visitor } ". The literal is also given a number and registered in the assoc of " { $link known-values } "." } ;
+
+ARTICLE: "stack-checker.state" "Variables for holding stack effect inference state" "Variables for holding stack effect inference state. Access to the compile-time stacks:"
+{ $subsections meta-d meta-r } ;
+
+ABOUT: "stack-checker.state"
-USING: compiler.tree help.markup help.syntax kernel sequences words ;
+USING: compiler.tree help.markup help.syntax kernel sequences vectors
+;
IN: stack-checker.visitor
+HELP: stack-visitor
+{ $var-description { $link vector } " that collects tree nodes when the SSA tree is built." } ;
+
HELP: #>r,
{ $values { "inputs" sequence } { "outputs" sequence } }
{ $description "Emits a " { $link #shuffle } " node that copies values from the data stack to the retain stack. This node is primarily outputted by the " { $link dip } " word and its relatives." }