Changeset 15870


Ignore:
Timestamp:
Jul 23, 2013, 2:16:53 PM (7 years ago)
Author:
gb
Message:

arm-arch.lisp: keep track of the number of kernel-imports

arm-utils.lisp: kernel-import addresses can't generally be treated
as or represented as fixnums. Treat them uniformly as MACPTRs, but
cache their values per session.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/ARM/arm-arch.lisp

    r15607 r15870  
    10081008  lisp-sigexit
    10091009  jvm-init
    1010 )
     1010  ;; Dummy entry
     1011  last-kernel-import
     1012)
     1013
     1014(defconstant num-kernel-imports (ash kernel-import-last-kernel-import -2))
    10111015
    10121016(defmacro nrs-offset (name)
  • trunk/source/level-0/ARM/arm-utils.lisp

    r15829 r15870  
    449449  (bx lr))
    450450
     451(defparameter *kernel-import-table* nil)
     452
     453(defun %kernel-import (offset)
     454  (declare (fixnum offset)
     455           (optimize (speed 3) (safety 0)))
     456  (let* ((table (or *kernel-import-table*
     457                    (setq *kernel-import-table* (make-array target::num-kernel-imports))))
     458         (idx (ash offset -2))
     459         (p (svref table idx)))
     460    (declare (simple-vector table) (fixnum idx))
     461    (if (typep p 'macptr) ; not dead-macptr from earlier session
     462      p
     463      (setf (svref table idx) (%kernel-import-internal offset)))))
    451464
    452465;;; offset is a fixnum, one of the arm::kernel-import-xxx constants.
    453 ;;; Returns that kernel import, a fixnum.
    454 (defarmlapfunction %kernel-import ((offset arg_z))
     466;;; Returns that kernel import as a MACPTR
     467(defarmlapfunction %kernel-import-internal ((offset arg_z))
    455468  (ref-global imm0 kernel-imports)
    456469  (ldr imm0 (:@ imm0 (:asr arg_z (:$ arm::fixnumshift))))
    457   ;; May not fit in a fixnum.  We'd really rather not CONS
    458   ;; here, but it won't kill us to do so.
    459   (spjump .SPmakeu32))
     470  (lri imm1 arm::macptr-header)
     471  (sub allocptr allocptr (:$ (- arm::macptr.size arm::fulltag-misc)))
     472  (ldr arg_z (:@ rcontext (:$ arm::tcr.save-allocbase)))
     473  (cmp allocptr arg_z)
     474  (bhi @no-trap)
     475  (uuo-alloc-trap)
     476  @no-trap
     477  (str imm1 (:@ allocptr (:$ arm::macptr.header)))
     478  (mov arg_z allocptr)
     479  (bic allocptr allocptr (:$ arm::fulltagmask))
     480  (str imm0 (:@ arg_z (:$ arm::macptr.address)))
     481  (bx lr))
    460482
    461483(defarmlapfunction %get-unboxed-ptr ((macptr arg_z))
Note: See TracChangeset for help on using the changeset viewer.