Docs: various more compiler-related docs
parent
aca610813d
commit
5e29aac0a6
|
@ -1,4 +1,5 @@
|
||||||
USING: help.markup help.syntax io io.files io.pathnames strings ;
|
USING: bootstrap.image.private help.markup help.syntax io io.files
|
||||||
|
io.pathnames quotations strings words ;
|
||||||
IN: bootstrap.image
|
IN: bootstrap.image
|
||||||
|
|
||||||
ARTICLE: "bootstrap.image" "Bootstrapping new images"
|
ARTICLE: "bootstrap.image" "Bootstrapping new images"
|
||||||
|
@ -13,8 +14,18 @@ $nl
|
||||||
|
|
||||||
ABOUT: "bootstrap.image"
|
ABOUT: "bootstrap.image"
|
||||||
|
|
||||||
|
HELP: architecture
|
||||||
|
{ $var-description "Bootstrap architecture name" } ;
|
||||||
|
|
||||||
|
HELP: bootstrap-startup-quot
|
||||||
|
{ $var-description "This image's startup quotation or " { $link f } ". "} ;
|
||||||
|
|
||||||
|
HELP: define-sub-primitive
|
||||||
|
{ $values { "quot" quotation } { "word" word } }
|
||||||
|
{ $description "Defines a sub primitive by running the quotation which is supposed to output assembler code. The word is then used to call the assembly." } ;
|
||||||
|
|
||||||
HELP: make-image
|
HELP: make-image
|
||||||
{ $values { "arch" string } }
|
{ $values { "arch" string } }
|
||||||
{ $description "Creates a bootstrap image from sources, where " { $snippet "architecture" } " is one of the following:"
|
{ $description "Creates a bootstrap image from sources, where " { $snippet "architecture" } " is one of the following:"
|
||||||
{ $code "x86.32" "unix-x86.64" "windows-x86.64" "linux-ppc" }
|
{ $code "\"x86.32\"" "\"unix-x86.64\"" "\"windows-x86.64\"" "\"linux-ppc\"" }
|
||||||
"The new image file is written to the " { $link resource-path } " and is named " { $snippet "boot." { $emphasis "architecture" } ".image" } "." } ;
|
"The new image file is written to the " { $link resource-path } " and is named " { $snippet "boot." { $emphasis "architecture" } ".image" } "." } ;
|
||||||
|
|
|
@ -149,7 +149,6 @@ SYMBOL: bootstrapping-image
|
||||||
! Image output format
|
! Image output format
|
||||||
SYMBOL: big-endian
|
SYMBOL: big-endian
|
||||||
|
|
||||||
! Bootstrap architecture name
|
|
||||||
SYMBOL: architecture
|
SYMBOL: architecture
|
||||||
|
|
||||||
RESET
|
RESET
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
USING: compiler.codegen.relocation help.markup help.syntax strings ;
|
USING: byte-arrays compiler.codegen.relocation help.markup help.syntax
|
||||||
|
strings ;
|
||||||
IN: compiler.codegen.labels
|
IN: compiler.codegen.labels
|
||||||
|
|
||||||
|
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." } ;
|
||||||
|
|
||||||
|
HELP: rel-binary-literal
|
||||||
|
{ $values { "literal" byte-array } { "class" "relocation class" } }
|
||||||
|
{ $description "Adds a binary literal to the relocation table." }
|
||||||
|
{ $see-also binary-literal-table } ;
|
||||||
|
|
||||||
HELP: define-label
|
HELP: define-label
|
||||||
{ $values { "name" string } }
|
{ $values { "name" string } }
|
||||||
{ $description "Defines a new label with the given name. The " { $slot "offset" } " slot is filled in later." } ;
|
{ $description "Defines a new label with the given name. The " { $slot "offset" } " slot is filled in later." } ;
|
||||||
|
|
|
@ -20,6 +20,10 @@ HELP: add-literal
|
||||||
HELP: init-relocation
|
HELP: init-relocation
|
||||||
{ $description "Initializes the dynamic variables related to code relocation." } ;
|
{ $description "Initializes the dynamic variables related to code relocation." } ;
|
||||||
|
|
||||||
|
HELP: rel-decks-offset
|
||||||
|
{ $values { "class" "a relocation class" } }
|
||||||
|
{ $description "Adds a decks offset relocation. It is used for marking cards when emitting write barriers." } ;
|
||||||
|
|
||||||
HELP: rel-safepoint
|
HELP: rel-safepoint
|
||||||
{ $values { "class" "a relocation class" } }
|
{ $values { "class" "a relocation class" } }
|
||||||
{ $description "Adds a safe point to the " { $link relocation-table } " for the current code offset. This word is used by the " { $link %safepoint } " generator." } ;
|
{ $description "Adds a safe point to the " { $link relocation-table } " for the current code offset. This word is used by the " { $link %safepoint } " generator." } ;
|
||||||
|
@ -42,6 +46,9 @@ HELP: compiled-offset
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ARTICLE: "compiler.codegen.relocation" "Relocatable VM objects"
|
ARTICLE: "compiler.codegen.relocation" "Relocatable VM objects"
|
||||||
"The " { $vocab-link "compiler.codegen.relocation" } " deals with assigning memory addresses to VM objects, such as the card table. Those objects have different addresses during each execution which is why they are \"relocatable\". The vocab is shared by the optimizing and non-optimizing compiler." ;
|
"The " { $vocab-link "compiler.codegen.relocation" } " deals with assigning memory addresses to VM objects, such as the card table. Those objects have different addresses during each execution which is why they are \"relocatable\". The vocab is shared by the optimizing and non-optimizing compiler."
|
||||||
|
$nl
|
||||||
|
"Adding relocations:"
|
||||||
|
{ $subsections add-relocation rel-decks-offset rel-safepoint } ;
|
||||||
|
|
||||||
ABOUT: "compiler.codegen.relocation"
|
ABOUT: "compiler.codegen.relocation"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: assocs help.markup help.syntax kernel quotations sequences
|
USING: assocs help.markup help.syntax kernel kernel.private quotations
|
||||||
stack-checker.alien stack-checker.values stack-checker.visitor words ;
|
sequences stack-checker.alien stack-checker.values
|
||||||
|
stack-checker.visitor words ;
|
||||||
IN: compiler.tree
|
IN: compiler.tree
|
||||||
|
|
||||||
HELP: node
|
HELP: node
|
||||||
|
@ -20,10 +21,15 @@ HELP: #call
|
||||||
{ { $slot "word" } { "The " { $link word } " to call." } }
|
{ { $slot "word" } { "The " { $link word } " to call." } }
|
||||||
{ { $slot "in-d" } { "Sequence of input variables to the call. The items are ordered from top to bottom of the stack." } }
|
{ { $slot "in-d" } { "Sequence of input variables to the call. The items are ordered from top to bottom of the stack." } }
|
||||||
{ { $slot "out-d" } { "Output values of the call." } }
|
{ { $slot "out-d" } { "Output values of the call." } }
|
||||||
{ { $slot "info" } { "An assoc that contains various annotations for the words input and output values. It is set during the propagation pass of the optimizer." } }
|
{ { $slot "method" } { "If the called word is generic and inlined here, then 'method' contains the inlined " { $link quotation } "." } }
|
||||||
|
{ { $slot "body" } { "If the called word is generic and inlined, then 'body' is a sequence of SSA nodes built from the inlined method." } }
|
||||||
|
{ { $slot "info" } { "If the called word is generic and inlined, then the info slot contains an assoc of value infos for the body of the inlined generic. It is set during the propagation pass of the optimizer." } }
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
HELP: #declare
|
||||||
|
{ $class-description "SSA tree node emitted when " { $link declare } " declarations are encountered." } ;
|
||||||
|
|
||||||
HELP: #introduce
|
HELP: #introduce
|
||||||
{ $class-description "SSA tree node that puts an input value from the \"outside\" on the stack. It is used to \"introduce\" data stack parameter whenever they are needed. It has the following slots:"
|
{ $class-description "SSA tree node that puts an input value from the \"outside\" on the stack. It is used to \"introduce\" data stack parameter whenever they are needed. It has the following slots:"
|
||||||
{ $table
|
{ $table
|
||||||
|
@ -58,3 +64,13 @@ HELP: #if
|
||||||
HELP: node,
|
HELP: node,
|
||||||
{ $values { "node" node } }
|
{ $values { "node" node } }
|
||||||
{ $description "Emits a node to the " { $link stack-visitor } " variable." } ;
|
{ $description "Emits a node to the " { $link stack-visitor } " variable." } ;
|
||||||
|
|
||||||
|
ARTICLE: "compiler.tree" "High-level optimizer operating on lexical tree SSA IR"
|
||||||
|
"Node types:"
|
||||||
|
{ $subsections
|
||||||
|
#call
|
||||||
|
#declare
|
||||||
|
#shuffle
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ABOUT: "compiler.tree"
|
||||||
|
|
|
@ -4,8 +4,6 @@ USING: accessors arrays assocs kernel namespaces sequences
|
||||||
stack-checker.visitor vectors ;
|
stack-checker.visitor vectors ;
|
||||||
IN: compiler.tree
|
IN: compiler.tree
|
||||||
|
|
||||||
! High-level tree SSA form.
|
|
||||||
|
|
||||||
TUPLE: node < identity-tuple ;
|
TUPLE: node < identity-tuple ;
|
||||||
|
|
||||||
TUPLE: #introduce < node out-d ;
|
TUPLE: #introduce < node out-d ;
|
||||||
|
|
|
@ -151,6 +151,10 @@ HELP: %copy
|
||||||
{ $description "Emits code copying a value from a register, arbitrary memory location or " { $link spill-slot } " to a destination." }
|
{ $description "Emits code copying a value from a register, arbitrary memory location or " { $link spill-slot } " to a destination." }
|
||||||
{ $examples { $unchecked-example $[ ex-%copy ] } } ;
|
{ $examples { $unchecked-example $[ ex-%copy ] } } ;
|
||||||
|
|
||||||
|
HELP: %dispatch
|
||||||
|
{ $values { "src" "a register symbol" } { "temp" "a register symbol" } }
|
||||||
|
{ $description "Code emitter for the " { $link ##dispatch } " instruction." } ;
|
||||||
|
|
||||||
HELP: %horizontal-add-vector
|
HELP: %horizontal-add-vector
|
||||||
{ $values
|
{ $values
|
||||||
{ "dst" "destination register symbol" }
|
{ "dst" "destination register symbol" }
|
||||||
|
@ -197,7 +201,8 @@ HELP: %local-allot
|
||||||
{ "align" "alignment" }
|
{ "align" "alignment" }
|
||||||
{ "offset" "where to allocate the data, relative to the stack register" }
|
{ "offset" "where to allocate the data, relative to the stack register" }
|
||||||
}
|
}
|
||||||
{ $description "Emits machine code for stack \"allocating\" a chunk of memory. No memory is really allocated and instead a pointer to it is just put in the destination register." } ;
|
{ $description "Emits machine code for stack \"allocating\" a chunk of memory. No memory is really allocated and instead a pointer to it is just put in the destination register." }
|
||||||
|
{ $see-also ##local-allot } ;
|
||||||
|
|
||||||
HELP: %replace-imm
|
HELP: %replace-imm
|
||||||
{ $values
|
{ $values
|
||||||
|
|
|
@ -41,6 +41,10 @@ ABOUT: "io.ports"
|
||||||
HELP: port
|
HELP: port
|
||||||
{ $class-description "Instances of this class present a blocking stream interface on top of an underlying non-blocking I/O system, giving the illusion of blocking by yielding the thread which is waiting for input or output." } ;
|
{ $class-description "Instances of this class present a blocking stream interface on top of an underlying non-blocking I/O system, giving the illusion of blocking by yielding the thread which is waiting for input or output." } ;
|
||||||
|
|
||||||
|
HELP: shutdown
|
||||||
|
{ $values { "handle" "a port handle" } }
|
||||||
|
{ $description "Called when a port is being disposed." } ;
|
||||||
|
|
||||||
HELP: input-port
|
HELP: input-port
|
||||||
{ $class-description "The class of ports implementing the input stream protocol." } ;
|
{ $class-description "The class of ports implementing the input stream protocol." } ;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
USING: help.markup help.syntax math sequences words ;
|
||||||
|
IN: math.partial-dispatch
|
||||||
|
|
||||||
|
HELP: define-integer-ops
|
||||||
|
{ $values { "word" word } { "fix-word" word } { "big-word" word } }
|
||||||
|
{ $description "Defines an integral arithmetic operation. 'word' is the generic word, 'fix-word' the word to dispatch on if the last argument is a " { $link fixnum } " and 'big-word' thew ord if it is a " { $link bignum } "." } ;
|
||||||
|
|
||||||
|
HELP: derived-ops
|
||||||
|
{ $values { "word" word } { "words" sequence } }
|
||||||
|
{ $description "Lists all derived words of the given word, including the word itself." } ;
|
||||||
|
|
||||||
|
ARTICLE: "math.partial-dispatch"
|
||||||
|
"Partially-dispatched math operations, used by the compiler"
|
||||||
|
"Partially-dispatched math operations" ;
|
||||||
|
|
||||||
|
ABOUT: "math.partial-dispatch"
|
|
@ -0,0 +1,11 @@
|
||||||
|
USING: help.markup help.syntax sequences ;
|
||||||
|
IN: math.vectors.simd.intrinsics
|
||||||
|
|
||||||
|
HELP: (simd-select)
|
||||||
|
{ $description "Word which implements " { $link nth } " for SIMD vectors." }
|
||||||
|
{ $examples
|
||||||
|
{ $unchecked-example
|
||||||
|
"float-4{ 3 4 9 1 } underlying>> 2 float-4-rep (simd-select)"
|
||||||
|
"9.0"
|
||||||
|
}
|
||||||
|
} ;
|
|
@ -73,10 +73,34 @@ ABOUT: "threads"
|
||||||
HELP: thread
|
HELP: thread
|
||||||
{ $class-description "A thread. The slots are as follows:"
|
{ $class-description "A thread. The slots are as follows:"
|
||||||
{ $list
|
{ $list
|
||||||
{ { $snippet "id" } " - a unique identifier assigned to each thread." }
|
{
|
||||||
{ { $snippet "name" } " - the name passed to " { $link spawn } "." }
|
{ $snippet "id" }
|
||||||
{ { $snippet "quot" } " - the initial quotation passed to " { $link spawn } "." }
|
" - a unique identifier assigned to each thread."
|
||||||
{ { $snippet "status" } " - a " { $link string } " indicating what the thread is waiting for, or " { $link f } ". This slot is intended to be used for debugging purposes." }
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "exit-handler" }
|
||||||
|
" - a " { $link quotation } " run when the thread is being stopped."
|
||||||
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "name" }
|
||||||
|
" - the name passed to " { $link spawn } "."
|
||||||
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "quot" }
|
||||||
|
" - the initial quotation passed to " { $link spawn } "."
|
||||||
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "runnable" }
|
||||||
|
" - whether the thread is runnable. Initially it is, " { $link f } "."
|
||||||
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "status" }
|
||||||
|
" - a " { $link string } " indicating what the thread is waiting for, or " { $link f } ". This slot is intended to be used for debugging purposes."
|
||||||
|
}
|
||||||
|
{
|
||||||
|
{ $snippet "context" }
|
||||||
|
" - a " { $link box } " holding an alien pointer to the threads " { $link context } " object."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: definitions help.markup help.syntax kernel parser
|
USING: definitions help.markup help.syntax kernel parser
|
||||||
quotations source-files stack-checker.errors words ;
|
quotations sequences source-files stack-checker.errors words ;
|
||||||
IN: compiler.units
|
IN: compiler.units
|
||||||
|
|
||||||
ARTICLE: "compilation-units-internals" "Compilation units internals"
|
ARTICLE: "compilation-units-internals" "Compilation units internals"
|
||||||
|
@ -73,6 +73,10 @@ HELP: recompile
|
||||||
{ $values { "words" "a sequence of words" } { "alist" "an association list mapping words to compiled definitions" } }
|
{ $values { "words" "a sequence of words" } { "alist" "an association list mapping words to compiled definitions" } }
|
||||||
{ $contract "Internal word which compiles words. Called at the end of " { $link with-compilation-unit } "." } ;
|
{ $contract "Internal word which compiles words. Called at the end of " { $link with-compilation-unit } "." } ;
|
||||||
|
|
||||||
|
HELP: to-recompile
|
||||||
|
{ $values { "words" sequence } }
|
||||||
|
{ $description "Sequence of words that will be recompiled by the compilation unit." } ;
|
||||||
|
|
||||||
HELP: no-compilation-unit
|
HELP: no-compilation-unit
|
||||||
{ $values { "word" word } }
|
{ $values { "word" word } }
|
||||||
{ $description "Throws a " { $link no-compilation-unit } " error." }
|
{ $description "Throws a " { $link no-compilation-unit } " error." }
|
||||||
|
|
|
@ -63,6 +63,9 @@ HELP: build
|
||||||
{ $values { "n" integer } }
|
{ $values { "n" integer } }
|
||||||
{ $description "The current build number. Factor increments this number whenever a new boot image is created." } ;
|
{ $description "The current build number. Factor increments this number whenever a new boot image is created." } ;
|
||||||
|
|
||||||
|
HELP: leaf-signal-handler
|
||||||
|
{ $description "A word called by the VM when a VM error occurs." } ;
|
||||||
|
|
||||||
HELP: hashcode*
|
HELP: hashcode*
|
||||||
{ $values { "depth" integer } { "obj" object } { "code" fixnum } }
|
{ $values { "depth" integer } { "obj" object } { "code" fixnum } }
|
||||||
{ $contract "Outputs the hashcode of an object. The hashcode operation must satisfy the following properties:"
|
{ $contract "Outputs the hashcode of an object. The hashcode operation must satisfy the following properties:"
|
||||||
|
|
Loading…
Reference in New Issue