X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fppc%2Fvm.lisp;h=c52ddfe7acb2147e720efba16a5f6ba333ebf775;hb=8a8568603cc7cacd188fe1cac18824a69bece6af;hp=3f41b89d03fdfba49bc05d2ad816ef1f45ccd12e;hpb=506253505641855dc8bb87033f7af894904f848b;p=sbcl.git diff --git a/src/compiler/ppc/vm.lisp b/src/compiler/ppc/vm.lisp index 3f41b89..c52ddfe 100644 --- a/src/compiler/ppc/vm.lisp +++ b/src/compiler/ppc/vm.lisp @@ -1,6 +1,26 @@ -;;; +;;;; miscellaneous VM definition noise for the PPC + +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; This software is derived from the CMU CL system, which was +;;;; written at Carnegie Mellon University and released into the +;;;; public domain. The software is in the public domain and is +;;;; provided with absolutely no warranty. See the COPYING and CREDITS +;;;; files for more information. + (in-package "SB!VM") +;;; NUMBER-STACK-DISPLACEMENT +;;; +;;; The number of bytes reserved above the number stack pointer. These +;;; slots are required by architecture, mostly (?) to make C backtrace +;;; work. This must be a power of 2 - see BYTES-REQUIRED-FOR-NUMBER-STACK. +;;; +(def!constant number-stack-displacement + (* #!-darwin 2 + #!+darwin 8 + n-word-bytes)) ;;;; Define the registers @@ -98,9 +118,7 @@ ((null classes) (nreverse forms)))) -;; XXX this is most likely wrong. Check with Eric Marsden next time you -;; see him -(def!constant sb!vm::kludge-nondeterministic-catch-block-size 7) +(def!constant kludge-nondeterministic-catch-block-size 7) (define-storage-classes @@ -123,7 +141,7 @@ ;; The non-descriptor stacks. (signed-stack non-descriptor-stack) ; (signed-byte 32) (unsigned-stack non-descriptor-stack) ; (unsigned-byte 32) - (base-char-stack non-descriptor-stack) ; non-descriptor characters. + (character-stack non-descriptor-stack) ; non-descriptor characters. (sap-stack non-descriptor-stack) ; System area pointers. (single-stack non-descriptor-stack) ; single-floats (double-stack non-descriptor-stack @@ -151,11 +169,11 @@ :alternate-scs (control-stack)) ;; Non-Descriptor characters - (base-char-reg registers + (character-reg registers :locations #.non-descriptor-regs :constant-scs (immediate) :save-p t - :alternate-scs (base-char-stack)) + :alternate-scs (character-stack)) ;; Non-Descriptor SAP's (arbitrary pointers into address space) (sap-reg registers @@ -221,9 +239,7 @@ ;; A catch or unwind block. (catch-block control-stack - :element-size sb!vm::kludge-nondeterministic-catch-block-size)) - - + :element-size kludge-nondeterministic-catch-block-size)) ;;;; Make some random tns for important registers. @@ -256,7 +272,8 @@ (sc-number-or-lose 'zero)) (null (sc-number-or-lose 'null)) - ((or fixnum system-area-pointer character) + ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum) + system-area-pointer character) (sc-number-or-lose 'immediate)) (symbol (if (static-symbol-p value) @@ -316,11 +333,19 @@ (immediate-constant "Immed")))) ;;; The loader uses this to convert alien names to the form they -;;; occur in the symbol table. This is ELF, so do nothing. +;;; occur in the symbol table. (defun extern-alien-name (name) - (declare (type simple-base-string name)) - ;; Darwin is non-ELF, and needs a _ prefix - #!+darwin (concatenate 'string "_" name) - ;; The other (ELF) ports currently don't need any prefix - #!-darwin name) + (declare (type string name)) + ;; Darwin is non-ELF, and needs a _ prefix. The other (ELF) ports + ;; currently don't need any prefix. + (flet ((maybe-prefix (name) + #!+darwin (concatenate 'simple-base-string "_" name) + #!-darwin name)) + (typecase name + (simple-base-string (maybe-prefix name)) + (base-string (coerce (maybe-prefix name) 'simple-base-string)) + (t + (handler-case (coerce (maybe-prefix name) 'simple-base-string) + (type-error () + (error "invalid external alien name: ~S" name)))))))