Changeset 9136


Ignore:
Timestamp:
Apr 11, 2008, 8:13:25 PM (12 years ago)
Author:
rme
Message:

%APPLY-LEXPR-WITH-METHOD-CONTEXT changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/X86/X8632/x8632-def.lisp

    r9127 r9136  
    316316  (int ($ 3))
    317317  ;; Somebody's called (or tail-called) us.
    318   ;; * Put magic arg in x8632::next-method-context (= x8632::temp0).
    319   ;; * Put function in x8632::xfn ( = x8632::temp1) until we're ready to
    320   ;;   jump to it.
    321   ;; * Set nargs to 0, then spread "args" on stack (clobbers arg_y,
    322   ;;   arg_z, but preserves x8632::xfn/x8632::next-method-context. Note
    323   ;;   that nargs and temp1 are the same register on x8632.
    324   ;; * Jump to the function in x8632::xfn.
    325   ;; These steps are done in a mixed up order on x8632 because of
    326   ;; the small number of registers.
    327   (popl (@ (% :rcontext) x8632::tcr.save0))     ;save return address,
    328   (popl (@ (% :rcontext) x8632::tcr.save1))     ;magic arg, and
    329   (movl (% function) (@ (% :rcontext) x8632::tcr.save2)) ;function in spill area
     318  ;; * Put magic arg in %rcontext:tcr.next-method-context
     319  ;; * Put function somewhere safe until we're ready to jump to it
     320  ;; * Set nargs to 0, then spread "args" on stack (clobbers regs)
     321  ;; * Jump to function (saved previously)
     322  (popl (@ (% :rcontext) x8632::tcr.save0))     ;return address
     323  (popl (@ (% :rcontext) x8632::tcr.next-method-context)) ;magic arg
     324  (movl (% function) (@ (% :rcontext) x8632::tcr.save1))
    330325  (set-nargs 0)
    331326  (movl (@ (% args)) (% temp0))         ;lexpr-count
    332327  (movl (% temp0) (% nargs))
    333328  (leal (@ x8632::node-size (% arg_z) (% temp0)) (% imm0))
    334   (subl ($ '2) (% imm0))
     329  (subl ($ '2) (% temp0))
    335330  (jbe @reg-only)
    336331  ;; Some args will be pushed; reserve a frame.
     
    348343  (jmp @go)
    349344  @reg-only
    350   (rcmp (% nargs) ($ '1))               ;note that nargs is temp1
     345  (rcmp (% nargs) ($ '1))
    351346  (je @one)
    352347  (jb @go)
    353348  (jmp @two)
    354349  @go
    355   (movl (@ (% :rcontext) x8632::tcr.save1) (% next-method-context)) ;aka temp0
    356350  (pushl (@ (% :rcontext) x8632::tcr.save0))     ;return address
    357   (movsd (% fpzero) (@ (% :rcontext) x8632::tcr.save0)) ;clear out save0/save1
    358   (movl (@ (% :rcontext) x8632::tcr.save2) (% imm0))
    359   ;; xxx if otherwise garbage, function might stick around until someone else
    360   ;; zeroes the spill area
    361   (jmp (% imm0)))
     351  (movl (@ (% :rcontext) x8632::tcr.save1) (% temp0)) ;function
     352  (movapd (% fpzero) (@ (% :rcontext) x8632::tcr.save0)) ;clear spill area
     353  (jmp (% temp0)))
    362354
    363355(defx8632lapfunction %apply-with-method-context ((magic 4)
Note: See TracChangeset for help on using the changeset viewer.