compiler.*: new docs

char-rename
Björn Lindqvist 2016-08-01 21:50:30 +02:00
parent e359f3fca4
commit 2e332f73b5
5 changed files with 39 additions and 14 deletions

View File

@ -1,5 +1,5 @@
USING: alien.c-types compiler.cfg.instructions help.markup help.syntax make USING: alien.c-types compiler.cfg.instructions help.markup help.syntax
math ; math sequences ;
IN: compiler.cfg.builder.alien.boxing IN: compiler.cfg.builder.alien.boxing
HELP: box HELP: box
@ -36,6 +36,10 @@ HELP: box-return
} }
{ $see-also ##box-alien } ; { $see-also ##box-alien } ;
HELP: flatten-c-type
{ $values { "c-type" abstract-c-type } { "pairs" sequence } }
{ $description "pairs have shape { rep on-stack? f }" } ;
HELP: stack-size HELP: stack-size
{ $values { $values
{ "c-type" c-type } { "c-type" c-type }

View File

@ -10,7 +10,6 @@ IN: compiler.cfg.builder.alien.boxing
SYMBOL: struct-return-area SYMBOL: struct-return-area
! pairs have shape { rep on-stack? }
GENERIC: flatten-c-type ( c-type -- pairs ) GENERIC: flatten-c-type ( c-type -- pairs )
M: c-type flatten-c-type M: c-type flatten-c-type

View File

@ -1,9 +1,6 @@
USING: cpu.architecture help.markup help.syntax math ; USING: cpu.architecture help.markup help.syntax kernel math vectors ;
IN: compiler.cfg.builder.alien.params IN: compiler.cfg.builder.alien.params
HELP: stack-params
{ $var-description "Count of the number of bytes of stack allocation required to store the current call frames parameters." } ;
HELP: alloc-stack-param HELP: alloc-stack-param
{ $values { "rep" representation } { "n" integer } } { $values { "rep" representation } { "n" integer } }
{ $description "Allocates space for a stack parameter value of the given representation and returns the previous stack parameter offset." } { $description "Allocates space for a stack parameter value of the given representation and returns the previous stack parameter offset." }
@ -15,3 +12,15 @@ HELP: alloc-stack-param
"0" "0"
} }
} ; } ;
HELP: reg-class-full?
{ $values { "reg-class" vector } { "odd-register?" boolean } { "?" boolean } }
{ $description "The register class is full if there are no registers left in it, or if there is only one register and 'odd-register?' is " { $link t } ". If it is full, then it is emptied as a side-effect." } ;
HELP: stack-params
{ $var-description "Count of the number of bytes of stack allocation required to store the current call frames parameters." } ;
ARTICLE: "compiler.cfg.builder.alien.params"
"Allocation for alien node parameters" "This vocab allocates registers and spill slots for alien calls." ;
ABOUT: "compiler.cfg.builder.alien.params"

View File

@ -2,8 +2,8 @@ USING: alien arrays assocs byte-arrays classes combinators
compiler.cfg compiler.cfg.builder compiler.cfg.intrinsics.fixnum compiler.cfg compiler.cfg.builder compiler.cfg.intrinsics.fixnum
compiler.cfg.linear-scan.assignment compiler.cfg.liveness compiler.cfg.linear-scan.assignment compiler.cfg.liveness
compiler.cfg.ssa.destruction compiler.cfg.value-numbering compiler.cfg.ssa.destruction compiler.cfg.value-numbering
compiler.codegen.gc-maps cpu.architecture help.markup help.syntax compiler.codegen.gc-maps compiler.tree cpu.architecture help.markup
kernel layouts math sequences slots.private system vm ; help.syntax kernel layouts math sequences slots.private system vm ;
IN: compiler.cfg.instructions IN: compiler.cfg.instructions
HELP: ##alien-invoke HELP: ##alien-invoke
@ -31,7 +31,17 @@ HELP: ##alien-invoke
} }
"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" } ", in " { $link x86.64 } " the first six arguments are passed in registers and then stack parameters are used for the remainder." "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" } ", in " { $link x86.64 } " the first six arguments are passed in registers and then stack parameters are used for the remainder."
} }
{ $see-also %alien-invoke } ; { $see-also #alien-invoke %alien-invoke } ;
HELP: ##alien-indirect
{ $class-description
"An instruction representing an indirect alien call. The first item on the datastack is a pointer to the function to call and the parameters follows. It has the following slots:"
{ $table
{ { $slot "src" } { "Spill slot containing the function pointer." } }
{ { $slot "reg-outputs" } { "Sequence of output values passed in registers." } }
}
}
{ $see-also alien-indirect %alien-indirect } ;
HELP: ##allot HELP: ##allot
{ $class-description { $class-description

View File

@ -5,15 +5,18 @@ IN: compiler.codegen.labels
HELP: binary-literal-table HELP: binary-literal-table
{ $var-description "A relocation table used during code generation to keep track of binary relocations. Binary literals are stored at the end of the generated assembly code on the code heap." } ; { $var-description "A relocation table used during code generation to keep track of binary relocations. Binary literals are stored at the end of the generated assembly code on the code heap." } ;
HELP: define-label
{ $values { "name" string } }
{ $description "Defines a new label with the given name. The " { $slot "offset" } " slot is filled in later." } ;
HELP: emit-binary-literals
{ $description "Emits all binary literals in the " { $link binary-literal-table } "." } ;
HELP: rel-binary-literal HELP: rel-binary-literal
{ $values { "literal" byte-array } { "class" "relocation class" } } { $values { "literal" byte-array } { "class" "relocation class" } }
{ $description "Adds a binary literal to the relocation table." } { $description "Adds a binary literal to the relocation table." }
{ $see-also binary-literal-table } ; { $see-also binary-literal-table } ;
HELP: define-label
{ $values { "name" string } }
{ $description "Defines a new label with the given name. The " { $slot "offset" } " slot is filled in later." } ;
HELP: resolve-label HELP: resolve-label
{ $values { "label/name" { $link label } " or " { $link string } } } { $values { "label/name" { $link label } " or " { $link string } } }
{ $description "Assigns the current " { $link compiled-offset } " to the given label." } ; { $description "Assigns the current " { $link compiled-offset } " to the given label." } ;