]> gitweb.factorcode.org Git - factor.git/commitdiff
Docs: for compiler, vm and combinators
authorBjörn Lindqvist <bjourne@gmail.com>
Sun, 18 May 2014 17:48:08 +0000 (19:48 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 8 Jun 2014 18:48:30 +0000 (11:48 -0700)
basis/compiler/compiler-docs.factor
basis/vm/vm-docs.factor [new file with mode: 0644]
core/combinators/combinators-docs.factor

index c15f54229c9c54d1f2aa96721fb68fcaf75f33f5..1a357ddda6662bf090e5f6e12bb104cc15eeb50a 100644 (file)
@@ -54,6 +54,10 @@ $nl
 
 ABOUT: "compiler"
 
+HELP: frontend
+{ $values { "word" word } { "tree" sequence } }
+{ $description "First step of the compilation process. It outputs a high-level tree in SSA form." } ;
+
 HELP: compile-word
 { $values { "word" word } }
 { $description "Compile a single word." }
diff --git a/basis/vm/vm-docs.factor b/basis/vm/vm-docs.factor
new file mode 100644 (file)
index 0000000..908c59c
--- /dev/null
@@ -0,0 +1,22 @@
+USING: help.markup help.syntax math strings ;
+IN: vm
+
+HELP: zone
+{ $class-description "A struct that defines the memory layout for an allocation zone in the virtual machine. Factor code cannot directly access allocation zones, but the struct is used by the compiler to calculate memory addresses. Its slots are:"
+  { $table
+    { { $slot "here" } { "Memory address to the last allocated byte in the zone. Initially, this slot is equal to " { $snippet "start" } " but each allocation in the zone will increment this pointer." } }
+    { { $slot "start" } { "Memory address to the start of the zone." } }
+    { { $slot "end" } { "Memory address to the end of the zone." } }
+  }
+} ;
+
+HELP: vm
+{ $class-description "A struct that defines the memory layout of the running virtual machine. It is used by the optimizing compiler to calculate field offsets. Its slots are:"
+  { $table
+    { { $slot "nursery" } { "A " { $link zone } " in which all new objects are allocated." } }
+  }
+} ;
+
+HELP: vm-field-offset
+{ $values { "field" string } { "offset" number } }
+{ $description "Gets the offset in bytes to the named virtual machine field." } ;
index e80cc42ee65f9aa31d4ab523204239c21b8974ca..b837c10b2bb76bf67f8c93d6258ede8fed13c79b 100644 (file)
@@ -376,6 +376,11 @@ HELP: recursive-hashcode
 { $values { "n" integer } { "obj" object } { "quot" { $quotation ( n obj -- code ) } } { "code" integer } }
 { $description "A combinator used to implement methods for the " { $link hashcode* } " generic word. If " { $snippet "n" } " is less than or equal to zero, outputs 0, otherwise calls the quotation." } ;
 
+HELP: deep-spread>quot
+{ $values { "seq" sequence } { "quot" quotation } }
+{ $description "Creates a new quotation from a sequence of quotations that applies each quotation to a stack element in turn." }
+{ $see-also spread } ;
+
 HELP: cond>quot
 { $values { "assoc" "a sequence of pairs of quotations" } { "quot" quotation } }
 { $description "Creates a quotation that when called, has the same effect as applying " { $link cond } " to " { $snippet "assoc" } "."