0.7.13.23:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 11 Mar 2003 10:14:12 +0000 (10:14 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 11 Mar 2003 10:14:12 +0000 (10:14 +0000)
Add forgotten generic/array.lisp holding definitions of (ARRAY
NIL) handling (thanks to APD for noting my oversight)

src/compiler/generic/array.lisp [new file with mode: 0644]
version.lisp-expr

diff --git a/src/compiler/generic/array.lisp b/src/compiler/generic/array.lisp
new file mode 100644 (file)
index 0000000..6d79907
--- /dev/null
@@ -0,0 +1,53 @@
+;;;; generic array operations
+
+;;;; 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")
+\f
+;;; (ARRAY NIL) stuff looks the same on all platforms
+(define-vop (data-vector-ref/simple-array-nil)
+  (:translate data-vector-ref)
+  (:policy :fast-safe)
+  (:args (object :scs (descriptor-reg))
+        (index :scs (unsigned-reg)))
+  (:arg-types simple-array-nil positive-fixnum)
+  (:results (value :scs (descriptor-reg)))
+  (:result-types *)
+  (:vop-var vop)
+  (:save-p :compute-only)
+  (:generator 1
+    (error-call vop nil-array-accessed-error object)))
+
+;;; It shouldn't be possible to fall through to here in normal user
+;;; code, as the system is smart enough to deduce that there must be
+;;; an error upstream, as there are no objects of type NIL that can be
+;;; stored in this data vector; however, just in case, we provide this
+;;; translation, so that
+;;;   (LOCALLY
+;;;     (DECLARE (TYPE (SIMPLE-ARRAY NIL (*)) X)
+;;;              (OPTIMIZE (SPEED 3) (SAFETY 0)))
+;;;     (SB-KERNEL:DATA-VECTOR-SET X 3 'FOO))
+;;; signals the right kind of error.
+(define-vop (data-vector-set/simple-array-nil)
+  (:translate data-vector-set)
+  (:policy :fast-safe)
+  (:args (object :scs (descriptor-reg))
+        (index :scs (unsigned-reg))
+        (value :scs (descriptor-reg)))
+  (:arg-types simple-array-nil positive-fixnum *)
+  (:results (value :scs (descriptor-reg)))
+  (:result-types *)
+  (:vop-var vop)
+  (:save-p :compute-only)
+  (:generator 1
+    (error-call vop nil-array-accessed-error object)))
+\f
+;;; FIXME: There is probably plenty of other array stuff that looks
+;;; the same or similar enough to be genericized.  Do so, and move it
+;;; here so that a new port doesn't need to do as much work.
index 4995ac4..584b86f 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.13.22"
+"0.7.13.23"