X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fltn.lisp;h=619ebbc0d9e537b6eea2543b1ae9d167dc2214bd;hb=69d60b456b07a0256f08df0d02484f361ce5737c;hp=9eaa71fdedeb10a0190c8e1513611a0f94f4f704;hpb=7c8658966e98e90b189de333810cb54fed621ed7;p=sbcl.git diff --git a/src/compiler/ltn.lisp b/src/compiler/ltn.lisp index 9eaa71f..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. @@ -100,7 +111,6 @@ (setf (ir2-lvar-kind info) :delayed)) (t (let ((tn (make-normal-tn (ir2-lvar-primitive-type info)))) (setf (ir2-lvar-locs info) (list tn)) - #!+stack-grows-downward-not-upward (when (lvar-dynamic-extent lvar) (setf (ir2-lvar-stack-pointer info) (make-stack-pointer-tn))))))) @@ -230,7 +240,6 @@ (setf (lvar-info lvar) info) (when (lvar-dynamic-extent lvar) (aver (proper-list-of-length-p types 1)) - #!+stack-grows-downward-not-upward (setf (ir2-lvar-stack-pointer info) (make-stack-pointer-tn)))) (ltn-annotate-casts lvar) @@ -824,7 +833,7 @@ (when (and (cast-type-check cast) (not (node-lvar cast))) ;; FIXME - (bug "IR2 type checking of unused values in not implemented.") + (bug "IR2 type checking of unused values is not implemented.") ) (values))