sbcl.git
12 years agolinux: Enable :SB-FUTEX by default on PPC.
Alastair Bridgewater [Tue, 22 Nov 2011 15:32:56 +0000 (10:32 -0500)]
linux: Enable :SB-FUTEX by default on PPC.

  * Prior to the great de-lutexification, we used futexes on
threaded Linux/PPC.  Not having them enabled on PPC was an
oversight, but one which highlighted some problems with the
non-futex threading code.  Now that that's fixed, we may as
well restore the status quo.

12 years agosmaller default dynamic-space size on GENCGC
Nikodemus Siivola [Mon, 21 Nov 2011 14:53:17 +0000 (16:53 +0200)]
smaller default dynamic-space size on GENCGC

 512Mb for 32-bit platforms, 1Gb for 64-bit ones.

 (OpenBSD/x86-64 is the exception using 444Mb to fit under default ulimits.)

12 years agomake --dynamic-space-size and --control-stack-size understand power-suffixes
Nikodemus Siivola [Mon, 21 Nov 2011 13:52:31 +0000 (15:52 +0200)]
make --dynamic-space-size and --control-stack-size understand power-suffixes

  All of Kb, KiB, Mb, MiB, Gb, GiB are accepted, in a case-insentitive manner
  -- all taken to mean powers of two.

12 years agofix Darwin/x86 build on Snow Leopard
Nikodemus Siivola [Mon, 21 Nov 2011 15:50:56 +0000 (17:50 +0200)]
fix Darwin/x86 build on Snow Leopard

  EBX is linkage base, hence unavailable for us via asm()
  there.

12 years agoRevert "fix sb-posix tests on OpenBSD"
Nikodemus Siivola [Sun, 20 Nov 2011 18:09:39 +0000 (20:09 +0200)]
Revert "fix sb-posix tests on OpenBSD"

  Oops. As Josh noted, the equivalent C code works, so the explanation was
  bogus, and the test is better left enabled to track the issue.

This reverts commit d94c1b4a8c534bde146823f56558faf37cd4c4d7.

Conflicts:

NEWS

12 years agoMore compile-time error checking in NUMBER-DISPATCH
Lutz Euler [Fri, 1 Jul 2011 18:54:38 +0000 (20:54 +0200)]
More compile-time error checking in NUMBER-DISPATCH

Check for some problematic cases where non-disjoint types are used
in different clauses for the same variable and throw an error at
macroexpand-time if such a case is detected. Otherwise these could
lead to the generated type-dispatching form not covering all intended
combinations of types.

The intention is to make writing and modifying complex NUMBER-DISPATCH
forms safer.

All existing uses of NUMBER-DISPATCH, insofar as they contain
non-disjoint types, are unproblematic and graded as such by the
check; thus they continue to work unchanged.

Signed-off-by: Christophe Rhodes <csr21@cantab.net>

12 years agoMake EXPT use double-precision throughout in more cases
Lutz Euler [Fri, 1 Jul 2011 16:06:17 +0000 (18:06 +0200)]
Make EXPT use double-precision throughout in more cases

lp#741564 notes that a Maxima test case fails because the result of
(EXPT <fixnum> <(complex double)>) is much less precise than expected.
This is caused by EXPT using an intermediate single-float value here.

This behaviour actually occurs for all the following combinations
of argument types:

  (EXPT <(or rational single-float)> <(complex double-float)>)

  (EXPT <(or (complex rational) (complex single-float))>
        <(or (complex double-float) double-float)>)

In all these cases the first step EXPT does is to calculate (LOG BASE)
in single precision.

Refine the type dispatch clauses in EXPT to separate these cases
and coerce BASE to DOUBLE-FLOAT or (COMPLEX DOUBLE-FLOAT) there,
as appropriate, before applying LOG. Add tests.

Fixes lp#741564.

Signed-off-by: Christophe Rhodes <csr21@cantab.net>

12 years agooops, SB-EXT:DYNAMIC-SPACE-SIZE broke a test
Nikodemus Siivola [Sun, 20 Nov 2011 12:20:11 +0000 (14:20 +0200)]
oops, SB-EXT:DYNAMIC-SPACE-SIZE broke a test

 (Package lock violation.)

12 years agofix RUN-PROGRAM :WAIT T on Windows
Nikodemus Siivola [Sun, 20 Nov 2011 11:54:07 +0000 (13:54 +0200)]
fix RUN-PROGRAM :WAIT T on Windows

  Recent change to report the errno from exec() broke things on Windows.

  There when :WAIT is true it is the C code that waits, and the subsequently
  returns the exit code of the process -- meaning our attempt to use 0 to
  indicate exec() failure makes every successfull execution on Windows look
  like an exec failure.

  Oops. Use -2 instead. MORE MAGIC.

12 years agofix sb-posix tests on OpenBSD
Bruce O'Neel [Sun, 20 Nov 2011 11:09:03 +0000 (13:09 +0200)]
fix sb-posix tests on OpenBSD

  FCNTL.FLOCK.2 the test wants to check the PID of the lock holder, and,
  OpenBSD 5.0 disallows this. OpenBSD 4.9 and earlier was fine with it.

  lp#892707

Signed-off-by: Nikodemus Siivola <nikodemus@random-state.net>

12 years agofix Darwin/PPC build
Bruce O'Neel [Sun, 20 Nov 2011 11:05:01 +0000 (13:05 +0200)]
fix Darwin/PPC build

  lp#892705

Signed-off-by: Nikodemus Siivola <nikodemus@random-state.net>

12 years agonew SET-SBCL-SOURCE-LOCATION convenience function
Zach Beane [Sat, 19 Nov 2011 21:14:06 +0000 (21:14 +0000)]
new SET-SBCL-SOURCE-LOCATION convenience function

From Zach Beane sbcl-devel 2011-11-15.

Signed-off-by: Christophe Rhodes <csr21@cantab.net>

12 years agosb-bsd-sockets: fix GET-HOST-BY-NAME and -ADDRESS on unthreaded builds
Nikodemus Siivola [Sat, 19 Nov 2011 19:48:09 +0000 (21:48 +0200)]
sb-bsd-sockets: fix GET-HOST-BY-NAME and -ADDRESS on unthreaded builds

 (Platforms with getaddrinfo.)

 Broken by recent thread-safety fix for the same.

12 years agomake RESTART-FRAME debugger command at least try to restart anon frames
Nikodemus Siivola [Sat, 19 Nov 2011 16:41:39 +0000 (18:41 +0200)]
make RESTART-FRAME debugger command at least try to restart anon frames

  Try to grab the debug-fun-fun and call it.

  This /is/ an iffy proposition, though, so don't advertise it,
  and caution the user before going ahead.

12 years agobetter inner and anonymous function names
Nikodemus Siivola [Tue, 9 Aug 2011 16:05:42 +0000 (19:05 +0300)]
better inner and anonymous function names

 * New concept: "name context". It is either name of the outermost non-NIL
   block in the current lexenv (FIXME: would be better to have the outermost
   global function name instead) or the source-namestring of the file in which
   the function resides.

 * Name anonymous functions as

    (LAMBDA <lambda-list> :IN <context>)

 * Name FLET and LABELS functions as

    (FLET <name> :IN <context>)

   and

    (LABELS <name> :IN <context>)

   Adjust tests to suit.

 * Remove BLOCK-GENSYM as this fulfills the same goals, and together
   they make backtraces overly noisy.

12 years agoclarify GET-CAS-EXPANSION docstring
Nikodemus Siivola [Sat, 19 Nov 2011 15:00:57 +0000 (17:00 +0200)]
clarify GET-CAS-EXPANSION docstring

12 years agoGC documentation tweaks
Nikodemus Siivola [Sat, 19 Nov 2011 14:39:59 +0000 (16:39 +0200)]
GC documentation tweaks

  * Fold documentation of (SETF GC-LOGFILE) into that of GC-LOGFILE.

  * Document default value of GENERATION-NUMBER-OF-GCS-BEFORE-PROMOTION.

  * Order the dictionary entries in the manual's GC section more logically.
    I hope.

12 years agoexport DYNAMIC-SPACE-SIZE from SB-EXT
Nikodemus Siivola [Sat, 19 Nov 2011 14:37:03 +0000 (16:37 +0200)]
export DYNAMIC-SPACE-SIZE from SB-EXT

12 years agodefault gen.bytes_consed_between_gc to same 5% of dynamic space size
Nikodemus Siivola [Sat, 19 Nov 2011 14:35:18 +0000 (16:35 +0200)]
default gen.bytes_consed_between_gc to same 5% of dynamic space size

  ...the previous default was 2,000,000 bytes, not 20Mb as the
  documentation claimed. Oops.

12 years agodefault nursery to 5% of total dynamic space size on GENCGC
Nikodemus Siivola [Sat, 19 Nov 2011 12:38:26 +0000 (14:38 +0200)]
default nursery to 5% of total dynamic space size on GENCGC

  5% seems like a reasonable compromise between latency and throughput.

  Also change a few related stray size_t types to os_vm_size_t, which
  necessitates moving runtime options saving bits into their own header file.

12 years agounsigned long -> os_vm_size_t refactoring
Nikodemus Siivola [Sat, 19 Nov 2011 12:16:47 +0000 (14:16 +0200)]
unsigned long -> os_vm_size_t refactoring

 Replace a number of GC related unsigned longs with os_vm_size_t, make it
 available in on the lisp-side as well, and use where appropriate.

 Makes BYTES-CONSED-BETWEEN-GCS and its SETF-version also support large
 nurseries.

12 years agothreading NEWS, and thanks to supporters
Nikodemus Siivola [Fri, 18 Nov 2011 19:08:16 +0000 (21:08 +0200)]
threading NEWS, and thanks to supporters

  Update NEWS with the recent threading work.

  Many thanks to all the IndieGoGo donors who have made these improvements --
  and more to come -- possible.

     www.indiegogo.com/SBCL-Threading-Improvements-1

  In addition some 80 donors who didn't choose any perks at all, or were
  content with a warm and fuzzy feeling, thanks are owed to:

    Abhishek Reddy
    Alexander Shendi
    Alexander Skobelev
    Alexandre Abreu
    Andreas Franke
    Andreas Fredriksson
    Andreas Fuchs
    AntonVodonosov
    Arnaud Betremieux
    Atte Hinkka
    Austin Haas
    Benjamin Tovar
    Bong Munoz
    Bozhidar Batsov
    Brandon Werner
    Brit Butler
    Bruce O'Neel
    CHIBA Masaomi
    Carl Gay
    Chad
    Chaitanya Gupta
    Charlie McMackin
    Christian Walther
    Copyleft Solutions
    Cyrus Harmon
    Dan Ballard
    Daniel Collin
    Danny Woods
    Dave Newton
    David BIltcliffe
    David Lamkins
    Eric Blossom
    Erik Winkels
    Francisco Vides Fernández
    Gabriel Giovannetti
    Gary Klimowicz
    Gary Waters
    Geir Tjørhom
    Gene Diveglia
    Geoff Cant
    Geoff Wozniak
    Hans Huebner
    Hein Hermans
    Henri Kyrki
    Henry Lenzi
    Heow Goodman
    Hiroyuki Tokunaga
    Ivan Boldyrev
    Ivan Rocha
    Ivan Shvedunov
    James Wright
    Jan Moringen
    Jeff Palmucci
    Jerry Errett
    Johannes Grødem
    Jonathan Smith
    Jorge Gajon
    Joseph Iacobucci
    Josh Marchan
    José Antonio Ortega Ruiz
    Jovanovic Milan
    Jānis Džeriņš
    Kamil Shakirov
    Kan-Ru Chen
    Karsten Poeck
    Kevin Raison
    Kim Minh Kaplan
    Lars Brinkhoff
    Lee Hinman
    Leslie Polzer
    Liam Healy
    Lin Wen Chun
    Luke Crook
    Luís Oliveira
    Manabu Takayama
    Mark Hepburn
    Martin Muggli
    Masatoshi SANO
    Mason Smith
    Mathias Dhuicq
    Mathias Hellevang
    Matthew Curry
    Matthew Swank
    Matthias Hölzl
    Michael Kuijn
    Milo McCheese
    Morten Nygaard Åsnes
    Natalie Masse Hooper
    Nathan Hartman
    Nicolas Neuss
    Nikolaus Demmel
    Norman Jaffe
    Ole Arndt
    Paul Nathan
    Petter Egesund
    Philippe Brochard
    Piotr Esden-Tempski
    Reuben Cornel
    Rich Hickey
    Robert Postill
    Robert Smith
    RobertSanders
    Ryan Pavlik
    Sean Bryant
    Seth Carbon
    Seth Ladygo
    Slawek Zak
    Slobodan Milnović
    Stephen Balousek
    Steve Carney
    Tim Howe
    Tim Ritchey
    Tim Showalter
    Timo Myyrä
    Todd Alan Kurtz
    View Software Services Ltd / P Baccou
    Vincent Manis
    Vsevolod Domkin
    William Hay
    Wukix Inc.
    Xristos Kalkanis
    Yoshinori Tahara
    Yousuke Ushiki
    Zach Beane
    Zach Kost-Smith
    agriff
    cpc26
    esologic
    gabalz
    hexstream
    indiegogo87
    lokedhs
    mcturra2000
    serjkl
    tim67
    vsedach
    zellerin

12 years agouserspace CONDITION-WAIT and interrupts
Nikodemus Siivola [Fri, 18 Nov 2011 18:05:38 +0000 (20:05 +0200)]
userspace CONDITION-WAIT and interrupts

  GC and signals cause WITHOUT-THREAD-WAITING-FOR to mark the thread as
  temporarily not waiting for anything, restoring the old status on unwind.

  This is fine for mutex deadlock detection, but now that the same slot is
  used for userspace condition variable wakeups we end up in trouble:

   T1: enqueue self on waitqueue, marked as waiting on it.

   T1: receives an interrupt and is marked as not waiting anymore while the
       interrupt is handled.

   T2: delivers a wakeup to the queue, sees T1 as not waiting anymore and
       drops it from the queue.

   T1: resumes waiting, but isn't on the queue, and never receives a wakeup.

       Extra Bonus:

       If T1 times out or unwinds for any reason, it sees itself as not having
       been woken up, and with interrupts disabled tries to unqueue itself
       from the queue -- ending up in an uninterruptible endless loop.

  The Fix:

    WITHOUT-THREAD-WAITING-FOR no longer restores the waiting-for information
    for waitqueues, effectively causing a bogus wakeup.

12 years agosb-bsd-sockets: gethostbyname and gethostbyaddr are not thread safe
Nikodemus Siivola [Fri, 18 Nov 2011 14:37:20 +0000 (16:37 +0200)]
sb-bsd-sockets: gethostbyname and gethostbyaddr are not thread safe

   ...or re-entrant. Need to disable interrupts and grab a lock.

   Affects only platforms without getaddrinfo.

   Correct the size of memory leak fixed in last commit in NEWS -- it
   was more than one word per call.

12 years agosb-bsd-sockets: check for MAKE-ALIEN success in GET-PROTOCOL-BY-NAME
Nikodemus Siivola [Fri, 18 Nov 2011 14:33:35 +0000 (16:33 +0200)]
sb-bsd-sockets: check for MAKE-ALIEN success in GET-PROTOCOL-BY-NAME

   Currently of malloc fails it returns a null alien.

   Yuck.

12 years agosb-bsd-sockets: GET-ADDRESS-INFO foreign memory leak
Nikodemus Siivola [Fri, 18 Nov 2011 14:21:26 +0000 (16:21 +0200)]
sb-bsd-sockets: GET-ADDRESS-INFO foreign memory leak

  Two issues:

   * We were using MAKE-ALIEN and not freeing the memory.

   * We were calling FREE-ADDRINFO, not FREEADDRINFO: the first is an
     SB-GROVEL generated deallocator, the second is freeaddrinfo()...

12 years agosmall package lock documentation cleanup
Nikodemus Siivola [Fri, 18 Nov 2011 12:53:47 +0000 (14:53 +0200)]
small package lock documentation cleanup

  "cause result in a..." Feh. Me good english yes.

  Also mention the compile-time warning for clarity.

12 years agopass errno from exec() to parent in spawn()
Nicolas Edel [Fri, 18 Nov 2011 10:49:22 +0000 (12:49 +0200)]
pass errno from exec() to parent in spawn()

  Open a pipe, set FD_CLOEXEC.

  Child: if exec() fails, grab errno and write it to pipe.

  Parent: try to read from the pipe -- if you get something, it means the
  child didn't exec and the reason is in the pipe. Wait for the child to exit
  and return -1 and set errno to whatever the child got.

  Also use _exit() instead of exit() when dying in the child after exec
  failure -- running exit hooks there would probably be bad.

  (Somewhat edited from Nicolas' original patch.)

Signed-off-by: Nikodemus Siivola <nikodemus@random-state.net>

12 years agosemaphore notification objects
Nikodemus Siivola [Thu, 17 Nov 2011 12:11:18 +0000 (14:11 +0200)]
semaphore notification objects

12 years agoscarier INTERRUPT-THREAD and TERMINATE-THREAD documentation
Nikodemus Siivola [Thu, 17 Nov 2011 15:06:04 +0000 (17:06 +0200)]
scarier INTERRUPT-THREAD and TERMINATE-THREAD documentation

  Try to put the fear of asynch unwinds into the reader.

12 years agomissing CAS-locks and barriers
Nikodemus Siivola [Wed, 16 Nov 2011 15:27:15 +0000 (17:27 +0200)]
missing CAS-locks and barriers

 * %WAITQUEUE-ENQUEUE was missing the CAS-lock, as was checking for
   the wakeup.

 * Put back the spin-before-yielding loop into WITH-CAS-LOCK, which
   I'd removed for some reason.

 * PPC has threads, and really needs barriers. x86oids have made me
   lazy, and now we pay the price. In particular:

   ** THREAD-WAITING-FOR: a read barrier in the non-futex
      CONDITION-WAIT -- the corresponding writes are protected
      by CAS and hence provide a write barrier already.

      ...and just for symmetry and because this makes my poor
      head hurt add write and read barriers to other places where
      it is read from / written to.

   ** WITH-CAS-LOCK: a read barrier for the READ-FORM. Not strictly
      necessary perhaps, as THREAD-YIELD most probably provides a
      barrier, but this is easier to read. Since the corresponding
      writes should use CAS, we're OK.

12 years agopthread_cond_broadcast is not asynch signal safe
Nikodemus Siivola [Mon, 7 Nov 2011 12:49:57 +0000 (14:49 +0200)]
pthread_cond_broadcast is not asynch signal safe

  AKA /less/ GC deadlocks on Darwin.

  To be specific, it can cause our GC to deadlock on Darwin, with all lisp
  threads spinning on the same global spinlock in the bowels of the
  pthread_cond_wait implementation. That was fun to figure out.

  The test (:interrupt-thread :interrupt-consing-child) is a good one
  for catching this: try to run it repeatedly under an earlier SBCL
  under Darwin, and sooner or later it will hang.

  ...with this commit, we're still using pthread_cond_broadcast, but
  blocking signals around the relevant bits, which --experimentally--
  makes the aforementioned test pass "somewhat more consistently".

  It can still hang, but those hangs seem to be related to deferrable
  signals being indefinitely blocked in one of the threads -- no idea
  as of yet why.

  Summa Summarum: this is a bit of a sorry bandaid, waiting for
  a better solution. (Probably using realtime semaphores, which
  /should/ be signal-handler safe.)

12 years agoFix typo in the man-page markup code.
Stas Boukarev [Wed, 16 Nov 2011 18:16:52 +0000 (22:16 +0400)]
Fix typo in the man-page markup code.

Patch by Kenneth Westerback on lp#891114

12 years agosb-bsd-sockets: foreign memory leak in GET-PROTOCOL-BY-NAME
Nikodemus Siivola [Wed, 16 Nov 2011 16:18:23 +0000 (18:18 +0200)]
sb-bsd-sockets: foreign memory leak in GET-PROTOCOL-BY-NAME

  I blame WITH-ALIEN usage -- it masks the MAKE-ALIEN calls
  from the casual eye.

12 years agoPlug two more CTYPE leaks into fasls
Paul Khuong [Tue, 15 Nov 2011 21:20:06 +0000 (16:20 -0500)]
Plug two more CTYPE leaks into fasls

 * (setf aref) would dump the declared element type on compile-time
   type mismatch.

 * same for function return value types (e.g. via (declare (values ...)))

12 years agoPlug a CTYPE leak into fasls via SETQ
Paul Khuong [Tue, 15 Nov 2011 16:53:50 +0000 (11:53 -0500)]
Plug a CTYPE leak into fasls via SETQ

  Type mismatch from SETQing lexical variables used to dump CTYPE
  structs directly.  Splice a type specifier in instead during
  IR1 conversion of SETQ so that the source form remains dumpable.

  Reported with the test case by Xach on #lisp.

  Fixes lp#890750.

12 years agodocument GRAB-MUTEX in the manual
Nikodemus Siivola [Mon, 14 Nov 2011 14:18:41 +0000 (16:18 +0200)]
document GRAB-MUTEX in the manual

 lp#884099

12 years agosymlinks and RENAME-FILE and DELETE-DIRECTORY
Nikodemus Siivola [Mon, 14 Nov 2011 12:56:00 +0000 (14:56 +0200)]
symlinks and RENAME-FILE and DELETE-DIRECTORY

 Both followed symlinks too eagerly.

  * Presumably anyone doing (rename-file "link-to-foo" "bar") wants to rename
    the link and not the file it points to -- which has the unpleasant
    side-effect of breaking the selfsame link.

    Make it so.

 * It is less clear what someone doing (delete-directory "link-to-dir")
   expects to happen -- so take the conservative option and signal an error,
   and document this.

12 years agosb-concurrency: GATE tweak, fix building without threads
Nikodemus Siivola [Mon, 14 Nov 2011 13:56:09 +0000 (15:56 +0200)]
sb-concurrency: GATE tweak, fix building without threads

 * OPEN-GATE wasn't interrupt-safe. Don't want to have an interrupt unwind
   after opening the gate but before broadcasting on the condition variable.

 * Disable tests needing threads on unithread builds, add one that
   doesn't need threads.

 Also: many thanks to Tobias Rittweiler on whose code the GATE implementation
 is based!

12 years agosb-concurrency: add Allegro-style gate objects
Nikodemus Siivola [Mon, 14 Nov 2011 10:17:27 +0000 (12:17 +0200)]
sb-concurrency: add Allegro-style gate objects

12 years agoMore numerically stable %hypot (ABS of complex floats) on win32
Paul Khuong [Sun, 13 Nov 2011 20:00:21 +0000 (15:00 -0500)]
More numerically stable %hypot (ABS of complex floats) on win32

Based on a patch by Robert Smith.

12 years agoextensible CAS and CAS extensions
Nikodemus Siivola [Wed, 8 Jun 2011 07:58:59 +0000 (10:58 +0300)]
extensible CAS and CAS extensions

  DEFINE-CAS-EXPANDER and DEFCAS are analogous to DEFINE-SETF-EXPANDER and
  DEFSETF, including CAS-functions similar to SETF-functions:

   (defun (cas foo) (old new ...) ...)

  THis is exported from SB-EXT for users to play with, and used to implement
  our CAS places internally.

  Add support for CAS of:

   * SLOT-VALUE

   * STANDARD-INSTANCE-ACCESS

   * FUNCALLABLE-STANDARD-INSTANCE-ACCESS

  In case of SLOT-VALUE we don't yet support any optimizations or specify
  results when SLOT-VALUE-USING-CLASS or friends are in play -- perhaps later
  we can add

    (CAS SLOT-VALUE-USING-CLASS) &co

  in order to support it for arbitrary instances.

  Adding support for permutation vector optimization should not be too hard
  either, but let's let the dust settle first...

12 years agoclean leftover SB_LUTEX gunk from the runtime
Nikodemus Siivola [Sat, 12 Nov 2011 13:09:41 +0000 (15:09 +0200)]
clean leftover SB_LUTEX gunk from the runtime

  Missed a spot...

12 years agopackage snafu on unithreaded build
Nikodemus Siivola [Fri, 11 Nov 2011 16:51:18 +0000 (18:51 +0200)]
package snafu on unithreaded build

12 years agofix out-of-line structure predicates on obsolete standard-instances
Christophe Rhodes [Fri, 11 Nov 2011 16:47:30 +0000 (16:47 +0000)]
fix out-of-line structure predicates on obsolete standard-instances

Apply the same fix to typep-to-layout that I did over five years ago
to the various inline / compiler transforms.  Include an out-of-line
test case.

12 years agoimprove layout-invalid error message
Christophe Rhodes [Fri, 11 Nov 2011 15:29:46 +0000 (15:29 +0000)]
improve layout-invalid error message

It helps if we pass the right initialization forms to make-condition.

12 years agoMake MAKE-LISP-OBJ pickier on CHENEYGC.
Alastair Bridgewater [Wed, 9 Nov 2011 17:49:28 +0000 (12:49 -0500)]
Make MAKE-LISP-OBJ pickier on CHENEYGC.

  * Move the valid_lisp_pointer_p() guts from gencgc.c to
gc-common.c, updating header files and staticness as required.
Also remove all of the debug output conditional on
gencgc_verbose (which is obviously gencgc-specific).

  * Make the lisp-side VALID-LISP-POINTER-P not-gencgc-specific.

  * Always use VALID-LISP-POINTER-P in MAKE-LISP-OBJ instead of
using some simple bounds-check on CHENEYGC.

12 years agoarch-assem.S: Update fun-end breakpoint magic for pickier make-lisp-obj.
Alastair Bridgewater [Wed, 9 Nov 2011 17:30:40 +0000 (12:30 -0500)]
arch-assem.S: Update fun-end breakpoint magic for pickier make-lisp-obj.

  * We're about to cause SB-KERNEL:MAKE-LISP-OBJ to use the same
validation on CHENEYGC as it always has on GENCGC.

  * In order to not break function-end breakpoints, update them
all now to have the same header structure as on PPC (which had
to be made to work on GENCGC some time back).

  * While we're here, add a comment to each copy pointing to the
PPC version as having an actual explanation for the magic.

  * And update the PPC version commentary to the soon-to-be
reality of MAKE-LISP-OBJ always verifying pointers, instead of
only verifying pointers on GENCGC.

  * Finally, remove the no-longer-necessary code in debug-int
that set the header value, leaving a historic-information
comment behind.

12 years agogencgc: Make MAKE-LISP-OBJ of SIMPLE-FUN object addresses work.
Alastair Bridgewater [Wed, 9 Nov 2011 16:48:19 +0000 (11:48 -0500)]
gencgc: Make MAKE-LISP-OBJ of SIMPLE-FUN object addresses work.

  * This turned out to be a bug in the gencgc guts,
looks_like_valid_lisp_pointer_p() was doing pointer arithmetic
when it should have been converting the pointer to an integer.

12 years agofix unthreaded build
Nikodemus Siivola [Thu, 10 Nov 2011 17:09:37 +0000 (19:09 +0200)]
fix unthreaded build

  CONDITION-WAIT on threadless builds now reads TIMEOUT.

  Stray MUTEX/LOCK naming confusion.

  #+sb-thread on more mailbox test.

  #!+sb-thread %WAIT-FOR-MUTEX for cleanliness.

12 years agoSPINLOCK-NAME not deprecated since 1.0.5.x, but 1.0.53.11...
Nikodemus Siivola [Thu, 10 Nov 2011 15:18:22 +0000 (17:18 +0200)]
SPINLOCK-NAME not deprecated since 1.0.5.x, but 1.0.53.11...

12 years agotweak threads.impure.lisp tests
Nikodemus Siivola [Thu, 10 Nov 2011 14:08:55 +0000 (16:08 +0200)]
tweak threads.impure.lisp tests

 * Enable (:CONDITION-WAIT :DEADLINES :LP-512914) outside futex platforms.

 * Mark :BACKTRACE as broken on Darwin after all, still.

12 years agouse RELATIVE-DECODED-TIMES in serve-event
Nikodemus Siivola [Thu, 10 Nov 2011 14:06:19 +0000 (16:06 +0200)]
use RELATIVE-DECODED-TIMES in serve-event

 OAOO, yum.

12 years agounify locks
Nikodemus Siivola [Tue, 23 Aug 2011 12:50:04 +0000 (15:50 +0300)]
unify locks

  Remove spinlocks, make spinlock functions redirect to mutexes
  instead. (Compile-time deprecation style-warning for spinlocks.)

12 years agoAdjust for Solaris /bin/sh.
Jim Wise [Thu, 10 Nov 2011 15:05:43 +0000 (10:05 -0500)]
Adjust for Solaris /bin/sh.

12 years agotimeouts on JOIN-THREAD
Nikodemus Siivola [Thu, 10 Nov 2011 13:05:16 +0000 (15:05 +0200)]
timeouts on JOIN-THREAD

   Marking the return convention experimental for now, as I'm
   not sure if

   ...we should signal a separate condition type for timeouts.

   ...we should have a separate :TIMEOUT-VALUE argument.

   ...if that value should default to value of DEFAULT.

   Pfff. Interfaces are hard -- let's go shopping!

12 years agotimeouts on semaphores and mailboxes, fix timeouts on condition variables
Nikodemus Siivola [Thu, 10 Nov 2011 09:27:15 +0000 (11:27 +0200)]
timeouts on semaphores and mailboxes, fix timeouts on condition variables

  * Accidentally put in the version of condition variable timeouts that just
    looked like a spurious wakeup instead of returning NIL without grabbing
    the mutex. Ooops -- fixed that.

  * The issue with mailbox tests on Darwin at least appears to be related
    to our usage of pthread functions inside signal handlers.

12 years agomake it possible to build only selected contribs
Nikodemus Siivola [Thu, 10 Nov 2011 11:23:51 +0000 (13:23 +0200)]
make it possible to build only selected contribs

  Not for users as such, but for poking at specific contribs with a faster
  turnaround.

12 years agoAt least one of the Tests which hang on Darwin also hang on SunOS.
Jim Wise [Thu, 10 Nov 2011 03:25:19 +0000 (22:25 -0500)]
At least one of the Tests which hang on Darwin also hang on SunOS.

Make (not (or darwin sunos)) for the moment, and I'll tey to narrow this
down tomorrow.

sb-concurrency otherwise builds and tests great with new thread stuff on
Solaris/X86 -- on to ../../tests!

12 years agokilling lutexes, adding timeouts
Nikodemus Siivola [Tue, 16 Aug 2011 19:46:06 +0000 (22:46 +0300)]
killing lutexes, adding timeouts

  * Remove all lutex-specific code from the system.
    ** Use SB-FUTEX for futex-capable platforms, and plain SB-THREAD
       otherwise.
    ** Make non-futex mutexes unfair spinlocks for now, using WAIT-FOR to
       provide timeouts and backoff.
    ** Build non-futex condition variables on top of a queue and WAIT-FOR.

    Performance implications: SB-FUTEX builds should perform pretty much the
    same, or improve a bit. Threaded non-futex builds are affected as follows:

      1. Threads idling on semaphores or condition variables aren't quite as
         cheap. Just how costly depends on the OS. On Darwin 1000 idle threads
         can chew up a bit over 50% CPU. I will try to address this later.

      2. Contested locking around operations that take considerably longer
         than a single timeslice suffers mild degradation.

      3. Contested locking around operations that don't take long is an order
         of magnitude performant.

      4. Highly active semaphores perform much better. (Follows from #3.)

  * GRAB-MUTEX gets timeout support on all platforms.

  * CONDITION-WAIT gets timeout support.

  * Disable a bunch of prone-to-hang thread tests on Darwin.  (All of them
    were already prone to hang prior to this commit.)

  * Enable a bunch tests that now /pass/ on Darwin. \o/ This doesn't mean that
    the threaded Darwin is fully expected to pass all tests yet, but let's say
    it's more likely to do so.

    ...but still not robust enough to enable threads on Darwin by default.

  * GET-MUTEX/GRAB-MUTEX get refactored into two main parts: %TRY-MUTEX and
    %WAIT-ON-MUTEX, which are also used directly from CONDITION-WAIT where
    appropriate.

12 years agoSkip testl fcntl.flock.2 on NetBSD.
Jim Wise [Wed, 9 Nov 2011 18:54:10 +0000 (13:54 -0500)]
Skip testl fcntl.flock.2 on NetBSD.
Not sure what's going on with this one -- getting a return status
of '0' from child process, but don't see a path through code that
will produce this.  Will work on this further.

12 years agoAdjust for NetBSD location of perl.
Jim Wise [Wed, 9 Nov 2011 14:18:02 +0000 (09:18 -0500)]
Adjust for NetBSD location of perl.

NetBSD does not ship with perl by default, but if it's present, it will
be in /usr/pkg/bin.  Would be nice to find another portable way to do this.

12 years agoMAP-DIRECTORY didn't :CLASSIFY-SYMLINKS by default
Nikodemus Siivola [Wed, 9 Nov 2011 11:24:54 +0000 (13:24 +0200)]
MAP-DIRECTORY didn't :CLASSIFY-SYMLINKS by default

  ...even though it said it did.

  Given

    foo/bar => ../src/bar
    src/bar/quux.asd

  now

    (directory "foo/*/*.asd")

  finds the .asd as expected.

12 years agoNetBSD also fails on test based on opening /dev/stdout from a script.
Jim Wise [Tue, 8 Nov 2011 19:48:21 +0000 (14:48 -0500)]
NetBSD also fails on test based on opening /dev/stdout from a script.

Add it to Darwin in platforms which skip this test.

12 years agoCorrect address computation in atomic-incf/aref for wide fixnums
Paul Khuong [Mon, 7 Nov 2011 19:18:38 +0000 (14:18 -0500)]
Correct address computation in atomic-incf/aref for wide fixnums

 Reported by Martin Cracauer.

 Fixes lp#887220.

12 years ago1.0.53: will be tagged as "sbcl-1.0.53"
Juho Snellman [Sun, 6 Nov 2011 20:31:00 +0000 (21:31 +0100)]
1.0.53: will be tagged as "sbcl-1.0.53"

12 years agofix SEARCH vector vector transform
Eric Marsden [Mon, 31 Oct 2011 12:34:39 +0000 (14:34 +0200)]
fix SEARCH vector vector transform

 Didn't handle empty sequences correctly.

 Didn't handle NIL as KEY correctly.

12 years agomake DELETE-FILE respect *DEFAULT-PATHNAME-DEFAULTS*
Nikodemus Siivola [Sun, 30 Oct 2011 19:51:30 +0000 (21:51 +0200)]
make DELETE-FILE respect *DEFAULT-PATHNAME-DEFAULTS*

  MERGE-PATHNAMES to get an absolute pathname. (Using TRUENAME would be wrong,
  since then we would delete files pointed to by symbolic links, and not the
  symbolic links themselves -- a nasty regression that would be!)

  Also remove the "for error checking" TRUENAME call from there: unlink will
  give us an errno that tells what we need to know -- and lo! there is one
  race condition less in the system.

  Previously using relative pathnames it was possible to accidentally delete
  the wrong file.

  Fixes lp#882877.

  NB: currently DELETE-DIRECTORY and RENAME-FILE use TRUENAME with just the
      aforementioned unfortunate consequence, but I'm hesitant to change them
      during the freeze -- so dealing with this issue in them will have to
      wait a bit.

12 years agomissing NEWS for previous commit
Nikodemus Siivola [Sun, 30 Oct 2011 19:51:02 +0000 (21:51 +0200)]
missing NEWS for previous commit

12 years agofix GENCGC DYNAMIC-USAGE on 64-bit platforms
Robert Brown [Sun, 30 Oct 2011 11:44:33 +0000 (13:44 +0200)]
fix GENCGC DYNAMIC-USAGE on 64-bit platforms

  Fixes lp#881445.

12 years agoUnbreak the build on SPARC
Paul Khuong [Sun, 30 Oct 2011 15:34:33 +0000 (11:34 -0400)]
Unbreak the build on SPARC

Broken in b2d132a93 (last commit).  The cross-compiler can be a tad
paranoid.

12 years agoFix constant character comparisons for SPARC/sb-unicode
Paul Khuong [Sun, 30 Oct 2011 06:42:15 +0000 (02:42 -0400)]
Fix constant character comparisons for SPARC/sb-unicode

SPARC only supports (SIGNED-BYTE 13) for literal values.  Only emit
comparison with literal characters up to (CODE-CHAR 4095).

Reported by Eric Marsden on sbcl-devel.

Fixes lp#883519.

12 years agoEliminate an infinite recursion in TYPE-UNION of INTERSECTION types
Paul Khuong [Sun, 30 Oct 2011 06:32:41 +0000 (02:32 -0400)]
Eliminate an infinite recursion in TYPE-UNION of INTERSECTION types

Reported by Eric Marsden on sbcl-devel.

Fixes lp#883498.

12 years agoTake inline trampoline into account when optimizing fall-through jumps
Paul Khuong [Sun, 30 Oct 2011 06:02:03 +0000 (02:02 -0400)]
Take inline trampoline into account when optimizing fall-through jumps

The IR2-level optimisation bug manifests itself as randomly bogus
code in the presence of tail and local calls to the same function.

Reported by Eric Marsden on sbcl-devel.

Test case by Anton Kovalenko.

Fixes lp#883500

12 years agofix ROTATE-BYTE on 64-bit words using constant negative rotation
Nikodemus Siivola [Sat, 29 Oct 2011 18:13:07 +0000 (21:13 +0300)]
fix ROTATE-BYTE on 64-bit words using constant negative rotation

  Fixes lp#882151.

12 years agowaiting for arbitrary events SB-EXT:WAIT-FOR
Nikodemus Siivola [Tue, 16 Aug 2011 16:36:28 +0000 (19:36 +0300)]
waiting for arbitrary events SB-EXT:WAIT-FOR

  While using this to wait for other threads isn't good style,
  sometimes it is _much_ easier to just state the thing you're
  waiting for than build the synchronization to make it nice.

  And sometimes the event lives in the external world, in which case
  you really need to poll anyways:

    (wait-for (probe-file pathname))

12 years agonuke the age-old experimental-thread.patch
Nikodemus Siivola [Tue, 23 Aug 2011 12:31:35 +0000 (15:31 +0300)]
nuke the age-old experimental-thread.patch

  Not pertinent anymore.

12 years agoMinor lowtag-handling cleanup in genesis.
Alastair Bridgewater [Wed, 26 Oct 2011 14:38:15 +0000 (10:38 -0400)]
Minor lowtag-handling cleanup in genesis.

  * Instead of explicitly testing a lowtag against two or four
constants (with scary reader conditionals for making the decision)
to determine if a given lowtag is an other-immediate, introduce a
function, IS-OTHER-IMMEDIATE-LOWTAG, paralleling IS-FIXNUM-LOWTAG,
with commentary, operating along the same lines as a similar
function in runtime.h.

12 years agoroom: KLUDGE-reduction.
Alastair Bridgewater [Tue, 25 Oct 2011 22:43:36 +0000 (18:43 -0400)]
room: KLUDGE-reduction.

  * Now that the thread structure doesn't have a lowtag, we can
remove the KLUDGE that prevented even FIXNUMs from being treated
as though they were thread-object-sized instead of a single word.

12 years agothreads: Thread objects don't need a lowtag.
Alastair Bridgewater [Tue, 25 Oct 2011 22:39:29 +0000 (18:39 -0400)]
threads: Thread objects don't need a lowtag.

  * It was a cute hack, in a way, to force the existing genesis
machinery to produce assembler symbols for thread structure slots.
But it's still a hack, and needs to die.  And now it can.

12 years agogenesis: Export assembly slot offsets for primitive-objects without lowtags.
Alastair Bridgewater [Tue, 25 Oct 2011 22:35:03 +0000 (18:35 -0400)]
genesis: Export assembly slot offsets for primitive-objects without lowtags.

  * If a primitive-object has no lowtag, export its slot offsets
to assembly language as if it had a lowtag of zero.

  * While we're here, use SYMBOL-VALUE instead of EVAL to find the
numeric value of a lowtag.

12 years agoFix MAYBE-WITH-PINNED-OBJECTS for PPC/GENCGC.
Alastair Bridgewater [Tue, 25 Oct 2011 20:43:13 +0000 (16:43 -0400)]
Fix MAYBE-WITH-PINNED-OBJECTS for PPC/GENCGC.

  * GENCGC has working WITH-PINNED-OBJECTS on all targets, not
just x86oids.  Not using it when necessary is bad, especially
since non-x86oids don't automatically pin references from the
control stack.  Fixed.

12 years agoFix unhandled error in float.pure.lisp on non-x86oids.
Alastair Bridgewater [Tue, 25 Oct 2011 14:25:25 +0000 (10:25 -0400)]
Fix unhandled error in float.pure.lisp on non-x86oids.

  * SB-VM::TOUCH-OBJECT doesn't exist on non-x86oids, and the
package is locked.  Disable reading of forms that refer to it
on non-x86oids.

12 years agoFix debug.impure.lisp / BUG-310175 for :stack-allocatable-lists targets.
Alastair Bridgewater [Tue, 25 Oct 2011 14:13:58 +0000 (10:13 -0400)]
Fix debug.impure.lisp / BUG-310175 for :stack-allocatable-lists targets.

  * Not all platforms stack-allocate.  Some platforms (PPC) stack-
allocate some things, but not most things.

  * PPC, in particular, stack allocates for LIST and LIST* (the
:stack-allocatable-lists feature), but doesn't stack allocate for
CONS.  And it turns out that the compiler transforms one-arg-LIST
and two-arg-LIST* to CONS.

  * Use two-arg-LIST to force the :stack-allocatable-lists code
path, and mark the test as failing on non-:stack-allocatable-lists
targets.

12 years agoFix fixnum and unsigned-fixnum array cleanups.
Alastair Bridgewater [Mon, 24 Oct 2011 22:02:50 +0000 (18:02 -0400)]
Fix fixnum and unsigned-fixnum array cleanups.

  * dd04bd449535e9016b5652a708a3cac2ca24c87d removes the specialized
array types with specific fixnum widths in favor of more generic
fixnum and unsigned-fixnum array types.

  * In SYS:SRC;CODE;ROOM.LISP, a mistake was made in converting over
to the newer representations, involving an alist of type tag names
to a constant related to the size of array elements.  The mistake
was even made inconsistently, so that neither 32-bit nor 64-bit
targets behaved correctly.

  * Fixed, to use sb!vm:word-shift instead of literal constants.

  * Original report and bisection by akovalenko on #sbcl.

12 years agoFix FP traps on OSX/x86.
Alastair Bridgewater [Mon, 24 Oct 2011 19:25:11 +0000 (15:25 -0400)]
Fix FP traps on OSX/x86.

  * De-cripple SB-INT:SET-FLOATING-POINT-MODES for this platform.

  * Enable restoring the FPU control word during interrupt handling
on this platform (RESTORE_FP_CONTROL_FROM_CONTEXT).

  * Implement restoring the FPU control word on this platform
(os_restore_fp_control).

  * Update :FAILS-ON information for the now-passing tests.

  * Update the commentary on test float.pure.lisp /
(ADDITION-OVERFLOW BUG-372) to more accurately reflect when it will
provide useful data (only when running float.pure.lisp separately).

12 years agoFix x86oid OSX signal handling emulation assembly fragments.
Alastair Bridgewater [Mon, 24 Oct 2011 18:30:32 +0000 (14:30 -0400)]
Fix x86oid OSX signal handling emulation assembly fragments.

  * Both x86 and x86-64 signal_emulation_wrapper include a small
assembly fragment to simulate "sigreturn" by means of an invalid
instruction trap.  This fragment has to load two different pointers
into specific registers before the trap, but historically just told
the compiler to load them into registers and then moved them into
the correct registers, leading to the possibility of clobbering one
of the values.  Fixed, by informing the compiler to place them into
the correct registers to begin with.

12 years agoFix FP traps on OSX/x86-64.
Alastair Bridgewater [Mon, 24 Oct 2011 02:36:24 +0000 (22:36 -0400)]
Fix FP traps on OSX/x86-64.

  * De-cripple SB-INT:SET-FLOATING-POINT-MODES for this platform.

  * Enable restoring the FPU control word during interrupt handling
on this platform (RESTORE_FP_CONTROL_FROM_CONTEXT).

  * Implement restoring the FPU control word on this platform
(os_restore_fp_control).

  * Update :FAILS-ON information for the now-passing tests.

  * Insert an addtional copy of test float.pure.lisp /
(ADDITION-OVERFLOW BUG-372) to detect failure to restore the FPU
control word in signal handling, with appropriate commentary.

12 years agoFix HEAD ref lookups, and compatibility for non-bash shells.
Jim Wise [Mon, 24 Oct 2011 13:38:25 +0000 (09:38 -0400)]
Fix HEAD ref lookups, and compatibility for non-bash shells.

12 years agoUpdate to work with non-bash versions of expr.
Jim Wise [Mon, 10 Oct 2011 14:17:08 +0000 (10:17 -0400)]
Update to work with non-bash versions of expr.

12 years agoClean up build process for cross-compiled targets.
Alastair Bridgewater [Sat, 22 Oct 2011 21:10:38 +0000 (17:10 -0400)]
Clean up build process for cross-compiled targets.

  * Over time, the process for producing an SBCL build for another
target architecture or OS has become more difficult and less
documented.

  * Move all make.sh argument processing to make-config.sh.

  * Have make-config.sh produce a file, output/build-config,
containing shell commands to set up important build parameters
such as where to find GNUMAKE, what SBCL_XC_HOST is, and so on.

  * Source output/build-config in most of the make*.sh scripts.

  * The practical upshot of all this is that a cross-compile
build is now a matter of alternating between target and host,
calling make-config.sh, make-host-1.sh, make-target-1.sh,
make-host-2.sh, make-target-2.sh, and following up with a
make-target-contrib.sh on the target, and you wind up with a
usable product.  And, as make-config.sh does all of the arg
parsing, you can pass --xc-host= or --dynamic-space-size= or
whatever and it all works out.

12 years agoUnwind-to-frame-and-call-VOP doesn't need static symbols.
Alastair Bridgewater [Thu, 24 Jun 2010 00:24:16 +0000 (20:24 -0400)]
Unwind-to-frame-and-call-VOP doesn't need static symbols.

  * The UNWIND procedure takes as parameters a target block and an
unknown-values start/count pair.  The old implementation was passing
the block, a zero count, and a garbage start.  Pass the function to
call as the start, instead of storing it as a static symbol value as
is done now or reserving an extra stack slot somewhere relative to
the unwind block.

  * Delete the static symbol formerly used for this.

  * This has been done for both x86 and x86-64.

12 years agoFix a long-standing bug in (PRIMITIVE-TYPE [MEMBER type])
Paul Khuong [Sat, 22 Oct 2011 01:38:00 +0000 (21:38 -0400)]
Fix a long-standing bug in (PRIMITIVE-TYPE [MEMBER type])

 A refactoring in 1.0.12.18 resulted in overly-optimistic primitive
 type.

 Reported by Eric Marsden on sbcl-devel.

12 years agoFix another assumption w.r.t fixnum width and n-lowtag-bits
Paul Khuong [Sat, 22 Oct 2011 01:02:17 +0000 (21:02 -0400)]
Fix another assumption w.r.t fixnum width and n-lowtag-bits

 This time in LOGBITP.

 Reported by Eric Marsden on sbcl-devel.

12 years agodescribe: Better description for complex setf-expanders.
Alastair Bridgewater [Fri, 1 Apr 2011 01:02:22 +0000 (21:02 -0400)]
describe: Better description for complex setf-expanders.

  * Rather than simply reporting the documentation string (if any), also
report the lambda-list of the expansion function and the associated
source location.

12 years agosetf: Record the original lambda-list for complex setf-expander functions.
Alastair Bridgewater [Fri, 1 Apr 2011 00:58:14 +0000 (20:58 -0400)]
setf: Record the original lambda-list for complex setf-expander functions.

  * Added an extra parameter to ASSIGN-SETF-MACRO for the lambda-list.

  * In ASSIGN-SETF-MACRO, when working with an EXPANDER (as opposed to
an INVERSE), set the %FUN-LAMBDA-LIST of the EXPANDER to the value
passed as the new parameter.

  * In all call sites for ASSIGN-SETF-MACRO (two uses in DEFSETF, one in
DEFINE-SETF-EXPANDER), pass the new lambda-list parameter appropriately.

12 years agosetf: excise GET-SETF-METHOD and related detritus.
Alastair Bridgewater [Thu, 31 Mar 2011 20:07:19 +0000 (16:07 -0400)]
setf: excise GET-SETF-METHOD and related detritus.

  * GET-SETF-METHOD is the CLtL1 version of GET-SETF-EXPANSION, and is
neither used in SBCL nor exported from any package.  Kill it.

  * Also kill the DEFKNOWN in the compiler for a (different)
GET-SETF-METHOD and GET-SETF-METHOD-MULTIPLE-VALUE (also a CLtL1
function, neither used nor implemented in SBCL).

12 years agosetf: pre-defined setf-expanders should handle multiple value places gracefully.
Alastair Bridgewater [Thu, 31 Mar 2011 20:00:48 +0000 (16:00 -0400)]
setf: pre-defined setf-expanders should handle multiple value places gracefully.

  * The GETF, LOGBITP, LDB and MASK-FIELD setf-expanders all take a
PLACE argument, the setf-expansion for which was being obtained via
GET-SETF-METHOD, which is the CLtL1 version of GET-SETF-EXPANSION, but
throws an error if a PLACE multiple values.  This also pre-dates the
adoption of VALUES places.

  * The most reasonable interpretation of the spec appears to be that
any values after the first are to be ignored upon reading and set to NIL
upon writing.

  * To do so, change each use to SB!XC:GET-SETF-EXPANSION instead of
GET-SETF-METHOD, and bind any symbols in the list of new value locations
to NIL before invoking the setter form.

12 years agosetf: read-modify-write macros should deal with multi-value places gracefully.
Alastair Bridgewater [Thu, 31 Mar 2011 19:33:40 +0000 (15:33 -0400)]
setf: read-modify-write macros should deal with multi-value places gracefully.

  * In PUSH, PUSHNEW, POP, REMF, INCF, DECF and DEFINE-MODIFY-MACRO the
setf-expansion was being obtained via GET-SETF-METHOD, which is the
CLtL1 version of GET-SETF-EXPANSION, but throws an error if a PLACE has
multiple values.  This also pre-dates the adoption of VALUES places.

  * The most reasonable interpretation of the spec appears to be that
any values after the first are to be ignored upon reading and set to NIL
upon writing.

  * To do so, change each use to SB!XC:GET-SETF-EXPANSION instead
of GET-SETF-METHOD, and bind any symbols in the list of new value
locations to NIL before invoking the setter form.

12 years agosetf: Don't use DO to "zip up" temporaries in read-modify-write macros.
Alastair Bridgewater [Thu, 31 Mar 2011 19:28:48 +0000 (15:28 -0400)]
setf: Don't use DO to "zip up" temporaries in read-modify-write macros.

  * Alter POP, REMF and DEFINE-MODIFY-MACRO to use (MAPCAR #'LIST
DUMMIES VALS) when building LET*-bindings instead of some crazy DO loop
involving PUSH and NREVERSE.

  * While we're here, introduce a new temporary in POP rather than
destructively modify a binding.