From 4efea787459155c6cf5bef6ca770b7483bb1527a Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 28 Jun 2005 14:56:11 +0000 Subject: [PATCH] 0.9.2.4: Permit specialized arrays to be placed in a function's constant vector, enabling faster access (important in, e.g., table-driven crypto algorithms). --- src/compiler/ltn.lisp | 19 +++++++++++++++---- version.lisp-expr | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/compiler/ltn.lisp b/src/compiler/ltn.lisp index 7d12edb..619ebbc 100644 --- a/src/compiler/ltn.lisp +++ b/src/compiler/ltn.lisp @@ -67,13 +67,24 @@ ;;; Return true if a constant LEAF is of a type which we can legally ;;; directly reference in code. Named constants with arbitrary pointer ;;; values cannot, since we must preserve EQLness. +;;; +;;; FIXME: why not? The values in a function's constant vector are +;;; subject to being moved by the garbage collector. Having arbitrary +;;; values in said vector doesn't seem like a problem. (defun legal-immediate-constant-p (leaf) (declare (type constant leaf)) (or (not (leaf-has-source-name-p leaf)) - (typecase (constant-value leaf) - ((or number character) t) - (symbol (symbol-package (constant-value leaf))) - (t nil)))) + ;; Specialized arrays are legal, too. KLUDGE: this would be + ;; *much* cleaner if SIMPLE-UNBOXED-ARRAY was defined on the host. + #.(loop for saetp across sb!vm:*specialized-array-element-type-properties* + unless (eq t (sb!vm:saetp-specifier saetp)) + collect `((simple-array ,(sb!vm:saetp-specifier saetp) (*)) t) into cases + finally (return + `(typecase (constant-value leaf) + ((or number character) t) + (symbol (symbol-package (constant-value leaf))) + ,@cases + (t nil)))))) ;;; If LVAR is used only by a REF to a leaf that can be delayed, then ;;; return the leaf, otherwise return NIL. diff --git a/version.lisp-expr b/version.lisp-expr index 67b0c76..9bd51c8 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".) -"0.9.2.3" +"0.9.2.4" -- 1.7.10.4