Changeset 6305


Ignore:
Timestamp:
Apr 18, 2007, 11:36:59 PM (15 years ago)
Author:
gb
Message:

Use new scheme to map from tra to function/offset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/x8664-call/ccl/level-0/X86/x86-def.lisp

    r4955 r6305  
    223223  (single-value-return))
    224224
    225 
     225;;; Look for "lea -nnnn(%rip),%fn" AT the tra; if that's
     226;;; present, use the dispacement -nnnn to find the function.
     227;;; The end of the encoded displacement is 7 bytes from the
     228;;; tra.
    226229(defx86lapfunction %return-address-function ((r arg_z))
    227230  (extract-lisptag r imm0)
    228231  (cmpb ($ x8664::tag-tra) (% imm0.b))
    229232  (jne @fail)
    230   (movl (@ -4 (% r)) (% imm0.l))
    231   (testl (% imm0.l) (% imm0.l))
    232   (jle @fail)
    233   (subq (% imm0) (% arg_z))
     233  (cmpw ($ x8664::recover-fn-from-rip-word0) (@ (% r)))
     234  (jne @fail)
     235  (cmpb ($ x8664::recover-fn-from-rip-byte2) (@ 2 (% r)))
     236  (movslq (@ x8664::recover-fn-from-rip-disp-offset (% r)) (% imm0))
     237  (jne @fail)
     238  (lea (@ x8664::recover-fn-from-rip-length (% imm0) (% r)) (% arg_z))
    234239  (single-value-return)
    235240  @fail
     
    241246  (cmpb ($ x8664::tag-tra) (% imm0.b))
    242247  (jne @fail)
    243   (movl (@ -4 (% r)) (% imm0.l))
    244   (testl (% imm0.l) (% imm0.l))
    245   (jle @fail)
    246   (box-fixnum imm0 arg_z)
     248  (cmpw ($ x8664::recover-fn-from-rip-word0) (@ (% r)))
     249  (jne @fail)
     250  (cmpb ($ x8664::recover-fn-from-rip-byte2) (@ 2 (% r)))
     251  (movslq (@ x8664::recover-fn-from-rip-disp-offset (% r)) (% imm0))
     252  (jne @fail)
     253  (negq (% imm0))
     254  (leaq (@ (ash x8664::recover-fn-from-rip-length x8664::fixnumshift) (% imm0) 8) (% arg_z))
    247255  (single-value-return)
    248256  @fail
     
    252260;;; It's always been the case that the function associated with a
    253261;;; frame pointer is the caller of the function that "uses" that frame.
    254 (defx86lapfunction %cfp-lfun ((p arg_z))
    255   (ref-global ret1valaddr imm0)
    256   (movq (@ x8664::lisp-frame.return-address (% p)) (% arg_y))
    257   (cmpq (% imm0) (% arg_y))
    258   (cmoveq (@ x8664::lisp-frame.xtra (% p)) (% arg_y))
    259   (extract-lisptag arg_y imm0)
    260   (cmpb ($ x8664::tag-tra) (%b imm0))
    261   (jne @no)
    262   (movl (@ -4 (% arg_y)) (%l imm0))
    263   (testl (% imm0.l) (% imm0.l))
    264   (je @no)
    265   (subq (% imm0) (% arg_y))
    266   (box-fixnum imm0 arg_z)
    267   (movq (% rsp) (% temp0))
    268   (pushq (% arg_y))
    269   (pushq (% arg_z))
    270   (set-nargs 2)
    271   (jmp-subprim .SPvalues)
    272   @no
    273   (movq (% rsp) (% temp0))
    274   (pushq ($ x8664::nil-value))
    275   (pushq ($ x8664::nil-value))
    276   (set-nargs 2)
    277   (jmp-subprim .SPvalues))
     262(defun %cfp-lfun (p)
     263  (let* ((ra (%fixnum-ref p x8664::lisp-frame.return-address)))
     264    (if (eq ra (%get-kernel-global ret1valaddr))
     265      (setq ra (%fixnum-ref p x8664::lisp-frame.xtra)))
     266    (values (%return-address-function ra) (%return-address-offset ra))))
    278267
    279268
Note: See TracChangeset for help on using the changeset viewer.