From 9105a2e4a8701814db413aa9ac3c41fd79d5b4f1 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 19 May 2007 02:14:05 +0000 Subject: [PATCH] 1.0.5.53: cleanup LOAD-TYPE macros * when the LOAD-TYPE macros in the various backends hardcoded '3', they really meant (1- N-WORD-BYTES)--a little reflection on widetags, lowtags, and endian orderings should make this clear (we don't have a 64-bit big-endian port to drive it home, though); * catch the spread of magic constants in code/array.lisp. --- make.sh | 2 +- src/code/array.lisp | 6 +----- src/compiler/hppa/macros.lisp | 2 +- src/compiler/mips/macros.lisp | 2 +- src/compiler/ppc/macros.lisp | 2 +- src/compiler/sparc/macros.lisp | 2 +- src/compiler/x86-64/macros.lisp | 3 ++- src/compiler/x86/macros.lisp | 3 ++- version.lisp-expr | 2 +- 9 files changed, 11 insertions(+), 13 deletions(-) diff --git a/make.sh b/make.sh index 51a36cca0..c06056e8f 100755 --- a/make.sh +++ b/make.sh @@ -65,7 +65,7 @@ if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then else DEVNULL=/dev/null fi -SBCL_XC_HOST="${1:-sbcl --disable-debugger --userinit $DEVNULL --sysinit $DEVNULL}" +SBCL_XC_HOST="${1:-sbcl --userinit $DEVNULL --sysinit $DEVNULL}" export DEVNULL export SBCL_XC_HOST echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\" diff --git a/src/code/array.lisp b/src/code/array.lisp index f41730b02..39850a60e 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -349,11 +349,7 @@ of specialized arrays is supported." (:little-endian (- sb!vm:other-pointer-lowtag)) (:big-endian - ;; I'm not completely sure of what this - ;; 3 represents symbolically. It's - ;; just what all the LOAD-TYPE vops - ;; are doing. - (- 3 sb!vm:other-pointer-lowtag))))) + (- (1- n-word-bytes) sb!vm:other-pointer-lowtag))))) ;; WIDETAG-OF needs extra code to handle ;; LIST and FUNCTION lowtags. We're only ;; dispatching on other pointers, so let's diff --git a/src/compiler/hppa/macros.lisp b/src/compiler/hppa/macros.lisp index d3e807046..95f7563ec 100644 --- a/src/compiler/hppa/macros.lisp +++ b/src/compiler/hppa/macros.lisp @@ -52,7 +52,7 @@ (:little-endian `(inst ldb ,offset ,source ,target)) (:big-endian - `(inst ldb (+ ,offset 3) ,source ,target)))) + `(inst ldb (+ ,offset (1- n-word-bytes)) ,source ,target)))) ;;; Macros to handle the fact that we cannot use the machine native call and ;;; return instructions. diff --git a/src/compiler/mips/macros.lisp b/src/compiler/mips/macros.lisp index 9e09443e6..e6316c0bc 100644 --- a/src/compiler/mips/macros.lisp +++ b/src/compiler/mips/macros.lisp @@ -70,7 +70,7 @@ (:little-endian `(inst lbu ,n-target ,n-source ,n-offset)) (:big-endian - `(inst lbu ,n-target ,n-source (+ ,n-offset 3)))))) + `(inst lbu ,n-target ,n-source (+ ,n-offset (1- n-word-bytes))))))) ;;; Macros to handle the fact that we cannot use the machine native call and diff --git a/src/compiler/ppc/macros.lisp b/src/compiler/ppc/macros.lisp index c1eac07f8..7e9ace428 100644 --- a/src/compiler/ppc/macros.lisp +++ b/src/compiler/ppc/macros.lisp @@ -67,7 +67,7 @@ (:little-endian `(inst lbz ,n-target ,n-source ,n-offset)) (:big-endian - `(inst lbz ,n-target ,n-source (+ ,n-offset 3)))))) + `(inst lbz ,n-target ,n-source (+ ,n-offset (1- n-word-bytes))))))) ;;; Macros to handle the fact that we cannot use the machine native call and ;;; return instructions. diff --git a/src/compiler/sparc/macros.lisp b/src/compiler/sparc/macros.lisp index bc8149ebd..a453e2b98 100644 --- a/src/compiler/sparc/macros.lisp +++ b/src/compiler/sparc/macros.lisp @@ -70,7 +70,7 @@ (:little-endian `(inst ldub ,n-target ,n-source ,n-offset)) (:big-endian - `(inst ldub ,n-target ,n-source (+ ,n-offset 3)))))) + `(inst ldub ,n-target ,n-source (+ ,n-offset (1- n-word-bytes))))))) ;;; Macros to handle the fact that we cannot use the machine native call and ;;; return instructions. diff --git a/src/compiler/x86-64/macros.lisp b/src/compiler/x86-64/macros.lisp index be94d71a3..16a77748e 100644 --- a/src/compiler/x86-64/macros.lisp +++ b/src/compiler/x86-64/macros.lisp @@ -125,7 +125,8 @@ (make-ea :byte :base ,n-source :disp ,n-offset))) (:big-endian `(inst mov ,n-target - (make-ea :byte :base ,n-source :disp (+ ,n-offset 4))))))) + (make-ea :byte :base ,n-source + :disp (+ ,n-offset (1- n-word-bytes)))))))) ;;;; allocation helpers diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index 468efaaf2..01c62267b 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -160,7 +160,8 @@ (make-ea :byte :base ,n-source :disp ,n-offset))) (:big-endian `(inst mov ,n-target - (make-ea :byte :base ,n-source :disp (+ ,n-offset 3))))))) + (make-ea :byte :base ,n-source + :disp (+ ,n-offset (1- n-word-bytes)))))))) ;;;; allocation helpers diff --git a/version.lisp-expr b/version.lisp-expr index 070d26a7d..d27186c9b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.5.52" +"1.0.5.53"