Changeset 8027


Ignore:
Timestamp:
Jan 8, 2008, 8:50:36 AM (12 years ago)
Author:
gb
Message:

Remove #+are-you-kidding version of %%APPLY-IN-FRAME.

Fix a few bugs in %%APPLY-IN-FRAME-PROTO. Simple cases work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-0/X86/x86-misc.lisp

    r8012 r8027  
    513513  (single-value-return))
    514514
    515 #+are-you-kidding
    516 (defx86lapfunction %%apply-in-frame ((catch-count imm0) (srv temp0) (tsp-count imm0) (db-link imm0)
    517                                      (parent arg_x) (function arg_y) (arglist arg_z))
    518   (check-nargs 7)
    519 
    520   ; Throw through catch-count catch frames
    521   (lwz imm0 12 vsp)                      ; catch-count
    522   (vpush parent)
    523   (vpush function)
    524   (vpush arglist)
    525   (bla .SPnthrowvalues)
    526 
    527   ; Pop tsp-count TSP frames
    528   (lwz tsp-count 16 vsp)
    529   (cmpi cr0 tsp-count 0)
    530   (b @test)
    531 @loop
    532   (subi tsp-count tsp-count '1)
    533   (cmpi cr0 tsp-count 0)
    534   (lwz tsp 0 tsp)
    535 @test
    536   (bne cr0 @loop)
    537 
    538   ; Pop dynamic bindings until we get to db-link
    539   (lwz imm0 12 vsp)                     ; db-link
    540   (lwz imm1 x8664::tcr.db-link :rcontext)
    541   (cmp cr0 imm0 imm1)
    542   (beq cr0 @restore-regs)               ; .SPunbind-to expects there to be something to do
    543   (bla .SPunbind-to)
    544 
    545 @restore-regs
    546   ; restore the saved registers from srv
    547   (lwz srv 20 vsp)
    548 @get0
    549   (svref imm0 1 srv)
    550   (cmpwi cr0 imm0 x8664::nil-value)
    551   (beq @get1)
    552   (lwz save0 0 imm0)
    553 @get1
    554   (svref imm0 2 srv)
    555   (cmpwi cr0 imm0 x8664::nil-value)
    556   (beq @get2)
    557   (lwz save1 0 imm0)
    558 @get2
    559   (svref imm0 3 srv)
    560   (cmpwi cr0 imm0 x8664::nil-value)
    561   (beq @get3)
    562   (lwz save2 0 imm0)
    563 @get3
    564   (svref imm0 4 srv)
    565   (cmpwi cr0 imm0 x8664::nil-value)
    566   (beq @get4)
    567   (lwz save3 0 imm0)
    568 @get4
    569   (svref imm0 5 srv)
    570   (cmpwi cr0 imm0 x8664::nil-value)
    571   (beq @get5)
    572   (lwz save4 0 imm0)
    573 @get5
    574   (svref imm0 6 srv)
    575   (cmpwi cr0 imm0 x8664::nil-value)
    576   (beq @get6)
    577   (lwz save5 0 imm0)
    578 @get6
    579   (svref imm0 7 srv)
    580   (cmpwi cr0 imm0 x8664::nil-value)
    581   (beq @get7)
    582   (lwz save6 0 imm0)
    583 @get7
    584   (svref imm0 8 srv)
    585   (cmpwi cr0 imm0 x8664::nil-value)
    586   (beq @got)
    587   (lwz save7 0 imm0)
    588 @got
    589 
    590   (vpop arg_z)                          ; arglist
    591   (vpop temp0)                          ; function
    592   (vpop parent)                         ; parent
    593   (extract-lisptag imm0 parent)
    594   (cmpi cr0 imm0 x8664::tag-fixnum)
    595   (if (:cr0 :ne)
    596     ; Parent is a fake-stack-frame. Make it real
    597     (progn
    598       (svref sp %fake-stack-frame.sp parent)
    599       (stwu sp (- x8664::lisp-frame.size) sp)
    600       (svref fn %fake-stack-frame.fn parent)
    601       (stw fn x8664::lisp-frame.savefn sp)
    602       (svref temp1 %fake-stack-frame.vsp parent)
    603       (stw temp1 x8664::lisp-frame.savevsp sp)
    604       (svref temp1 %fake-stack-frame.lr parent)
    605       (extract-lisptag imm0 temp1)
    606       (cmpi cr0 imm0 x8664::tag-fixnum)
    607       (if (:cr0 :ne)
    608         ;; must be a macptr encoding the actual link register
    609         (macptr-ptr loc-pc temp1)
    610         ;; Fixnum is offset from start of function vector
    611         (progn
    612           (svref temp2 0 fn)        ; function vector
    613           (unbox-fixnum temp1 temp1)
    614           (add loc-pc temp2 temp1)))
    615       (stw loc-pc x8664::lisp-frame.savelr sp))
    616     ;; Parent is a real stack frame
    617     (mr sp parent))
    618   (set-nargs 0)
    619   (bla .SPspreadargz)
    620   (ba .SPtfuncallgen))
    621515
    622516
     
    769663  (:fixed-constants (target-frame target-catch target-db-link target-xcf target-tsp target-foreign-sp save0-offset save1-offset save2-offset save3-offset function args))
    770664  (check-nargs 0)
     665  ;;(uuo-error-debug-trap)
    771666  (movq (@ 'target-catch (% fn)) (% temp0))
    772667  (xorl (%l imm0) (%l imm0))
     
    875770  @back-from-spread
    876771  (recover-fn-from-rip)                 ; .SPspreadargz preserves %fn, but ...
     772  (push (% temp0))                      ; return address
    877773  (jmp (@ 'function (% fn))))
    878774 
Note: See TracChangeset for help on using the changeset viewer.