Skip to content

Commit

Permalink
1.0.19.7: refactor stack allocation decisions
Browse files Browse the repository at this point in the history
 * Remove SB-C::STACK-ALLOCATE-* policies.

 * Obey DYNAMIC-EXTENT declarations if SB-EXT:*STACK-ALLOCATE-DYNAMIC-EXTENT*
   is true (the default), with the following exceptions:

    ** Value cells are not stack allocated.

    ** Vectors that may be longer then a single page are stack
       allocated only in SAFETY 0 policies.

 * New declaration: SB-INT:TRULY-DYNAMIC-EXTENT. Always stack-allocates,
   regardless of SB-EXT:*STACK-ALLOCATE-DYNAMIC-EXTENT*. Also causes stack
   allocation of value cells and potentially large vectors.

   Used exclusively inside SBCL.

 * Move STACK-ALLOCATE-RESULT optimizers from backends to
   src/compiler/generic/vm-ir2tran.lisp.

 * Documentation.
  • Loading branch information
nikodemus committed Jul 30, 2008
1 parent 451d6e4 commit 6822034
Show file tree
Hide file tree
Showing 45 changed files with 478 additions and 569 deletions.
15 changes: 7 additions & 8 deletions BUGS
Expand Up @@ -1805,27 +1805,26 @@ WORKAROUND:

419: stack-allocated indirect closure variables are not popped

(locally (declare (optimize sb-c::stack-allocate-dynamic-extent
sb-c::stack-allocate-value-cells))
(defun bug419 (x)
(multiple-value-call #'list
(eval '(values 1 2 3))
(let ((x x))
(declare (dynamic-extent x))
(declare (sb-int:truly-dynamic-extent x))
(flet ((mget (y)
(+ x y))
(mset (z)
(incf x z)))
(declare (dynamic-extent #'mget #'mset))
((lambda (f g) (eval `(progn ,f ,g (values 4 5 6)))) #'mget #'mset))))))
((lambda (f g) (eval `(progn ,f ,g (values 4 5 6)))) #'mget #'mset)))))

(ASSERT (EQUAL (BUG419 42) '(1 2 3 4 5 6))) => failure

Note: as of SBCL 1.0.26.29 this bug no longer affects user code, as
SB-C::STACK-ALLOCATE-VALUE-CELLS needs to be explicitly turned on for
that to happen. Proper fix for this bug requires (Nikodemus thinks)
storing the relevant LAMBDA-VARs in a :DYNAMIC-EXTENT cleanup, and
teaching stack analysis how to deal with them.
SB-INT:TRULY-DYNAMIC-EXTENT needs to be used instead of
DYNAMIC-EXTENT for this to happen. Proper fix for this bug requires
(Nikodemus thinks) storing the relevant LAMBDA-VARs in a
:DYNAMIC-EXTENT cleanup, and teaching stack analysis how to deal
with them.

421: READ-CHAR-NO-HANG misbehaviour on Windows Console:

Expand Down
4 changes: 4 additions & 0 deletions NEWS
@@ -1,5 +1,9 @@
;;;; -*- coding: utf-8; -*-
changes in sbcl-1.0.20 relative to 1.0.19:
* minor incompatible change: OPTIMIZE qualities
SB-C::STACK-ALLOCATE-DYNAMIC-EXTENT, SB-C::STACK-ALLOCATE-VECTOR,
and SB-C::STACK-ALLOCATE-VALUE-CELLS no longer exist. See documentation
and SB-EXT:*STACK-ALLOCATE-DYNAMIC-EXTENT* for details.
* bug fix: fixed #427: unused local aliens no longer cause compiler
breakage. (reported by Stelian Ionescu, Andy Hefner and Stanislaw
Halik)
Expand Down
1 change: 1 addition & 0 deletions build-order.lisp-expr
Expand Up @@ -35,6 +35,7 @@
(
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; miscellaneous
("src/code/cross-early" :not-target)

;; This comes early because it's useful for debugging everywhere.
("src/code/show")
Expand Down

0 comments on commit 6822034

Please sign in to comment.