X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Falpha%2Fvm.lisp;h=6c312841fb76a0c096cddbebe138b7f6f5c4c07b;hb=11f02398a1a9ccbde847c82fd233e8378e45c29c;hp=6d5bcf75dc6ce13b1f883943e821b14fe1ede39e;hpb=63fcb94b875a97e468d9add229e220ecceec2352;p=sbcl.git diff --git a/src/compiler/alpha/vm.lisp b/src/compiler/alpha/vm.lisp index 6d5bcf7..6c31284 100644 --- a/src/compiler/alpha/vm.lisp +++ b/src/compiler/alpha/vm.lisp @@ -19,13 +19,14 @@ (macrolet ((defreg (name offset) (let ((offset-sym (symbolicate name "-OFFSET"))) `(eval-when (:compile-toplevel :load-toplevel :execute) - (defconstant ,offset-sym ,offset) - (setf (svref *register-names* ,offset-sym) ,(symbol-name name))))) + (def!constant ,offset-sym ,offset) + (setf (svref *register-names* ,offset-sym) + ,(symbol-name name))))) (defregset (name &rest regs) `(eval-when (:compile-toplevel :load-toplevel :execute) (defparameter ,name - (list ,@(mapcar #'(lambda (name) - (symbolicate name "-OFFSET")) + (list ,@(mapcar (lambda (name) + (symbolicate name "-OFFSET")) regs)))))) ;; c.f. src/runtime/alpha-lispregs.h @@ -92,10 +93,8 @@ ;;; a handy macro so we don't have to keep changing all the numbers ;;; whenever we insert a new storage class. -;;; -;;; FIXME: This macro is not needed in the runtime target. -(defmacro define-storage-classes (&rest classes) +(defmacro !define-storage-classes (&rest classes) (do ((forms (list 'progn) (let* ((class (car classes)) (sc-name (car class)) @@ -104,7 +103,7 @@ "-SC-NUMBER")))) (list* `(define-storage-class ,sc-name ,index ,@(cdr class)) - `(defconstant ,constant-name ,index) + `(def!constant ,constant-name ,index) ;; (The CMU CL version of this macro did ;; `(EXPORT ',CONSTANT-NAME) ;; here, but in SBCL we try to have package @@ -121,11 +120,11 @@ ;;; see comment in ../x86/vm.lisp. The value of 7 was taken from ;;; vm:catch-block-size in a cmucl that I happened to have around ;;; and seems to be working so far -dan -(defconstant sb!vm::kludge-nondeterministic-catch-block-size 7) +(def!constant sb!vm::kludge-nondeterministic-catch-block-size 7) -(define-storage-classes +(!define-storage-classes - ;; Non-immediate contstants in the constant pool + ;; non-immediate constants in the constant pool (constant constant) ;; ZERO and NULL are in registers. @@ -308,19 +307,19 @@ ;;;; function call parameters ;;; the SC numbers for register and stack arguments/return values -(defconstant register-arg-scn (meta-sc-number-or-lose 'descriptor-reg)) -(defconstant immediate-arg-scn (meta-sc-number-or-lose 'any-reg)) -(defconstant control-stack-arg-scn (meta-sc-number-or-lose 'control-stack)) +(def!constant register-arg-scn (meta-sc-number-or-lose 'descriptor-reg)) +(def!constant immediate-arg-scn (meta-sc-number-or-lose 'any-reg)) +(def!constant control-stack-arg-scn (meta-sc-number-or-lose 'control-stack)) (eval-when (:compile-toplevel :load-toplevel :execute) ;;; offsets of special stack frame locations -(defconstant ocfp-save-offset 0) -(defconstant lra-save-offset 1) -(defconstant nfp-save-offset 2) +(def!constant ocfp-save-offset 0) +(def!constant lra-save-offset 1) +(def!constant nfp-save-offset 2) ;;; the number of arguments/return values passed in registers -(defconstant register-arg-count 6) +(def!constant register-arg-count 6) ;;; (Names to use for the argument registers would go here, but there ;;; are none.) @@ -329,14 +328,14 @@ ;;; a list of TN's describing the register arguments (defparameter *register-arg-tns* - (mapcar #'(lambda (n) - (make-random-tn :kind :normal - :sc (sc-or-lose 'descriptor-reg) - :offset n)) + (mapcar (lambda (n) + (make-random-tn :kind :normal + :sc (sc-or-lose 'descriptor-reg) + :offset n)) *register-arg-offsets*)) ;;; This is used by the debugger. -(defconstant single-value-return-byte-offset 4) +(def!constant single-value-return-byte-offset 4) ;;; This function is called by debug output routines that want a ;;; pretty name for a TN's location. It returns a thing that can be @@ -353,3 +352,11 @@ (non-descriptor-stack (format nil "NS~D" offset)) (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) + +;;; The loader uses this to convert alien names to the form they +;;; occure in the symbol table (for example, prepending an +;;; underscore). +(defun extern-alien-name (name) + (declare (type simple-base-string name)) + ;; On the Alpha we don't do anything. + name)