-USING: help.markup help.syntax literals make multiline stack-checker.alien ;
+USING: help.markup help.syntax literals make multiline sequences
+stack-checker.alien ;
IN: compiler.cfg.builder.alien
<<
{ $values { "params" alien-node-params } }
{ $description "If the last alien call returns a value, then this word will emit an instruction to the current sequence being constructed by " { $link make } " that boxes it." }
{ $examples { $unchecked-example $[ ex-caller-return ] } } ;
+
+HELP: unbox-parameters
+{ $values { "parameters" sequence } { "vregs" sequence } { "reps" sequence } }
+{ $description "Unboxes a sequence of parameters to send to an ffi function." } ;
-USING: alien arrays assocs classes compiler.cfg compiler.cfg.ssa.destruction
-compiler.cfg.value-numbering compiler.codegen.gc-maps cpu.architecture
-help.markup help.syntax kernel layouts sequences slots.private system ;
+USING: alien arrays assocs classes compiler.cfg compiler.cfg.intrinsics.fixnum
+compiler.cfg.ssa.destruction compiler.cfg.value-numbering
+compiler.codegen.gc-maps cpu.architecture help.markup help.syntax kernel layouts
+math sequences slots.private system ;
IN: compiler.cfg.instructions
HELP: ##alien-invoke
} ;
HELP: ##compare-integer
-{ $class-description "This instruction is emitted for integer comparisons." } ;
+{ $class-description "This instruction is emitted for integer (" { $link fixnum } ") comparisons." }
+{ $see-also emit-fixnum-comparison } ;
HELP: ##copy
{ $class-description "Instruction that copies a value from one register to another of the same type. For example, you can copy between two gprs or two simd registers but not across. It has the following slots:"
}
} ;
+HELP: ##fixnum-add
+{ $class-description "Instruction for adding two fixnums together." }
+{ $see-also emit-fixnum+ } ;
+
HELP: ##inc
{ $class-description
"An instruction that increases or decreases a stacks height by n. For example, " { $link 2drop } " decreases the datastacks height by two and pushing an item increases it by one."
{ $class-description "Instruction that copies a value from a register to a " { $link spill-slot } "." } ;
HELP: ##store-memory-imm
-{ $class-description "Instruction that copies an 8 byte value from a XMM register to a memory location addressed by a normal register. This instruction is often turned into a cheaper " { $link ##store-memory } " instruction in the " { $link value-numbering } " pass." } ;
+{ $class-description "Instruction that copies an 8 byte value from a XMM register to a memory location addressed by a normal register. This instruction is often turned into a cheaper " { $link ##store-memory } " instruction in the " { $link value-numbering } " pass."
+ { $table
+ { { $slot "base" } { "Vreg that contains the base address." } }
+ {
+ { $slot "offset" }
+ { "Offset in bytes from the address to where the data should be written." }
+ }
+ { { $slot "src" } { "Vreg that contains the item to set." } }
+ }
+}
+{ $see-also %store-memory-imm } ;
HELP: ##vector>scalar
{ $class-description
--- /dev/null
+USING: compiler.cfg.instructions help.markup help.syntax ;
+IN: compiler.cfg.intrinsics.fixnum
+
+HELP: emit-fixnum-comparison
+{ $values { "cc" "comparison symbol" } }
+{ $description "Emits a " { $link ##compare-integer } " instruction to the make sequence." } ;
HELP: simple-analysis
{ $values { "cfg" cfg } { "quot" quotation } }
{ $description "Applies a quotation to each sequence of instructions in each " { $link basic-block } " in the cfg." } ;
+
+HELP: simple-optimization
+{ $values { "cfg" cfg } { "quot" quotation } }
+{ $description "Runs a quotation that optimizes each " { $link basic-block } " in the cfg, excluding the kill blocks. The quotation takes the blocks instruction sequence and returns them back in optimized form. The blocks are iterated in " { $link reverse-post-order } "." } ;
-USING: compiler.codegen.relocation help.markup help.syntax ;
+USING: compiler.codegen.relocation help.markup help.syntax math ;
IN: compiler.constants
HELP: rt-cards-offset
{ $description "Relocation offset type for the decks table." }
{ $see-also rel-decks-offset } ;
+HELP: string-offset
+{ $values { "n" integer } }
+{ $description "hm" } ;
-ARTICLE: "compiler.constants" "VM memory layout constants" "Common constants" ;
+
+ARTICLE: "compiler.constants" "VM memory layout constants"
+"Common constants."
+$nl
+"Constants that must match vm/memory.hpp:"
+{ $subsections card-bits card-mark deck-bits }
+"Constants that must match vm/layouts.hpp:"
+{ $subsections
+ alien-offset
+ array-start-offset
+ byte-array-offset
+ callstack-length-offset
+ callstack-top-offset
+ context-callstack-bottom-offset
+ context-callstack-save-offset
+ context-callstack-seg-offset
+ context-datastack-offset
+ context-callstack-top-offset
+ context-retainstack-offset
+ float-offset
+ profile-count-offset
+ quot-entry-point-offset
+ segment-end-offset
+ segment-size-offset
+ segment-start-offset
+ slot-offset
+ string-aux-offset
+ string-offset
+ tuple-class-offset
+ underlying-alien-offset
+ vm-context-offset
+ vm-fault-flag-offset
+ vm-signal-handler-addr-offset
+ vm-spare-context-offset
+ word-entry-point-offset
+} ;
ABOUT: "compiler.constants"
quotations sequences strings words ;
IN: compiler.constants
-! These constants must match vm/memory.h
CONSTANT: card-bits 8
CONSTANT: deck-bits 18
: card-mark ( -- n ) 0x40 0x80 bitor ; inline
-! These constants must match vm/layouts.h
: slot-offset ( slot tag -- n ) [ bootstrap-cells ] dip - ; inline
: float-offset ( -- n ) 8 float type-number - ; inline