Changeset 8031


Ignore:
Timestamp:
Jan 10, 2008, 8:00:40 AM (12 years ago)
Author:
gb
Message:

When making frames on the tstack or cstack, store %rbp in the
word under the backlink. (In a few cases, this means reserving
an extra word pair for data.)

Doing this consistently enables us to associate frames on auxiliary
stacks with frames on the primary stack; it's necessary to do that
(somehow) in order to support RETURN-FROM-FRAME/APPLY-IN-FRAME.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp

    r8016 r8031  
    17471747  (movq (:@ (:%seg :rcontext) x8664::tcr.save-tsp) (:%mmx x8664::stack-temp))
    17481748  (movq (:%mmx x8664::stack-temp) (:@ (:%q temp)))
     1749  (movq (:% x8664::rbp) (:@ x8664::tsp-frame.rbp (:%q temp)))
    17491750  (movq (:%q temp) (:@ (:%seg :rcontext) x8664::tcr.save-tsp))
    17501751  (leaq (:@ (+ x8664::dnode-size x8664::fulltag-cons) (:%q temp)) (:%q temp))
     
    17751776  (jnz :loop)
    17761777  (movq (:%mmx x8664::stack-temp) (:@ (:%q tempa)))
     1778  (movq (:% x8664::rbp) (:@ x8664::tsp-frame.rbp (:%q tempa)))
    17771779  (movq (:%q tempa) (:@ (:%seg :rcontext) x8664::tcr.save-tsp))
    17781780  (movl (:$l header) (:@ x8664::dnode-size (:%q tempa)))
     
    21172119     ((w :u64)))
    21182120  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%mmx x8664::stack-temp)) 
    2119   (subq (:$b 16) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
    2120   (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0)) 
     2121  (subq (:$b (* 2 x8664::dnode-size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
     2122  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    21212123  (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0)))
    2122   (movq (:%q w) (:@ 8 (:%q x8664::ra0))))
     2124  (movq (:% x8664::rbp) (:@ x8664::csp-frame.rbp (:%q x8664::ra0)))
     2125  (movq (:%q w) (:@ x8664::dnode-size (:%q x8664::ra0))))
    21232126
    21242127
     
    21332136  (movapd (:%xmm x8664::fpzero) (:@ 16 (:%q temp)))
    21342137  (movq (:%mmx x8664::stack-temp) (:@ (:%q temp)))
     2138  (movq (:% x8664::rbp) (:@ x8664::tsp-frame.rbp (:%q temp))) 
    21352139  (movq (:%q temp) (:@ (:%seg :rcontext) x8664::tcr.save-tsp))
    21362140  (movq (:%q w) (:@ x8664::dnode-size (:%q temp))))
     
    21402144     ((f :double-float)))
    21412145  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%mmx x8664::stack-temp)) 
    2142   (subq (:$b 16) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
     2146  (subq (:$b (* 2 x8664::dnode-size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
    21432147  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0)) 
    21442148  (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0)))
    2145   (movsd (:%xmm f) (:@ 8 (:%q x8664::ra0))))
     2149  (movq (:% x8664::rbp) (:@ x8664::csp-frame.rbp (:%q x8664::ra0)))
     2150  (movapd (:%xmm f) (:@ x8664::dnode-size (:%q x8664::ra0))))
    21462151
    21472152
     
    21622167     ())
    21632168  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    2164   (movq (:@ 8 (:%q x8664::ra0)) (:%q w))
    2165   (addq (:$b 16) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp)))
     2169  (movq (:@ x8664::dnode-size (:%q x8664::ra0)) (:%q w))
     2170  (addq (:$b (* 2 x8664::dnode-size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp)))
    21662171
    21672172
     
    21802185     ())
    21812186  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    2182   (movsd (:@ 8 (:%q x8664::ra0)) (:%xmm f))
    2183   (addq (:$b 16) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp)))
     2187  (movapd (:@ x8664::dnode-size (:%q x8664::ra0)) (:%xmm f))
     2188  (addq (:$b (* 2 x8664::dnode-size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp)))
    21842189
    21852190
     
    21882193                                   ((ptr :address)))
    21892194  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%mmx x8664::stack-temp))
    2190   (subq (:$b (+ 16 x8664::macptr.size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
     2195  (subq (:$b (+ x8664::dnode-size x8664::macptr.size)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
    21912196  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    21922197  (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0)))
    2193   (leaq (:@ (+ 16 x8664::fulltag-misc) (:%q  x8664::ra0)) (:%q dest))
     2198  (movq (:% x8664::rbp) (:@ x8664::csp-frame.rbp (:%q x8664::ra0)))
     2199  (leaq (:@ (+ x8664::dnode-size x8664::fulltag-misc) (:%q  x8664::ra0)) (:%q dest))
    21942200  (movq (:$l x8664::macptr-header) (:@ x8664::macptr.header (:%q dest)))
    21952201  (movq (:%q ptr) (:@ x8664::macptr.address (:%q dest)))
     
    36003606   (subq (:$l (:apply ash (:apply logandc2 (:apply + nwords 9) 1) x8664::word-shift)) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp)))
    36013607  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    3602   (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0))))
     3608  (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0)))
     3609  (movq (:% x8664::rbp) (:@ x8664::csp-frame.rbp (:%q x8664::ra0))))
    36033610
    36043611(define-x8664-vinsn alloc-variable-c-frame (()
     
    36113618  (subq (:%q size) (:@ (:%seg :rcontext) x8664::tcr.foreign-sp))
    36123619  (movq (:@ (:%seg :rcontext) x8664::tcr.foreign-sp) (:%q x8664::ra0))
    3613   (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0))))
     3620  (movq (:%mmx x8664::stack-temp) (:@ (:%q x8664::ra0)))
     3621  (movq (:% x8664::rbp) (:@ x8664::csp-frame.rbp (:%q x8664::ra0))))
    36143622
    36153623(define-x8664-vinsn set-c-arg (()
     
    36723680  (movapd (:%xmm x8664::fpzero) (:@ (:%q temp)))
    36733681  (movapd (:%xmm x8664::fpzero) (:@ x8664::dnode-size (:%q temp)))
    3674   (movq (:%mmx x8664::stack-temp) (:@ (:%q temp)))
     3682  (movq (:%mmx x8664::stack-temp) (:@ (:%q temp)))
     3683  (movq (:% x8664::rbp) (:@ x8664::tsp-frame.rbp (:%q temp))) 
    36753684  (movq (:%q temp) (:@ (:%seg :rcontext) x8664::tcr.save-tsp)) 
    36763685  (movq (:$l x8664::value-cell-header) (:@ x8664::dnode-size (:%q temp)))
Note: See TracChangeset for help on using the changeset viewer.