1 ! Copyright (C) 2009, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: math math.order namespaces accessors kernel layouts
4 combinators combinators.smart assocs sequences cpu.architecture
5 words compiler.cfg.instructions ;
6 IN: compiler.cfg.stack-frame
11 { spill-area-size integer }
12 { total-size integer }
13 { calls-vm? boolean } ;
15 ! Stack frame utilities
17 stack-frame get [ params>> ] [ return>> ] bi + ;
19 : spill-offset ( n -- offset )
22 : (stack-frame-size) ( stack-frame -- n )
24 [ params>> ] [ return>> ] [ spill-area-size>> ] tri
27 : max-stack-frame ( frame1 frame2 -- frame3 )
28 [ stack-frame new ] 2dip
30 [ [ params>> ] bi@ max >>params ]
31 [ [ return>> ] bi@ max >>return ]
32 [ [ spill-area-size>> ] bi@ max >>spill-area-size ]
33 [ [ calls-vm?>> ] bi@ or >>calls-vm? ]
36 ! PowerPC backend sets frame-required? for ##integer>float too
37 \ ##spill t "frame-required?" set-word-prop
38 \ ##unary-float-function t "frame-required?" set-word-prop
39 \ ##binary-float-function t "frame-required?" set-word-prop