--- /dev/null
+USING: compiler.cfg compiler.cfg.utilities help.markup help.syntax ;
+IN: compiler.cfg.branch-splitting
+
+HELP: clone-basic-block
+{ $values { "bb" basic-block } { "bb'" basic-block } }
+{ $description "The new block temporarily gets the same RPO number as the old one, until the next time RPO is computed. This is just to make " { $link back-edge? } " work." } ;
[ clone dup rename-insn-temps ] map ;
: clone-basic-block ( bb -- bb' )
- ! The new block temporarily gets the same RPO number as the
- ! old one, until the next time RPO is computed. This is just
- ! to make 'back-edge?' work.
<basic-block>
swap
{
{ "dfa" class }
{ "set" "merged state" }
}
-{ $description "Generic word which merges multiple states into one. A block in the cfg might have multiple predecessors and then this word is used to compute the merged input state to use to analyze the block." } ;
+{ $description "Generic word which merges multiple states into one. A block in the cfg might have multiple predecessors and then this word is used to compute the merged input state to use to analyze the block." }
+{ $see-also transfer-set } ;
<PRIVATE
HELP: loc
{ $class-description "Represents a location on the stack. 'n' is an index starting from the top of the stack going down. So 0 is the top of the stack, 1 is what would be the top of the stack after a 'drop', and so on. It has two subclasses, " { $link ds-loc } " for data stack location and " { $link rs-loc } " for locations on the retain stack." } ;
+
+ABOUT: "compiler.cfg.registers"
--- /dev/null
+USING: compiler.cfg.instructions help.markup help.syntax ;
+IN: compiler.cfg.representations.peephole
+
+HELP: convert-to-zero-vector?
+{ $values { "insn" insn } }
+{ $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." } ;
+
+
+ARTICLE: "compiler.cfg.representations.peephole" "Peephole optimizations"
+"Representation selection performs some peephole optimizations when inserting conversions to optimize for a few common cases." ;
+
+ABOUT: "compiler.cfg.representations.peephole"
layouts locals make math namespaces sequences ;
IN: compiler.cfg.representations.peephole
-! Representation selection performs some peephole optimizations
-! when inserting conversions to optimize for a few common cases
-
GENERIC: optimize-insn ( insn -- )
SYMBOL: insn-index
[ obj>> byte-array? ]
} 1&& ;
-! When a literal zeroes/ones vector is unboxed, we replace the ##load-reference
-! with a ##zero-vector or ##fill-vector instruction since this is more efficient.
: convert-to-zero-vector? ( insn -- ? )
{
[ dst>> rep-of vector-rep? ]
--- /dev/null
+USING: assocs compiler.cfg help.markup help.syntax ;
+IN: compiler.cfg.stacks.map
+
+HELP: trace-stack-state
+{ $values { "cfg" cfg } { "assoc" assoc } }
+{ $description "Outputs an assoc with the instruction numbers as keys and as values two tuples of the data and retain stacks shapes before that instruction. All instructions in the cfg gets numbered as a side-effect." } ;
M: ##replace visit-insn mark-location ;
M: ##call visit-insn ( state insn -- state' )
- ! After a word call, we can't trust any overinitialized locations
- ! to contain valid pointers anymore.
+ ! A call instruction may increase the stack height. Then issue a
+ ! minor-gc with some of the stack locations scrubbed which would
+ ! overwrite the overinitialized locations we're tracking. That is
+ ! why they need to be cleared here.
drop [ first2 [ 0 >= ] filter 2array ] map ;
ERROR: vacant-peek insn ;
--- /dev/null
+USING: compiler.codegen.relocation help.markup help.syntax ;
+IN: compiler.constants
+
+HELP: rt-cards-offset
+{ $description "Relocation offset type for the cards table." }
+{ $see-also rel-cards-offset } ;
+
+HELP: rt-decks-offset
+{ $description "Relocation offset type for the decks table." }
+{ $see-also rel-decks-offset } ;
+
+
+ARTICLE: "compiler.constants" "VM memory layout constants" "Common constants" ;
+
+ABOUT: "compiler.constants"