Docs: more compiler docs

db4
Björn Lindqvist 2014-12-10 16:17:19 +01:00
parent 5fe9ce4235
commit 53b7f82368
5 changed files with 26 additions and 8 deletions

View File

@ -4,6 +4,10 @@ IN: compiler.cfg.build-stack-frame
ARTICLE: "compiler.cfg.build-stack-frame" "Computing stack frame size and layout"
"The " { $vocab-link "compiler.cfg.build-stack-frame" } " vocab builds stack frames for cfg:s." ;
HELP: param-area-size
{ $var-description "Temporary variable used when building stack frames to calculate the parameter area size." }
{ $see-also build-stack-frame } ;
HELP: frame-required?
{ $var-description "Whether the word being compiled requires a stack frame or not. Most words does, but very simple words does not." } ;

View File

@ -36,6 +36,10 @@ HELP: uses-vregs
}
} ;
HELP: special-vreg-insns
{ $var-description "Instructions with unusual operands, also see these passes for special behavior:" { $list "compiler.cfg.renaming.functor" "compiler.cfg.representations.preferred" }
} ;
ARTICLE: "compiler.cfg.def-use" "Common code used by several passes for def-use analysis"
"The " { $vocab-link "compiler.cfg.def-use" } " contains tools to correlate SSA instructions with virtual registers defined or used by them."
$nl

View File

@ -20,10 +20,6 @@ M: insn defs-vregs drop { } ;
M: insn temp-vregs drop { } ;
M: insn uses-vregs drop { } ;
! Instructions with unusual operands, also see these passes
! for special behavior:
! - compiler.cfg.renaming.functor
! - compiler.cfg.representations.preferred
CONSTANT: special-vreg-insns {
##parallel-copy
##phi

View File

@ -1,6 +1,6 @@
USING: arrays assocs classes compiler.cfg compiler.codegen.gc-maps
USING: alien arrays assocs classes compiler.cfg compiler.codegen.gc-maps
cpu.architecture help.markup help.syntax kernel layouts sequences
slots.private ;
slots.private system ;
IN: compiler.cfg.instructions
HELP: new-insn
@ -62,7 +62,10 @@ HELP: ##alien-invoke
"An instruction for calling a function in a dynamically linked library. It has the following slots:"
{ $table
{ { $slot "reg-inputs" } { "Registers to use for the arguments to the function call." } }
{ { $slot "stack-inputs" } { "Stack slots used for the arguments to the function call. Only used if all register arguments are already filled." } }
{
{ $slot "stack-inputs" }
{ "Stack slots used for the arguments to the function call." }
}
{
{ $slot "reg-outputs" }
{ "If the called function returns a value, then this slot is a one-element sequence containing a 3-tuple describing which register is used for the return value." }
@ -70,6 +73,7 @@ HELP: ##alien-invoke
{ { $slot "symbols" } { "Name of the function to call." } }
{ { $slot "dll" } { "A dll handle." } }
}
"Which function arguments that goes in " { $slot "reg-inputs" } " and which goes in " { $slot "stack-inputs" } " depend on the calling convention. In " { $link cdecl } " on " { $link x86.32 } ", all arguments goes in " { $slot "stack-inputs" } " but on " { $link x86.64 } " the first six arguments are passed in registers and only then are the stack used."
} ;
HELP: alien-call-insn

View File

@ -98,7 +98,17 @@ HELP: %load-immediate
HELP: %call
{ $values { "word" word } }
{ $description "Emits code for calling a word in Factor." } ;
{ $description "Emits code for calling a Factor word." } ;
HELP: %box
{ $values
{ "dst" "destination register" }
{ "src" "source register" }
{ "func" "function?" }
{ "rep" "representation class" }
{ "gc-map" gc-map }
}
{ $description "Call a function to convert a value into a tagged pointer, possibly allocating a bignum, float, or alien instance, which is then pushed on the data stack." } ;
HELP: %box-alien
{ $values { "dst" "destination register" } { "src" "source register" } { "temp" "temporary register" } }