-USING: compiler.cfg help.markup help.syntax ;
+USING: compiler.cfg compiler.cfg.instructions help.markup help.syntax ;
IN: compiler.cfg.block-joining
HELP: join-block?
{ $values { "bb" basic-block } { "?" "a boolean" } }
{ $description "Whether the block can be joined with its predecessor or not." } ;
+
+ARTICLE: "compiler.cfg.block-joining" "Block Joining"
+"Joining blocks that are not calls and are connected by a single CFG edge. This pass does not update " { $link ##phi } " nodes and should therefore only run before stack analysis." ;
+
+ABOUT: "compiler.cfg.block-joining"
compiler.cfg.utilities kernel sequences ;
IN: compiler.cfg.block-joining
-! Joining blocks that are not calls and are connected by a single CFG edge.
-! This pass does not update ##phi nodes and should therefore only run
-! before stack analysis.
: join-block? ( bb -- ? )
{
[ kill-block?>> not ]
dup label>> loop?>> [ emit-loop ] [ emit-recursive ] if ;
! #if
-: emit-branch ( obj -- final-bb )
+: emit-branch ( obj -- pair/f )
[ emit-nodes ] with-branch ;
: emit-if ( node -- )
IN: compiler.cfg.representations.peephole
HELP: convert-to-zero-vector?
-{ $values { "insn" insn } }
+{ $values { "insn" insn } { "?" "a boolean" } }
{ $description "When a literal zeroes/ones vector is unboxed, we replace the " { $link ##load-reference } " with a " { $link ##zero-vector } " or " { $link ##fill-vector } " instruction since this is more efficient." } ;
{ $description "Populates the scrub-d, check-d, scrub-r and check-r slots of all gc maps in the cfg." } ;
HELP: state>gc-data
-{ $values { "state" } { "gc-data" } }
+{ $values { "state" sequence } { "gc-data" sequence } }
{ $description "Takes a stack state on the format given by " { $link trace-stack-state } " and emits an array containing two bit-patterns with locations on the data and retain stacks to scrub." } ;
HELP: vacant>bits
"t\nt"
}
} ;
+
+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." ;
+
+ABOUT: "compiler.codegen.relocation"
namespaces sequences ;
IN: compiler.codegen.relocation
-! Common code shared by optimizing and non-optimizing compilers.
-! Should not have too many dependencies on the rest of the
-! optimizing compiler.
-
-! Code is compiled into the 'make' vector.
-
SYMBOL: extra-offset ! Only used by non-optimizing compiler
: compiled-offset ( -- n )
: add-literal ( obj -- ) literal-table get push ;
-! Relocation table
SYMBOL: relocation-table
: push-uint ( value vector -- )
{ $description "Checks if the given effect is safe with regards to the cached one." } ;
HELP: update-inline-cache
-{ $values { "word/quot" } { "ic" inline-cache } }
+{ $values { "word/quot" "word or quotation" } { "ic" inline-cache } }
{ $description "Sets the inline caches " { $slot "value" } " to the given word/quot and updates its " { $slot "counter" } " to the value of the " { $link effect-counter } "." } ;