Changeset 10489


Ignore:
Timestamp:
Aug 18, 2008, 12:40:32 PM (11 years ago)
Author:
gb
Message:

%APPLY-WITH-METHOD-CONTEXT: try to fix register usage (still don't
have enough registers, and I wound up using the last slot in the tcr
spill area and doing push/ret, which may be hard on the call-return
tracking stuff.)

This seems to fix at least the simple case in ticket:325, and
a few other simple cases seem to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/X8632/x8632-def.lisp

    r10267 r10489  
    382382  (discard-reserved-frame)
    383383  (movl (% args) (@ (% :rcontext) x8632::tcr.save2))    ;in case of error
    384   (xorl (% imm0) (% imm0))
    385   (push (% imm0))               ;reserve frame (might discard it
    386   (push (% imm0))               ;if nothing is passed on stack)
     384  (set-nargs 0)
     385  (pushl ($ target::reserved-frame-marker))             ;reserve frame (might discard it
     386  (pushl ($ target::reserved-frame-marker))             ;if nothing is passed on stack)
    387387  (cmp-reg-to-nil arg_z)
    388388  (je @done)
    389   (mark-as-imm temp0)
    390389  @loop
    391   (extract-fulltag arg_z temp0)
    392   (cmpb ($ x8632::fulltag-cons) (% temp0.b)) ;nil is a cons on x8632, but we
     390  (extract-fulltag arg_z imm0)
     391  (cmpb ($ x8632::fulltag-cons) (% imm0.b)) ;nil is a cons on x8632, but we
    393392  (jne @bad)                                 ; checked for it already.
    394393  (%car arg_z temp1)
    395394  (%cdr arg_z arg_z)
    396   (add ($ '1) (% imm0))                 ;shorter than lea (imm0 is eax)
     395  (add ($ '1) (% nargs))                        ;shorter than lea (imm0 is eax)
    397396  (cmp-reg-to-nil arg_z)
    398397  (push (% temp1))
    399398  (jne @loop)
    400   (mark-as-node temp0)
    401399  @done
    402   ;; arg_y about to get clobbered; put function into xfn.
    403   (movl (% function) (% xfn))           ;aka temp1
    404   ;; imm0 (aka nargs) contains number of args just pushed
    405   (test (% imm0) (% imm0))
     400  ;; arg_y about to get clobbered; put function into tcr save area.
     401  (movl (% function) (@ (% :rcontext) target::tcr.save3))
     402  ;; temp1 (aka nargs) contains number of args just pushed
     403  (test (% nargs) (% nargs))
    406404  (jne @pop)
    407405  @discard-and-go
     
    417415  @go
    418416  (pushl (@ (% :rcontext) x8632::tcr.save0))     ;return address
     417  (pushl (@ (% :rcontext) x8632::tcr.save3))
    419418  (movl (@ (% :rcontext) x8632::tcr.save1) (% next-method-context)) ;aka temp0
    420419  (movapd (% fpzero) (@ (% :rcontext) x8632::tcr.save0)) ;clear out spill area
    421   (jmp (% xfn))                          ;aka temp1
     420  (ret)                          ;aka temp1
    422421  @bad
    423   (mark-as-node temp0)
    424   (addl (% imm0) (% esp))
     422  (addl (% nargs) (% esp))
    425423  (movl (@ (% :rcontext) x8632::tcr.save1) (% arg_z)) ;saved args
    426424  (movapd (% fpzero) (@ (% :rcontext) x8632::tcr.save0)) ;clear out spill area
Note: See TracChangeset for help on using the changeset viewer.