Larry D'Anna | 1 Jul 10:11 2009

[PATCH 2/5] sb-cltl2: add support for (declaration-information 'declaration)

(declaration-information 'declaration) returns a list of declaration names that
have been proclaimed as valid.

Signed-off-by: Larry D'Anna <larry <at> elder-gods.org>
---
 contrib/sb-cltl2/env.lisp   |   12 +++++++++++-
 contrib/sb-cltl2/tests.lisp |    7 +++++++
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp
index 652a72f..469d567 100644
--- a/contrib/sb-cltl2/env.lisp
+++ b/contrib/sb-cltl2/env.lisp
 <at>  <at>  -8,7 +8,6  <at>  <at> 
 (in-package :sb-cltl2)

 #| TODO:
-declaration-information
 augment-environment
 define-declaration
 (map-environment)
 <at>  <at>  -228,6 +227,9  <at>  <at>  appear with CDR as T if the variable has been declared always bound."
    If DECLARATION-NAME is optimize return a list who's entries
       are of the form (quality value).

+   If DECLARATION-NAME is declaration returns a list of declaration names
+      that have been proclaimed as valid.
+
    If DECLARATION-NAME is sb-ext:muffle-conditions return a type specifier
       for the condition types that have been muffled.
(Continue reading)

Larry D'Anna | 1 Jul 10:11 2009

[PATCH 3/5] implement sb-cltl2:augment-environment

This patch implements sb-cltl2:augment-environment, a function that the user
can call from a macro to add information to a lexical environment.

This patch also changes the behavior of variable-information and
function-information so they use the type from leaf-type, without regard to if
leaf-where-from is :declared.  The method that augment-environment uses to parse
declarations will sometimes record type of a functions with leaf-where-from =
:defined instead of :declared.  leaf-type is always a ctype, and it's always a
type that the values of the leaf must be a member of, so as far as I can tell
this change is correct.

Signed-off-by: Larry D'Anna <larry <at> elder-gods.org>
---
 contrib/sb-cltl2/env.lisp   |   97 +++++++++++++++++++++++++++---
 contrib/sb-cltl2/tests.lisp |  139 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 226 insertions(+), 10 deletions(-)

diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp
index 469d567..93ee72e 100644
--- a/contrib/sb-cltl2/env.lisp
+++ b/contrib/sb-cltl2/env.lisp
 <at>  <at>  -8,11 +8,96  <at>  <at> 
 (in-package :sb-cltl2)

 #| TODO:
-augment-environment
 define-declaration
 (map-environment)
 |#

(Continue reading)

Larry D'Anna | 1 Jul 10:11 2009

[PATCH 5/5] make sb-cltl2:variable-information aware of alien variables

variable-information will return :alien for variables
defined with sb-alien:define-alien-variable.

Signed-off-by: Larry D'Anna <larry <at> elder-gods.org>
---
 contrib/sb-cltl2/env.lisp   |    5 ++++-
 contrib/sb-cltl2/tests.lisp |    5 +++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp
index 07cd926..8504fff 100644
--- a/contrib/sb-cltl2/env.lisp
+++ b/contrib/sb-cltl2/env.lisp
 <at>  <at>  -229,7 +229,7  <at>  <at>  CARS of the alist include:

 (declaim (ftype (sfunction
                  (symbol &optional (or null lexenv))
-                 (values (member nil :special :lexical :symbol-macro :constant :global)
+                 (values (member nil :special :lexical :symbol-macro :constant :global :alien)
                          boolean
                          list))
                 variable-information))
 <at>  <at>  -259,6 +259,9  <at>  <at>  binding:
   :GLOBAL
     NAME refers to a global variable. (SBCL specific extension.)

+  :ALIEN
+    NAME refers to an alien variable. (SBCL specific extension.)
+
 The second value is true if NAME is bound locally. This is currently
(Continue reading)

Larry D'Anna | 1 Jul 10:11 2009

[PATCH 1/5] add docstrings to some functions in sb-cltl2, etc

Adds docstrings for declaration-information, parse-macro and enclose.
Renames a test for variable-information that had the same name as another.

Signed-off-by: Larry D'Anna <larry <at> elder-gods.org>
---
 contrib/sb-cltl2/env.lisp   |   18 ++++++++++++++++++
 contrib/sb-cltl2/tests.lisp |    2 +-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp
index dd9efd5..652a72f 100644
--- a/contrib/sb-cltl2/env.lisp
+++ b/contrib/sb-cltl2/env.lisp
 <at>  <at>  -223,6 +223,15  <at>  <at>  appear with CDR as T if the variable has been declared always bound."
 (declaim (ftype (sfunction (symbol &optional (or null lexenv)) t)
                 declaration-information))
 (defun declaration-information (declaration-name &optional env)
+  "Return information about declarations named by DECLARATION-NAME.
+
+   If DECLARATION-NAME is optimize return a list who's entries
+      are of the form (quality value).
+
+   If DECLARATION-NAME is sb-ext:muffle-conditions return a type specifier
+      for the condition types that have been muffled.
+
+  "
   (let ((env (or env (make-null-lexenv))))
     (case declaration-name
       (optimize
 <at>  <at>  -239,6 +248,10  <at>  <at>  appear with CDR as T if the variable has been declared always bound."
(Continue reading)

Larry D'Anna | 1 Jul 10:09 2009

[PATCH 0/5] sb-cltl2 improvements version 3


Differences since the last version: 

* comments fixed

* augment-environment now calls process-decls to deal with decls and handles
  everything else itself.

* variable-information and function-information made a little more liberal with
  types (see the commit message for the augment-environment patch)

* added a few more tests

* define-declaration now attaches declarations to bindings, not names.  So if 
  (mydecl x) is a user-defined variable declaration on x, then in

  (let (x)
    (declare (mydecl x))
      (let (x)
          ....))

  (mydecl x) will only attach to the outer binding.

------------------------------------------------------------------------------
Larry D'Anna | 1 Jul 10:11 2009

[PATCH 4/5] sb-cltl2: implemnt define-declaration

define-declaration lets the user define handlers for their own declarations
types.

Signed-off-by: Larry D'Anna <larry <at> elder-gods.org>
---
 contrib/sb-cltl2/env.lisp   |  113 +++++++++++++++++++-
 contrib/sb-cltl2/tests.lisp |  243 +++++++++++++++++++++++++++++++++++++++++++
 src/code/full-eval.lisp     |    6 +-
 src/compiler/globaldb.lisp  |    4 +
 src/compiler/ir1tran.lisp   |    5 +-
 src/compiler/ir1util.lisp   |   12 ++-
 src/compiler/lexenv.lisp    |    8 +-
 7 files changed, 378 insertions(+), 13 deletions(-)

diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp
index 93ee72e..07cd926 100644
--- a/contrib/sb-cltl2/env.lisp
+++ b/contrib/sb-cltl2/env.lisp
 <at>  <at>  -8,7 +8,6  <at>  <at> 
 (in-package :sb-cltl2)

 #| TODO:
-define-declaration
 (map-environment)
 |#

 <at>  <at>  -98,6 +97,42  <at>  <at>  define-declaration

     env))

(Continue reading)

Nikodemus Siivola | 1 Jul 12:16 2009
Picon

Re: [Sbcl-bugs] Slow compilation

2009/6/30 Stephen Westfold <westfold <at> kestrel.edu>:
> I tried building 1.0.29.54.rc1 from the tar file Nikodemus Siivola
> linked to this morning, and tried compiling and running our Specware
> system. The good news is that everything worked. The bad news is that
> the time and space to compile Specware is so large as to make it
> effectively unusable. In fact I couldn't make --dynamic-space-size

Stephen sent me an SB-SPROF output from the build, and I was able to
track this down to the new set implementation used by constraint
propagation: switching back to the old SSET based implementation using
the following patch takes the compile-times below those of 1.0.23.
(Kudos to Richard for having an SSET based implementation commented
out in the source.)

I believe this is mostly due netter big-Oh characteristics on sparse sets.

Cheers,

 -- Nikodemus

diff --git a/src/compiler/constraint.lisp b/src/compiler/constraint.lisp
index 5a4c627..c08d8c7 100644
--- a/src/compiler/constraint.lisp
+++ b/src/compiler/constraint.lisp
 <at>  <at>  -96,7 +96,6  <at>  <at> 
 ;;; for constraint propagation, or if bit-vectors on some XC host
 ;;; really lose compared to SSETs, here's the conset API as a wrapper
 ;;; around SSETs:
-#+nil
 (progn
(Continue reading)

Leslie P. Polzer | 1 Jul 17:00 2009
Picon

[PATCH] SB-GROVEL: fix padding name

The use of a random GENTEMP symbol in MK-PADDING prevents
proper recompilation of packages using SB-GROVEL.

Example:

(dotimes (i 2)
  (asdf:oos 'asdf:load-op :sb-posix :force t))

will fail with at least one error of the form:

; caught ERROR:
;   (during macroexpansion of (DEFINE-ALIEN-TYPE ALIEN-TERMIOS ...))
;   Incompatible alien record type definition
;   Old: (STRUCT ALIEN-TERMIOS (IFLAG (UNSIGNED 32)) (OFLAG (UNSIGNED 32))
;         (CFLAG (UNSIGNED 32)) (LFLAG (UNSIGNED 32))
;         (PADDING13 (ARRAY (SIGNED 8) 1)) (CC (ARRAY (UNSIGNED 8) 32))
;         (PADDING14 (ARRAY (SIGNED 8) 11)))
;   New: (STRUCT ALIEN-TERMIOS (IFLAG (UNSIGNED 32)) (OFLAG (UNSIGNED 32))
;         (CFLAG (UNSIGNED 32)) (LFLAG (UNSIGNED 32))
;         (PADDING29 (ARRAY (SIGNED 8) 1)) (CC (ARRAY (UNSIGNED 8) 32))
;         (PADDING30 (ARRAY (SIGNED 8) 11)))

Mind the sole difference in the PADDINGxx atoms.

The attached patch uses a predictable INTERN call in place of
the GENTEMP in MK-PADDING.

  Leslie

--

-- 
(Continue reading)

Paul Khuong | 2 Jul 17:42 2009
Picon

Project to get one's feet wet in SBCL

Good morning.

  I started this list of projects for a friend. I think a good  
introductory project should have easily measurable impact, even  
without a complete patch, and not require to grasp too much of the  
system *at once* to get traction. I didn't worry too much about domain- 
specific difficulty, since said friend is in PLT (more theory than  
implementation, but that's still fixable ;) If you have more ideas, do  
reply. If you're interested in doing one of the following, I don't  
think help will be hard to come by.

Here's my completely unordered list (no implicit gradient of  
difficulty or logical grouping, it's in the order I thought it up):

1. Peephole, either at the virtual-operation or assembly -level would  
be cool. I only have the draft of a skeleton ready for either.

2. We've recently been informed of some performance problems in an  
internal data structure used to represent set of constraints (that are  
known to be true at a certain program point). We used to use hash  
tables but switched to something bit-vector--based, and there seems to  
be serious performance regressions on some inputs. The interface is  
very well (modularly) defined and explained.

3. SSE intrinsics are coming to x86-64 soon. It should be fun to  
rewrite some block (mostly sequence-oriented) operations to exploit  
these.

4. Port SSE (floats and intrinsics) to x86.

(Continue reading)

Helmut Eller | 2 Jul 18:18 2009
Picon

Re: Project to get one's feet wet in SBCL

* Paul Khuong [2009-07-02 17:42+0200] writes:

> Good morning.
>
>   I started this list of projects for a friend. I think a good  
> introductory project should have easily measurable impact, even  
> without a complete patch, and not require to grasp too much of the  
> system *at once* to get traction. I didn't worry too much about domain- 
> specific difficulty, since said friend is in PLT (more theory than  
> implementation, but that's still fixable ;) If you have more ideas, do  
> reply. If you're interested in doing one of the following, I don't  
> think help will be hard to come by.

Transforming CASE to computed gotos along the lines of
http://scheme2006.cs.uchicago.edu/07-clinger.pdf would probably make a
nice project too.

Maybe some form of inline caching ala 
http://factor-language.blogspot.com/2009/05/factors-implementation-of-polymorphic.html
could be used for CASE and TYPECASE.  After all method dispatch and
case dispatch have a lot in common.

Helmut

------------------------------------------------------------------------------

Gmane