Docs: for compiler.cfg and cpu.architecture words

Conflicts:
	basis/cpu/architecture/architecture-docs.factor
db4
Björn Lindqvist 2014-05-11 13:02:00 +02:00 committed by John Benediktsson
parent c76a994f27
commit fa097c7a56
3 changed files with 44 additions and 7 deletions

View File

@ -1,4 +1,4 @@
USING: help.markup help.syntax kernel layouts slots.private ;
USING: compiler.cfg help.markup help.syntax kernel layouts slots.private ;
IN: compiler.cfg.instructions
HELP: insn
@ -72,6 +72,19 @@ HELP: ##peek
HELP: ##safepoint
{ $class-description "Instruction that inserts a safe point in the generated code." } ;
HELP: ##check-nursery-branch
{ $class-description
"Instruction that inserts a conditional branch to a " { $link basic-block } " that garbage collects the nursery. The " { $vocab-link "compiler.cfg.gc-checks" } " vocab goes through each block in the " { $link cfg } " and checks if it allocates memory. If it does, then this instruction is inserted in the cfg before that block and checks if there is enough available space in the nursery. If it isn't, then a basic block containing code for garbage collecting the nursery is executed."
$nl
"It has the following slots:"
{ $table
{ { $slot "size" } { "Number of bytes the next block in the cfg will allocate." } }
{ { $slot "cc" } { "A comparison symbol." } }
{ { $slot "temp1" } { "Register symbol." } }
{ { $slot "temp2" } { "Register symbol." } }
}
} ;
HELP: ##return
{ $class-description "Instruction that returns from a procedure call." } ;

View File

@ -12,7 +12,7 @@ GENERIC: needs-save-context? ( insn -- ? )
M: gc-map-insn needs-save-context? drop t ;
M: insn needs-save-context? drop f ;
: bb-needs-save-context? ( insn -- ? )
: bb-needs-save-context? ( bb -- ? )
{
[ kill-block?>> not ]
[ instructions>> [ needs-save-context? ] any? ]

View File

@ -1,5 +1,6 @@
USING: assocs cpu.x86.assembler help.markup help.syntax kernel
literals math multiline system words ;
USING: assocs classes compiler.cfg.instructions cpu.x86.assembler
cpu.x86.assembler.operands help.markup help.syntax layouts literals math
multiline system words ;
IN: cpu.architecture
<<
@ -19,8 +20,17 @@ init-fixup init-relocation [ RAX RBX RCX %box-alien ] B{ } make disassemble
000000e9fcc720d9: 48895812 mov [rax+0x12], rbx
000000e9fcc720dd: 4889581a mov [rax+0x1a], rbx
;
>>
STRING: ex-%allot
USING: cpu.architecture make ;
[ RAX 40 tuple RCX %allot ] B{ } make disassemble
0000000002270cc0: 498d4d10 lea rcx, [r13+0x10]
0000000002270cc4: 488b01 mov rax, [rcx]
0000000002270cc7: 48c7001c000000 mov qword [rax], 0x1c
0000000002270cce: 4883c807 or rax, 0x7
0000000002270cd2: 48830130 add qword [rcx], 0x30
;
>>
HELP: signed-rep
{ $values { "rep" representation } { "rep'" representation } }
@ -59,8 +69,22 @@ HELP: %call
HELP: %box-alien
{ $values { "dst" "destination register" } { "src" "source register" } { "temp" "temporary register" } }
{ $description "Emits machine code for boxing an alien value." }
{ $examples { $unchecked-example $[ ex-%box-alien ] } } ;
{ $description "Emits machine code for boxing an alien value. Internally, this word will allocate five " { $link cells } " which wraps the alien." }
{ $examples { $unchecked-example $[ ex-%box-alien ] } }
{ $see-also ##box-alien %allot } ;
HELP: %allot
{ $values
{ "dst" "destination register symbol" }
{ "size" "number of bytes to allocate" }
{ "class" "one of the built-in classes listed in " { $link type-numbers } }
{ "temp" "temporary register symbol" }
}
{ $description "Emits machine code for allocating memory." }
{ $examples
"In this example 40 bytes is allocated and a tagged pointer to the memory is put in " { $link RAX } ":"
{ $unchecked-example $[ ex-%allot ] }
} ;
HELP: fused-unboxing?
{ $values { "?" boolean } }