compiler.cfg.instructions: more docs
parent
f06f59b956
commit
90b31d543b
|
@ -1,5 +1,5 @@
|
||||||
USING: arrays classes compiler.cfg cpu.architecture help.markup help.syntax
|
USING: arrays classes compiler.cfg compiler.codegen.gc-maps cpu.architecture
|
||||||
kernel layouts slots.private ;
|
help.markup help.syntax kernel layouts sequences slots.private ;
|
||||||
IN: compiler.cfg.instructions
|
IN: compiler.cfg.instructions
|
||||||
|
|
||||||
HELP: new-insn
|
HELP: new-insn
|
||||||
|
@ -71,6 +71,9 @@ HELP: ##alien-invoke
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
HELP: alien-call-insn
|
||||||
|
{ $class-description "Union class of all alien call instructions." } ;
|
||||||
|
|
||||||
HELP: ##call
|
HELP: ##call
|
||||||
{ $class-description
|
{ $class-description
|
||||||
"An instruction for calling a Factor word."
|
"An instruction for calling a Factor word."
|
||||||
|
@ -175,7 +178,15 @@ HELP: ##spill
|
||||||
{ $class-description "Instruction that copies a value from a register to a " { $link spill-slot } "." } ;
|
{ $class-description "Instruction that copies a value from a register to a " { $link spill-slot } "." } ;
|
||||||
|
|
||||||
HELP: gc-map-insn
|
HELP: gc-map-insn
|
||||||
{ $class-description "Union class of all instructions that contain subroutine calls to functions which allocate memory." } ;
|
{ $class-description "Union class of all instructions that contain subroutine calls to functions which allocate memory. Each of the has a " { $slot "gc-map" } " slot." } ;
|
||||||
|
|
||||||
|
HELP: gc-map
|
||||||
|
{ $class-description "A tuple that holds info necessary for a gc cycle to figure out where the gc root pointers are. It has the following slots:"
|
||||||
|
{ $table
|
||||||
|
{ { $slot "gc-roots" } { "A " { $link sequence } " of " { $link spill-slot } " which will be traced in a gc cycle. " } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ $see-also emit-gc-info-bitmaps } ;
|
||||||
|
|
||||||
ARTICLE: "compiler.cfg.instructions" "Basic block instructions"
|
ARTICLE: "compiler.cfg.instructions" "Basic block instructions"
|
||||||
"The " { $vocab-link "compiler.cfg.instructions" } " vocab contains all instruction classes used for generating CFG:s (Call Flow Graphs)."
|
"The " { $vocab-link "compiler.cfg.instructions" } " vocab contains all instruction classes used for generating CFG:s (Call Flow Graphs)."
|
||||||
|
@ -189,18 +200,50 @@ $nl
|
||||||
##replace-imm
|
##replace-imm
|
||||||
##spill
|
##spill
|
||||||
}
|
}
|
||||||
"Garbage collection words and instruction classes:"
|
"Control flow:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
gc-map-insn
|
##call
|
||||||
|
##jump
|
||||||
|
##no-tco
|
||||||
|
##phi
|
||||||
|
##return
|
||||||
}
|
}
|
||||||
"Alien calls:"
|
"Comparison instructions:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
|
##compare
|
||||||
|
##compare-imm
|
||||||
|
##compare-integer
|
||||||
|
##compare-integer-branch
|
||||||
|
##compare-integer-imm-branch
|
||||||
|
##test
|
||||||
|
##test-branch
|
||||||
|
##test-imm
|
||||||
|
##test-imm-branch
|
||||||
|
}
|
||||||
|
"Alien calls and FFI:"
|
||||||
|
{ $subsections
|
||||||
|
##alien-assembly
|
||||||
|
##alien-indirect
|
||||||
##alien-invoke
|
##alien-invoke
|
||||||
|
##box
|
||||||
|
##box-alien
|
||||||
|
##box-displaced-alien
|
||||||
|
##box-long-long
|
||||||
|
##callback-inputs
|
||||||
|
##callback-outputs
|
||||||
|
##local-allot
|
||||||
|
##unbox
|
||||||
|
##unbox-long-long
|
||||||
alien-call-insn
|
alien-call-insn
|
||||||
}
|
}
|
||||||
"Allocation:"
|
"Allocation and garbage collection:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
##allot
|
##allot
|
||||||
|
##call-gc
|
||||||
|
##check-nursery-branch
|
||||||
|
gc-map
|
||||||
|
gc-map-insn
|
||||||
|
<gc-map>
|
||||||
}
|
}
|
||||||
"Constant loading:"
|
"Constant loading:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
|
@ -215,12 +258,16 @@ $nl
|
||||||
##and-imm
|
##and-imm
|
||||||
##mul
|
##mul
|
||||||
##mul-imm
|
##mul-imm
|
||||||
|
##neg
|
||||||
|
##not
|
||||||
##or
|
##or
|
||||||
##or-imm
|
##or-imm
|
||||||
##sar
|
##sar
|
||||||
##sar-imm
|
##sar-imm
|
||||||
##shl
|
##shl
|
||||||
##shl-imm
|
##shl-imm
|
||||||
|
##shr
|
||||||
|
##shr-imm
|
||||||
##sub
|
##sub
|
||||||
##sub-imm
|
##sub-imm
|
||||||
##xor
|
##xor
|
||||||
|
@ -232,4 +279,11 @@ $nl
|
||||||
##slot-imm
|
##slot-imm
|
||||||
##set-slot
|
##set-slot
|
||||||
##set-slot-imm
|
##set-slot-imm
|
||||||
|
}
|
||||||
|
"Stack height manipulation:"
|
||||||
|
{ $subsections
|
||||||
|
##inc-d
|
||||||
|
##inc-r
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
ABOUT: "compiler.cfg.instructions"
|
||||||
|
|
|
@ -844,8 +844,6 @@ UNION: alien-call-insn
|
||||||
UNION: factor-call-insn
|
UNION: factor-call-insn
|
||||||
alien-call-insn ;
|
alien-call-insn ;
|
||||||
|
|
||||||
! Instructions that contain subroutine calls to functions which
|
|
||||||
! allocate memory
|
|
||||||
UNION: gc-map-insn
|
UNION: gc-map-insn
|
||||||
##call-gc
|
##call-gc
|
||||||
##box
|
##box
|
||||||
|
@ -854,7 +852,6 @@ factor-call-insn ;
|
||||||
|
|
||||||
M: gc-map-insn clone call-next-method [ clone ] change-gc-map ;
|
M: gc-map-insn clone call-next-method [ clone ] change-gc-map ;
|
||||||
|
|
||||||
! Each one has a gc-map slot
|
|
||||||
TUPLE: gc-map scrub-d check-d scrub-r check-r gc-roots derived-roots ;
|
TUPLE: gc-map scrub-d check-d scrub-r check-r gc-roots derived-roots ;
|
||||||
|
|
||||||
: <gc-map> ( -- gc-map ) gc-map new ;
|
: <gc-map> ( -- gc-map ) gc-map new ;
|
||||||
|
|
Loading…
Reference in New Issue