compiler.cfg.stack-frame: stub docs and tests for vocab
parent
8a0b4c3d26
commit
0a30bd9218
|
@ -1,10 +1,37 @@
|
|||
USING: help.markup help.syntax ;
|
||||
USING: cpu.x86 help.markup help.syntax layouts math ;
|
||||
IN: compiler.cfg.stack-frame
|
||||
|
||||
HELP: stack-frame
|
||||
{ $class-description "Counts of, among other things, how much stack a compiled word needs. It has the following slots:"
|
||||
{ $class-description "Counts of, among other things, how much stack a compiled word needs. The stack frame is organized in the following fashion:"
|
||||
{ $list
|
||||
"Parameter space:"
|
||||
"Allocation area: space for local allocations."
|
||||
"Spill area: space for register spills."
|
||||
{ "Reserved stack space: only applicable on Windows x86.64. See " { $link reserved-stack-space } "." }
|
||||
{ "One final " { $link cell } " of padding." }
|
||||
}
|
||||
"The stack frame is also aligned to a 16 byte boundary. It has the following slots:"
|
||||
{ $table
|
||||
{ { $slot "total-size" } { "Total size of the stack frame." } }
|
||||
{ { $slot "allot-area-base" } { "Base offset of the allocation area." } }
|
||||
{ { $slot "allot-area-size" } { "Number of bytes requires for the allocation area." } }
|
||||
{ { $slot "allot-area-align" } { "This slot is always at least " { $link cell } " bytes." } }
|
||||
{ { $slot "spill-area-base" } { "Base offset for the spill area." } }
|
||||
{ { $slot "spill-area-size" } { "Number of bytes requires for all spill slots." } }
|
||||
{ { $slot "spill-area-align" } { "This slot is always at least " { $link cell } " bytes." } }
|
||||
}
|
||||
} ;
|
||||
}
|
||||
{ $see-also align-stack } ;
|
||||
|
||||
HELP: (stack-frame-size)
|
||||
{ $values { "stack-frame" stack-frame } { "n" integer } }
|
||||
{ $description "Base stack frame size, without padding and alignment." } ;
|
||||
|
||||
HELP: spill-offset
|
||||
{ $values { "n" integer } { "offset" integer } }
|
||||
{ $description "Offset in the current " { $link stack-frame } " to byte at index 'n' in the spill area." } ;
|
||||
|
||||
ARTICLE: "compiler.cfg.stack-frame" "Stack frames"
|
||||
"This vocab contains definitions for constructing stack frames." ;
|
||||
|
||||
ABOUT: "compiler.cfg.stack-frame"
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
USING: accessors compiler.cfg compiler.cfg.build-stack-frame
|
||||
compiler.cfg.stack-frame kernel namespaces tools.test ;
|
||||
IN: compiler.cfg.stack-frame.tests
|
||||
|
||||
{
|
||||
112
|
||||
! 112 37 +
|
||||
149
|
||||
} [
|
||||
T{ stack-frame
|
||||
{ params 91 }
|
||||
{ allot-area-align 8 }
|
||||
{ allot-area-size 10 }
|
||||
{ spill-area-align 8 }
|
||||
{ spill-area-size 16 }
|
||||
} dup finalize-stack-frame
|
||||
[ spill-area-base>> ]
|
||||
[ stack-frame set 37 spill-offset ] bi
|
||||
] unit-test
|
Loading…
Reference in New Issue