Changeset 15000


Ignore:
Timestamp:
Sep 27, 2011, 6:50:19 PM (8 years ago)
Author:
rme
Message:

In r14968, we overloaded a couple of slots in the x86 xcf
in order to represent the absolute pc value as two fixnums.
Instead of doing that, add two slots to the x86 xcf and
always put the the encoded absolute pc there.

Location:
trunk/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8632/x8632-arch.lisp

    r14621 r15000  
    539539  foreign-sp                            ;value of tcr.foreign_sp
    540540  prev-xframe                           ;tcr.xframe before exception
    541   )                                     ;(last 2 needed by apply-in-frame)
     541                                        ;(last 2 needed by apply-in-frame)
     542  pc-low                                ;fixnum low half of absolute pc
     543  pc-high                               ;and the high half
     544  )
    542545
    543546;;; The kernel uses these (rather generically named) structures
  • trunk/source/compiler/X86/X8664/x8664-arch.lisp

    r14175 r15000  
    635635  prev-xframe                           ; tcr.xframe before exception
    636636                                        ; (last 2 needed by apply-in-frame)
     637  pc-low                                ;fixnum low half of absolute pc
     638  pc-high                               ;and the high half
    637639  )
    638640
  • trunk/source/level-1/x86-trap-support.lisp

    r14968 r15000  
    342342                        (type (simple-array (unsigned-byte 8) (*)) containing-object))
    343343        (aref containing-object (the fixnum (+ byte-offset delta))))
    344       ;; xcf.relative-pc is a fixnum containing the high half of the
    345       ;; absolute PC; xcf.ra0 is a fixnum containing the low half
    346       (let* ((high-half byte-offset)
    347              (low-half (%get-object xcf-ptr target::xcf.ra0))
     344      (let* ((high-half (%get-object xcf-ptr target::xcf.pc-high))
     345             (low-half (%get-object xcf-ptr target::xcf.pc-low))
    348346             (pc #+64-bit-target (dpb high-half (byte 32 32) low-half)
    349347                 #+32-bit-target (dpb high-half (byte 16 16) low-half)))
  • trunk/source/lisp-kernel/x86-constants32.h

    r14991 r15000  
    247247    LispObj tra;                /* ALWAYS 0 FOR AN XCF */
    248248    LispObj nominal_function;   /* the current function at the time of the exception */
    249     LispObj relative_pc;        /* Boxed byte offset within actual function or absolute address */
     249    LispObj relative_pc;        /* Boxed byte offset within actual function */
    250250    LispObj containing_uvector; /* the uvector that contains the relative PC or NIL */
    251251    LispObj xp;                 /* exception context */
     
    253253    LispObj foreign_sp;         /* foreign sp at the time that exception occurred */
    254254    LispObj prev_xframe;        /* so %apply-in-frame can unwind it */
     255    LispObj pc_low;             /* fixnum low half of absolute pc */
     256    LispObj pc_high;            /* and the high half */
    255257} xcf;
    256258
  • trunk/source/lisp-kernel/x86-constants64.h

    r14991 r15000  
    289289  LispObj tra;                  /* ALWAYS 0 FOR AN XCF */
    290290  LispObj nominal_function;     /* the current function at the time of the exception */
    291   LispObj relative_pc;          /* Boxed byte offset within actual
    292                                    function or absolute address */
     291  LispObj relative_pc;          /* Boxed byte offset within actual function */
    293292  LispObj containing_uvector;   /* the uvector that contains the relative PC or NIL */
    294293  LispObj xp;                   /* exception context */
     
    296295  LispObj foreign_sp;           /* foreign sp at the time that exception occurred */
    297296  LispObj prev_xframe;          /* so %apply-in-frame can unwind it */
     297  LispObj pc_low;               /* fixnum low half of absolute pc */
     298  LispObj pc_high;              /* and the high half */
    298299} xcf;
    299300
  • trunk/source/lisp-kernel/x86-exceptions.c

    r14993 r15000  
    404404{
    405405  LispObj containing_uvector = 0,
    406     relative_pc,
     406    relative_pc = lisp_nil,
    407407    nominal_function = lisp_nil,
    408408    f, tra, tra_f = 0, abs_pc;
     409  LispObj pc_low, pc_high;
    409410
    410411  f = xpGPR(xp,Ifn);
     
    412413  tra_f = tra_function(tra);
    413414  abs_pc = (LispObj)xpPC(xp);
     415#if WORD_SIZE == 64
     416  pc_high = ((abs_pc >> 32) & 0xffffffff) << fixnumshift;
     417  pc_low = (abs_pc & 0xffffffff) << fixnumshift;
     418#else
     419  pc_high = ((abs_pc >> 16) & 0xffff) << fixnumshift;
     420  pc_low = (abs_pc & 0xffff) << fixnumshift;
     421#endif
     422
    414423
    415424  if (functionp(f))
     
    439448  } else {
    440449    containing_uvector = lisp_nil;
    441     /*
    442      * An absolute PC will not necessarily fit into a fixnum,
    443      * so encode it as two fixnums and let lisp reassemble it.
    444      */
    445 #if WORD_SIZE == 64
    446     relative_pc = ((abs_pc >> 32) & 0xffffffff) << fixnumshift;
    447     tra = (abs_pc & 0xffffffff) << fixnumshift;
    448 #else
    449     relative_pc = ((abs_pc >> 16) & 0xffff) << fixnumshift;
    450     tra = (abs_pc & 0xffff) << fixnumshift;
    451 #endif
    452   }
     450  }
     451  push_on_lisp_stack(xp, pc_high);
     452  push_on_lisp_stack(xp, pc_low);
    453453  push_on_lisp_stack(xp,(LispObj)(tcr->xframe->prev));
    454454  push_on_lisp_stack(xp,(LispObj)(tcr->foreign_sp));
Note: See TracChangeset for help on using the changeset viewer.