Docs: more compiler documentation
parent
d074f1a9c9
commit
0bb3e2397b
|
@ -1,8 +1,11 @@
|
||||||
USING: compiler.cfg help.markup help.syntax ;
|
USING: compiler.cfg help.markup help.syntax vectors ;
|
||||||
|
|
||||||
HELP: basic-block
|
HELP: basic-block
|
||||||
{ $class-description
|
{ $class-description
|
||||||
"Factors representation of a basic block in the cfg. A basic block is a sequence of instructions that always are executed sequentially and doesn't contain any branching."
|
"Factors representation of a basic block in the cfg. A basic block is a sequence of instructions that always are executed sequentially and doesn't contain any branching. It has the following slots:"
|
||||||
|
{ $table
|
||||||
|
{ { $slot "successors" } { "A " { $link vector } " of basic blocks that may be executed directly after this block. Most blocks only have one successor but a block that checks where an if-condition should branch to would have two for example." } }
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: <basic-block>
|
HELP: <basic-block>
|
||||||
|
|
|
@ -11,6 +11,11 @@ HELP: ##inc-d
|
||||||
"An instruction that increases or decreases the data stacks size by n. For example, " { $link 2drop } " decreases it by two and pushing an item increases it by one."
|
"An instruction that increases or decreases the data stacks size by n. For example, " { $link 2drop } " decreases it by two and pushing an item increases it by one."
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
HELP: ##alien-invoke
|
||||||
|
{ $class-description
|
||||||
|
"An instruction for calling a function in a dynamically linked library."
|
||||||
|
} ;
|
||||||
|
|
||||||
HELP: ##set-slot
|
HELP: ##set-slot
|
||||||
{ $class-description
|
{ $class-description
|
||||||
"An instruction for non-primitive non-immediate variant of " { $link set-slot } ". It has the following slots:"
|
"An instruction for non-primitive non-immediate variant of " { $link set-slot } ". It has the following slots:"
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
USING: compiler.cfg help.markup help.syntax ;
|
||||||
|
IN: compiler.cfg.stacks.local
|
||||||
|
|
||||||
|
HELP: current-height
|
||||||
|
{ $class-description "A tuple used to keep track of the heights of the data and retain stacks in a " { $link basic-block } "." } ;
|
||||||
|
|
||||||
|
HELP: emit-height-changes
|
||||||
|
{ $description "Emits stack height change instructions to the CFG being built." }
|
||||||
|
{ $examples
|
||||||
|
{ $example
|
||||||
|
"USING: compiler.cfg.stacks.local make prettyprint ;"
|
||||||
|
"T{ current-height { emit-d 4 } { emit-r -2 } } current-height set [ emit-height-changes ] { } make ."
|
||||||
|
"{ T{ ##inc-d { n 4 } } T{ ##inc-r { n -2 } } }"
|
||||||
|
}
|
||||||
|
} ;
|
|
@ -1,6 +1,13 @@
|
||||||
USING: assocs help.markup help.syntax kernel sequences stack-checker.visitor ;
|
USING: assocs help.markup help.syntax kernel sequences stack-checker.alien
|
||||||
|
stack-checker.visitor ;
|
||||||
IN: compiler.tree
|
IN: compiler.tree
|
||||||
|
|
||||||
|
HELP: #alien-node
|
||||||
|
{ $class-description "Base class for alien nodes. Its " { $snippet "params" } " slot holds an instance of the " { $link alien-node-params } " class." } ;
|
||||||
|
|
||||||
|
HELP: #alien-invoke
|
||||||
|
{ $class-description "SSA tree node that calls a function in a dynamically linked library." } ;
|
||||||
|
|
||||||
HELP: #call
|
HELP: #call
|
||||||
{ $class-description "SSA tree node that calls a word." } ;
|
{ $class-description "SSA tree node that calls a word." } ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue