Paul Khuong [Thu, 23 Jun 2011 15:05:54 +0000 (11:05 -0400)]
 
Microoptimisation for block headers on x86-64
 Only emit a jmp over the header if a predecessor falls through to
 the current block, and it there is a trampoline.  Otherwise, it's
 not worth the cost of a branch to skip a few NOPs.
Paul Khuong [Wed, 22 Jun 2011 01:12:36 +0000 (21:12 -0400)]
 
Let register allocation handle unused TNs due to constant folding
 Type-directed constant folding can leave lambda-vars that are neither dead
 nor read from or written to.  Ideally, it seems like we should make sure to
 transform those into REF to CONSTANTs, but the optimisation doesn't seem
 guaranteed to fire.  It looks like the TN could simply not be allocated
 in ASSIGN-LAMBDA-VAR-TNS, but I'm not sure how to test for that situation
 ahead of time yet.
 Kludges over lp#729765.
Paul Khuong [Tue, 21 Jun 2011 04:31:00 +0000 (00:31 -0400)]
 
Unboxed implicit value cells on x86[-64]
 Implicit value cells are used for bindings that are only closed
 over by dynamic-extent functions.
 The logic would have to be somewhat modified on platforms with
 NFP.  As is, only implement support for unboxed implicit value
 cells on x86oids (for signed and unsigned words, SAPs and float
 reals and complexes).
Paul Khuong [Tue, 21 Jun 2011 03:52:45 +0000 (23:52 -0400)]
 
Compiler support for specialised implicit value cells
 Enables the use of non-T stack TNs for closed-over dynamic-extent variables.
 SB!VM:PRIMITIVE-TYPE-INDIRECT-CELL-TYPE takes a primitive-type and returns
 NIL, or a list of 4 values:
  - the primitive type of the implicit indirect value cell
  - the SC of that cell
  - a function that takes the NODE, BLOCK, FP, VALUE and RESULT, and
    emits a reference to that cell.
  - a function that takes the NODE, BLOCK, FP, NEW-VALUE and VALUE, and
    emits a write to that cell.
 Some correctness tests to make sure codegen is correct (without verifying
 DXness).
Paul Khuong [Tue, 21 Jun 2011 03:51:07 +0000 (23:51 -0400)]
 
Restore the build on x86
 Bad copy-pasta in 
293488f3.
Paul Khuong [Tue, 21 Jun 2011 02:07:52 +0000 (22:07 -0400)]
 
Inline local call trampolines on x86[-64]
 Allow the insertion of code before entry to blocks from
 drop0throughs, jumps, and calls.  Used on x86oids to insert
 the code to move return addresses to the right location
 on local calls without trampolines.
Paul Khuong [Tue, 21 Jun 2011 00:44:07 +0000 (20:44 -0400)]
 
Faster MAP[-INTO] when (> SPEED SPACE)
 Expand into WITH-ARRAY-DATA for non-simple vectors in such cases,
 and avoid hairy vector accesses.
 Also make sure to exploit that in conset code.
Paul Khuong [Mon, 20 Jun 2011 01:04:20 +0000 (21:04 -0400)]
 
More constraint propagation in the presence of assignment
 When SPEED = 3 > COMPILATION-SPEED, propagate type in code
 like (cond ((eql (the fixnum x) y) (setf x 42) y) ...).
Paul Khuong [Sat, 18 Jun 2011 20:36:02 +0000 (16:36 -0400)]
 
Less constraint propagation when COMPILATION-SPEED > SPEED
 Propagate much fewer EQL constraints, and propagate fewer constraints
 to EQL variables.  Can results in a few orders of magnitude speed ups
 in compilation times.
Paul Khuong [Sat, 18 Jun 2011 03:23:43 +0000 (23:23 -0400)]
 
More explicit high-level interface for consets
 Strictly no performance or behaviour difference, but it may be
 helpful to understand constraint propagation or even improve it.
Paul Khuong [Sat, 18 Jun 2011 03:18:01 +0000 (23:18 -0400)]
 
Faster iteration through a variable's constraints during constraint propagation
 Store indices of constraints by usage.  Practically eliminates the dependence
 on conset intersection/iteration performance.  Improves compilation speeds,
 especially for large functions.
 Also improves lp#792363 and lp#394206.
Paul Khuong [Sun, 12 Jun 2011 03:43:28 +0000 (23:43 -0400)]
 
Smarter FIND-CONSTRAINT during constraint propagation
 Use hash tables instead of pure linear search for hash
 consing of constraints. Significantly reduces the pressure
 on conset iteration performance, and improves compilation
 speed of large functions.
 Improves lp#792363 and lp#394206.
Nikodemus Siivola [Fri, 17 Jun 2011 18:41:31 +0000 (21:41 +0300)]
 
RUN-PROGRAM: apply the external-format to the PTY stream as well
Nikodemus Siivola [Wed, 15 Jun 2011 07:46:33 +0000 (10:46 +0300)]
 
build: tweak generate-version.sh to work with older Git
  Pre-1.7.2 Gits are pretty common out in the wild, so use wc -l to
  get the revision counts instead of rev-list --count.
  This has been verified to work with at least Git v1.6.0.2.
Nikodemus Siivola [Tue, 14 Jun 2011 17:38:56 +0000 (20:38 +0300)]
 
rename STYLE to HACKING
  Also update a bit for the brave new Git-only world.
Nikodemus Siivola [Tue, 14 Jun 2011 10:24:41 +0000 (13:24 +0300)]
 
whitespace in tests
Nikodemus Siivola [Tue, 14 Jun 2011 09:06:28 +0000 (12:06 +0300)]
 
add &KEY SILENT to PARSE-LAMBDA-LIST
  Passed through to PARSE-LAMBDA-LIST-LIKE, used by %SPLIT-ARGLIST in PCL.
  Prior to this GENERIC-FUNCTION-PRETTY-ARGLIST on functions with both
  &OPTIONAL and &KEY arguments caused a style-warning -- and inquiring about
  the lambda-list isn't the right time for that.
Jim Wise [Mon, 13 Jun 2011 20:27:59 +0000 (16:27 -0400)]
 
Convert remaining tests in debug.impure.lisp to use with-test.
Nikodemus Siivola [Tue, 7 Jun 2011 09:29:21 +0000 (12:29 +0300)]
 
tests and NEWS for lp#308961
  Also add a random FP read/print consistency tester.
  For now it skips denormalized double-floats due to bug 793774.
David Vázquez [Mon, 28 Jun 2010 16:53:30 +0000 (18:53 +0200)]
 
FORMAT-AUX-EXP: adjust scale if scale-exponent return 1.0
 lp#308961, part 2.
 FORMAT-EXP-AUX scales a number such that it will have K digits before of the
 decimal point. This relies on scale-exponent.
  (format nil "~E" 0.1) ; => "1.e-1"
  0: (FORMAT-EXP-AUX #<SB-IMPL::STRING-OUTPUT-STREAM {AFE5DE9}> 0.1 NIL NIL
                     NIL 1 NIL #\ NIL NIL)
    1: (SB-IMPL::SCALE-EXPONENT 0.1)
    1: SB-IMPL::SCALE-EXPONENT returned 0.1 0
  0: FORMAT-EXP-AUX returned "1"
 0.1 is 0.1 * 10^0 according to scale-exponent. Then, it is multiplied by 10^K
 before printing. Everything works out fine.
 However!
  (format nil "~E" 0.01) ; => "10.e-3" ... oops
  0: (FORMAT-EXP-AUX #<SB-IMPL::STRING-OUTPUT-STREAM {AA744C1}> 0.01 NIL NIL
                     NIL 1 NIL #\ NIL NIL)
    1: (SB-IMPL::SCALE-EXPONENT 0.01)
    1: SB-IMPL::SCALE-EXPONENT returned 1.0 -2
  0: FORMAT-EXP-AUX returned "2"
 In this example, scale-exponent returns 1.0 and -2, meaning 0.01 = 1.0 *
 10^-2. Again, format-aux-exp multiply it by 10^K. But as 1.0 has a digit
 before of the decimal point, the result will have K+1 digits.
 This is due to format-exp-aux assumed the returned value will be lesser to
 1.0. In order to fix this, we decrement K when scale-exponent return 1.0 as
 primary value.
David Vázquez [Mon, 28 Jun 2010 15:28:08 +0000 (17:28 +0200)]
 
FLONUM-TO-DIGITS handles non-negative input properly
 lp#308961, part 1.
 SBCL has an extended version of the Burger & Dybwig fp printer, which
 supports rounding.
 It did not however support zero -- but in eg.
   (format nil "~,1F" 0.001)
 0.001 is rounded to zero, which leads FLONUM-TO-DIGITS giving us one zero too
 many. Ie. it should be
    => "0.0"
 but prior to this we got "0.00" instead.
 This patch removes the special casing for 0, and instead tests that the lower
 limit of the interval (- r m-) is positive in order not to generate extra
 zeros.
Paul Khuong [Sat, 11 Jun 2011 15:24:53 +0000 (11:24 -0400)]
 
Specialised constant MAKE-{SINGLE,DOUBLE}-FLOAT VOPs on x86 as well
These only trigger when the float to construct is a NaN, so very
marginal, and it doesn't seem worth the trouble on all the other
platforms (that don't support inline constants yet).
Nikodemus Siivola [Sat, 11 Jun 2011 14:54:29 +0000 (17:54 +0300)]
 
more NEWS
Nikodemus Siivola [Sat, 11 Jun 2011 12:37:32 +0000 (15:37 +0300)]
 
robustify DIRECTORY on logical pathnames
  PATHNAME-INTERSECTIONS used to return pathnames with name or type
  NIL if there was a mismatch -- but it should not return any
  pathnames at all for a mismatch.
Paul Khuong [Sat, 11 Jun 2011 05:45:55 +0000 (01:45 -0400)]
 
Fix #!- vs #- confusion in number's singleton-p type method
Paul Khuong [Sat, 11 Jun 2011 05:41:27 +0000 (01:41 -0400)]
 
Avoid constant folding NaNs from MAKE-{SINGLE,DOUBLE}-FLOAT
Perform it in a specialised transform that checks for NaNs, and
add VOPs for constant arguments to avoid any slowdown.
Fixes lp#486812.
Paul Khuong [Sat, 11 Jun 2011 04:09:11 +0000 (00:09 -0400)]
 
Improve SINGLE-FLOAT-BITS on x86-64
 Avoid narrow-store-to-wide-load hazards, and generally emit sane
MOVSXD for sign extension.
 Fixes lp#555201.
Paul Khuong [Sat, 11 Jun 2011 03:33:04 +0000 (23:33 -0400)]
 
Fix a corner case in RUN-PROGRAM with very long argument strings
 Argument string of length on the order of MOST-POSITIVE-FIXNUM
 could lead to severe crashes.
 I don't know why we bothered declaring FIXNUMs in RUN-PROGRAM.
 Also, play with the null termination code a bit, but, really,
 such long strings will only end up failing in the OS.
 Fixes lp#787237
Paul Khuong [Sat, 11 Jun 2011 01:52:52 +0000 (21:52 -0400)]
 
MAKE-THREAD accepts :ARGUMENTS to pass to the thread function
 The additional keyword argument should be a lsit designator
 Based on a patch by Roman Marynchak.
 Fixes lp#727384.
Nikodemus Siivola [Fri, 10 Jun 2011 20:30:52 +0000 (23:30 +0300)]
 
FMAKUNBOUND removes the MACRO-FUNCTION as well
  Fixes lp#795705.
Nikodemus Siivola [Fri, 10 Jun 2011 20:18:41 +0000 (23:18 +0300)]
 
&optional and &key supplied-p arguments in boa-constuctors
  ...can be used to initialize structure slots.
Jim Wise [Fri, 10 Jun 2011 18:34:02 +0000 (14:34 -0400)]
 
Reorder description of info file installs to work around limited SunOS echo
Scratches a long-standing itch, but not really necessary (result is purely
aesthetic).
Nikodemus Siivola [Fri, 10 Jun 2011 17:21:18 +0000 (20:21 +0300)]
 
mention SB-INTROSPECT's improved handling of structure copiers in NEWS
Nikodemus Siivola [Fri, 10 Jun 2011 17:19:37 +0000 (20:19 +0300)]
 
export *USERINIT-PATHNAME-FUNCTION* and *SYSINIT-PATHNAME-FUNCTION*
  I have no idea why I didn't do that in the first place.
Nikodemus Siivola [Fri, 10 Jun 2011 10:55:03 +0000 (13:55 +0300)]
 
git: that terminal output? make it mention the correct revision
 *sigh*
Nikodemus Siivola [Fri, 10 Jun 2011 10:47:47 +0000 (13:47 +0300)]
 
git: more terminal output from post-receive-email script
Nikodemus Siivola [Fri, 10 Jun 2011 10:46:04 +0000 (13:46 +0300)]
 
git: revered merge detection logic in post-receive-email script
  How hard can this be?
Nikodemus Siivola [Fri, 10 Jun 2011 10:22:26 +0000 (13:22 +0300)]
 
sb-introspect: test-cases for defstruct copier, predicate, and accessor sources
 Feh. There were tests for even the cases that have worked for quite a while
 now.
Didier Verna [Fri, 10 Jun 2011 10:02:56 +0000 (13:02 +0300)]
 
sb-introspect: source locations for structure copiers
  Closely paralleling the existing hacks for structure accessors
  and copiers.
Nikodemus Siivola [Thu, 9 Jun 2011 20:23:23 +0000 (23:23 +0300)]
 
robustify debugger against bogus lambda-lists
  If we don't find a list where we expect a rest-list to be,
  substitute a dummy unprintable object.
  Provides a workaround for lp#795245.
Jim Wise [Thu, 9 Jun 2011 20:51:58 +0000 (16:51 -0400)]
 
RANGE-REDUCTION also fails-on sunos x86-64.
Nikodemus Siivola [Thu, 9 Jun 2011 18:03:09 +0000 (21:03 +0300)]
 
sb-posix: make SYSCALL-ERROR's argument optional
  The symbol is exported, and adding a required argument to the call broke
  backwards compatibility.
  Oops.
Nikodemus Siivola [Thu, 9 Jun 2011 15:12:29 +0000 (18:12 +0300)]
 
git: adjust whitespace in commit emails
  Kill the extra empty line.
Nikodemus Siivola [Thu, 9 Jun 2011 15:02:28 +0000 (18:02 +0300)]
 
git: post-receive-email hook again
  Check all revisions from new to old for merges, not just the topmost.
Nikodemus Siivola [Thu, 9 Jun 2011 14:29:32 +0000 (17:29 +0300)]
 
git: update hook, fix post-receive-email
 Add an update hook that prevents merge commits on master.
 Fix the post-receive-email script to work properly with merge commits --
 don't try to report pushes of merges with one email per commit.
 (Since we deny non-fast-forwards, we pretty much need to allow merges on
 other branches, or give up keeping them in the main repo.)
Jim Wise [Thu, 9 Jun 2011 12:56:47 +0000 (08:56 -0400)]
 
Fix thinko in one of the Solaris-compat changes in last commit.
Jim Wise [Wed, 8 Jun 2011 20:28:28 +0000 (16:28 -0400)]
 
Merge branch 'master' of ssh://sbcl.git.sourceforge.net/gitroot/sbcl/sbcl
Jim Wise [Wed, 8 Jun 2011 20:27:40 +0000 (16:27 -0400)]
 
Tweak to work with SunOS /bin/sh.
Nikodemus Siivola [Tue, 7 Jun 2011 14:08:00 +0000 (17:08 +0300)]
 
armload of DEFINE-HASH-CACHE changes
 * To clear a cache, drop the entire vector instead of filling it with
   NILs: thread safe, less work, and doesn't add dirty pages to old
   generations.
   Entering a value after the cache has been dropped allocates a new
   one.
   Caches are now initialized with 0 instead of NIL -- faster to
   allocate.
 * Use DEFGLOBAL instead of DEFVAR.
 * SAVE-LISP-AND-DIE drops all caches.
 * UNSAFE-CLEAR-ROOTS drops caches depending on the depth of the
   collection: nursery collection keeps all caches, gen 1 collection
   drops the CTYPE-OF cache, gen 2 and deeper collections drop all
   caches.
Nikodemus Siivola [Tue, 7 Jun 2011 17:02:15 +0000 (20:02 +0300)]
 
minor bug in type= method for arrays of unknown element type
 If the type has been specified since our last encounter with it,
 reparsing the previously unknown type specifier can result in TYPE=
 saying NIL, T.
 Hard to provoke without dipping into internals, so no NEWS entry.
Nikodemus Siivola [Tue, 7 Jun 2011 11:14:21 +0000 (14:14 +0300)]
 
more conservative bounds in FP interval arithmetic
 Make BOUND-BINOP return closed intervals when floating
 point rounding can cause an open bound to close.
 Consider:
  ;; Can return zero.
  (defun fii (x)
    (declare (type (single-float (0.0)) x))
    (/ x 2.0))
  ;; Can return 2.0.
  (defun fii (x y)
    (declare (type (single-float 2.0) x)
             (type (single-float (0.0)) y))
    (+ x y))
Nikodemus Siivola [Tue, 7 Jun 2011 12:26:47 +0000 (15:26 +0300)]
 
mark RANGE-REDUCTION test as failing on x86-64 Linux and Darwin
  Maybe others too?
Nikodemus Siivola [Tue, 7 Jun 2011 11:42:59 +0000 (14:42 +0300)]
 
fix whitespace in tests
Nikodemus Siivola [Tue, 7 Jun 2011 11:37:12 +0000 (14:37 +0300)]
 
missing NEWS entry for REMOVE-FD-HANDLER restart
Jim Wise [Tue, 7 Jun 2011 02:40:57 +0000 (22:40 -0400)]
 
Convert to with-test throughout.
While here, on SunOS x86-64 disable three tests which currently dump core.
With this, SunOS (x86-64 and x86) has no more tests which crash but are not
marked broken.
Jim Wise [Tue, 7 Jun 2011 02:27:19 +0000 (22:27 -0400)]
 
Run start-test earlier in with-test.
This way, if we bail on a test early because it is disabled, we've still
counted the test and recorded the source file.
Without this, if the first test in a file was disabled, it would be recorded
with the previous source file.
Jim Wise [Mon, 6 Jun 2011 17:30:29 +0000 (13:30 -0400)]
 
Tweak to work with SunOS 10's ancient sh implementation.
Jim Wise [Mon, 6 Jun 2011 17:22:34 +0000 (13:22 -0400)]
 
Rework test infrastructure to keep track of tests which are disabled
on the platform/feature combination being tested, and to differentiate
between tests disabled because the test is broken in some way, and those
skipped because the platform in question is broken in some way (or the test
is irrelevant for the given feature set).
This takes the form of two new keywords to WITH-TEST -- :BROKEN-ON, which
notes that the test itself is broken for a given feature expression, or
:SKIPPED-ON, which skips a test for a given feature expression.  This
information is noted at the end of a test run like so:
  Finished running tests.
  Status:
   Skipped (broken):    debug.impure.lisp / (TRACE ENCAPSULATE NIL)
   Skipped (broken):    debug.impure.lisp / (TRACE-RECURSIVE ENCAPSULATE NIL)
   Expected failure:    packages.impure.lisp / USE-PACKAGE-CONFLICT-SET
   Expected failure:    packages.impure.lisp / IMPORT-SINGLE-CONFLICT
   (38 tests skipped for this combination of platform and features)
  ok
  //apparent success (reached end of run-tests.sh normally)
  Thu Jun  2 15:59:31 EDT 2011
Note that there is no :WORKS-ON or :ENABLED-ON, even though many of the
read-time conditionals this replaced were for a given feature instead of for
its absence -- you can still do, eg:
  (with-test (:name foo :broken-on '(not :x86)) ...)
but such declarations are almost always too general (one exception being
`:skipped-on '(not :sb-thread)'), and IMO, should be discouraged.
While here, re-enable a bunch of tests previously skipped on Solaris which
now work.
Nikodemus Siivola [Mon, 6 Jun 2011 16:13:06 +0000 (19:13 +0300)]
 
check that git supports --count with rev-list
  git rev-list --count is probably the newest git feature we use in
  the build, so check that it works and complain if not.
Nikodemus Siivola [Sun, 24 Apr 2011 13:01:33 +0000 (16:01 +0300)]
 
add a REMOVE-FD-HANDLER restart around calling the FD handler function
  Otherwise broken FD handlers are even more of a pain than they need
  to be.
  Makes bug lp#769162 less irritating, but doesn't actually fix it.
Nikodemus Siivola [Thu, 2 Jun 2011 13:37:29 +0000 (16:37 +0300)]
 
write heap exhaustion information to the GC logfile as well
Nikodemus Siivola [Mon, 6 Jun 2011 07:13:50 +0000 (10:13 +0300)]
 
git hooks/post-receive-email tweaks
  One email per commit on existing branch.
  Silence diffstat -- we get that from git show.
Nikodemus Siivola [Mon, 6 Jun 2011 07:09:39 +0000 (10:09 +0300)]
 
standard git post-receive-email script
  For reference.
  git/ directory shall contain git hook scripts, etc.
Nikodemus Siivola [Mon, 6 Jun 2011 06:48:08 +0000 (09:48 +0300)]
 
A git-only SBCL workflow
 This updates the SBCL build and release process to be more compatible
 with distributed development -- to facilitate moving the upstream
 repository into Git.
 A detailed description of what is going on here is in
 doc/GIT-WORKFLOW.md.
 Some highlights:
  * Drop version.lisp-expr and branch-version.lisp-expr.
  * Auto-generate the version at build time using information
    from Git, incorporating:
    - Last release number.
    - Number of commits on origin/master since last release.
    - Current branch, if there are commits not on origin/master.
    - Number of commits not on origin/master.
    - SHA1 id of the last commit.
    - Optional -dirty marker.
  * Update release.sh to work with Git.
  * Make source-distribution.sh exclude the .git directory from tarballs.
  * Release tags contain NEWS for that release.
Juho Snellman [Sun, 5 Jun 2011 23:03:38 +0000 (23:03 +0000)]
 
1.0.49: Will be tagged as sbcl_1_0_49
Nikodemus Siivola [Mon, 30 May 2011 12:00:19 +0000 (12:00 +0000)]
 
1.0.48.35: SB-EXT:GC-LOGFILE
  GENCGC only.
  (SETF SB-EXT:GC-LOGFILE) to a pathname starts logging before/after
  generation statistics there. Doing the same with NIL stops logging.
Nikodemus Siivola [Mon, 30 May 2011 11:59:18 +0000 (11:59 +0000)]
 
1.0.48.34: MAKE-ALIEN-STRING
 An easy way to copy lisp strings to malloc'ed memory.
 I can't believe we didn't have this before. ...just seems
 insane. I keep expecting to find a nice way to do this
 squirreled away somewhere in SB-ALIEN. Here's hoping I won't
 embarrass myself by finding one.
 Also fix the OAOOM in MAKE-ALIEN and FREE-ALIEN documentation: make
 the docstrings the canonical versions, and include them in the
 manual.
Nikodemus Siivola [Mon, 30 May 2011 00:21:03 +0000 (00:21 +0000)]
 
1.0.48.33: --script bits and pieces
 * Leaving out the script name means to read the script from standard
   input. In this case the shebang line is _not_ handle -- simply
   because I ran out steam. (Our shebang line processing assumes a
   seekable stream.)
 * Stream errors on standard streams cause scripts to exit silently.
   lp#770222.
 * Scripts no longer us *TTY* for *TERMINAL-IO*, but make up a two-way
   stream from *STDIN* and *STDOUT*. Similarly for *DEBUG-IO* but
   using *STDERR*. This means that backtraces from errors are now
   neatly captured in the standard error stream.
Nikodemus Siivola [Sun, 29 May 2011 22:01:50 +0000 (22:01 +0000)]
 
1.0.48.32: NEWS
 Wrap to 78 cols, add the missing entries for .31 and .23.
Nikodemus Siivola [Sun, 29 May 2011 21:49:45 +0000 (21:49 +0000)]
 
1.0.48.31: WITH-LOCKED-SYSTEM-TABLE
  Instead of disabling interrupts in user code that needs
  WITH-LOCKED-HASH-TABLE, have a separate WITH-LOCKED-SYSTEM-TABLE
  that does so.
  Use it instead of WITH-LOCKED-HASH-TABLE for all internals.
Nikodemus Siivola [Sun, 29 May 2011 21:13:40 +0000 (21:13 +0000)]
 
1.0.48.30: adjust DOCUMENTATION and SB-INTROSPECT
 Now that non-standard special operators can also have macro
 definitions for consumption by code walkers, make sure we get the
 special operator source location and documentation instead of the
 ones for the dummy macro.
Nikodemus Siivola [Sat, 28 May 2011 15:23:28 +0000 (15:23 +0000)]
 
1.0.48.29: better end-of-the-world handling
 * Implicit QUIT.
 * Make sure we have %END-OF-THE-WORLD visible while doing cleanups.
 * Handle errors from cleanups.
 * Disable interrupts in places where the environment might now be up to
   handling them yet/anymore.
 * If user calls QUIT, and exit hooks run without serious trouble, report the
   exit status requested even if there is trouble later flushing streams, etc.
 * Also make SAVE-LISP-AND-DIE signal an error if SAVE returns. (When there is
   eg. a file with the desired name but insufficient permissions.)
Nikodemus Siivola [Sat, 28 May 2011 12:27:36 +0000 (12:27 +0000)]
 
1.0.48.28: make TRULY-THE macroexpandable
  lp#771673
  * MACRO-FUNCTION no longer checks :FUNCTION :KIND, allowing us to have
    special operators with macro-expansions in the first place.
  * Add %MACROEXPAND and %MACROEXPAND which are careful not to expand special
    forms, and use them in place of SB!XC:MACROEXPAND.
  * Set the :FUNCTION :MACRO-FUNCTION into an expander that just converts
    it to THE. This only happens when someone explicitly calls MACROEXPAND
    or uses MACRO-FUNCTION directly -- never in the compiler.
  * Also add a SETF-expander.
Nikodemus Siivola [Fri, 27 May 2011 10:55:11 +0000 (10:55 +0000)]
 
1.0.48.27: sb-posix: make syscall errors report the failing function
  Also add a declaim for the SYSCALL-ERROR ftype so the failing function will
  not be tail-merged is SYSCALL-ERROR appears in tail position.
Nikodemus Siivola [Fri, 27 May 2011 10:39:13 +0000 (10:39 +0000)]
 
1.0.48.26: sb-posix: export WNOHANG and WUNTRACED
  EOM.
Nikodemus Siivola [Wed, 25 May 2011 23:02:28 +0000 (23:02 +0000)]
 
1.0.48.25: automatic &rest to &more conversion
 lp#504575
 Automatically convert
   (values-list rest-arg)
 to
   (%more-arg-values more-context 0 more-count)
 when possible, making functions such as
   (defun foo (f1 f2 &rest args)
     (apply f1 args)
     (apply f2 args))
 non-consing.
 The conversion is done iff:
   * The rest arg is never assigned to.
   * The rest arg only appears in VALUES-LIST (incl. APPLY)
     calls.
   * Those calls are all in either the same lambda that
     allocates the rest-list, or one that has been declared
     dynamic extent. (Conservative guess re. escaping.)
 The way this works is as follows:
   1. When we convert a lambda with a non-ignored &rest argument, as add
      more-context and more-count arguments to the function, and
      stick their lambda-vars into arg-info-default of the &rest arg.
   2. When we source-transform a values-list form, we check if its argument is
      a &rest argument for which context and count are available. If so, we
      source-transform into
        (%values-list-or-context list context count)
   3. When we are optimizing, a deftransform fires for the form above. It
      checks if all the necessary conditions hold and converts into either
      %more-arg-values or values-list.
 The reason for this roundabout way of doing things lies in locall analysis:
 unless the extra context and count argument are used nontrivially when it
 runs, they get deleted -- and we don't know if we want them or not until the
 entire function has been converted. Absent a convenient pass between
 conversion and locall analysis, we must therefore do things in two stages.
Nikodemus Siivola [Tue, 24 May 2011 11:02:33 +0000 (11:02 +0000)]
 
1.0.48.24: fix performance / type derivation regression from 1.0.48.14
  Since global/special variables are now always converted using
  SYMBOL-VALUE / SYMBOL-GLOBAL-VALUE, we temporarily lost type
  information for them.
  Remedy this by adding a DERIVE-TYPE optimizer for both.
Nikodemus Siivola [Tue, 24 May 2011 10:09:18 +0000 (10:09 +0000)]
 
1.0.48.23: faster with-arguments CALL-NEXT-METHOD
 * Make the correctness-checking code for changed arguments in safe
   code check required arguments pairwise with EQL first -- if they
   match, the applicable methods must be the same and we can elide the
   expensive computation.
   This makes things like (apply #'call-next-method r1 r2 :foo foo rest)
   not suck horribly in safe code.
   Could still be better, but this much was quick and easy.
 * Make the &REST list in CALL-NEXT-METHOD dynamic-extent. This helps
   normal safety code as well.
Nikodemus Siivola [Tue, 24 May 2011 09:47:49 +0000 (09:47 +0000)]
 
1.0.48.22: optimize GENERIC-FUN-INFO
  This isn't a huge bottleneck, but it does get called
  enough that going over metatypes twice -- esp. once with
  unoptimized COUNT-IF -- is noticeable in a few places.
Nikodemus Siivola [Tue, 24 May 2011 08:49:45 +0000 (08:49 +0000)]
 
1.0.48.21: explicitly indefinite-extent leaves, safer dynamic-extent &REST
  Change LEAF-DYNAMIC-EXTENT to LEAF-EXTENT. Setting it to :INDEFINITE stops
  dynamic-extent propagation through the leaf.
  Use this in CONVERT-MORE-CALL / CONVERT-HAIRY-FUN-ENTRY by proclaiming the
  variables in the open-coded &REST list as having indefinite-extent.
  The upshot is that dynamic-extent &REST will only stack allocate the spine
  of the rest list, making it easier and safer to use.
  Document this in the manual and attach appropriate caveats re. portability.
Nikodemus Siivola [Sat, 21 May 2011 11:26:36 +0000 (11:26 +0000)]
 
1.0.48.20: fix mv-call regression from 1.0.43.57
  Don't assert untrusted types when the values flow into an mv-call.
  Reported by Martin Kielhorn on sbcl-bugs 2011-05-21.
Nikodemus Siivola [Sun, 15 May 2011 08:20:08 +0000 (08:20 +0000)]
 
1.0.48.19: another go at fixing the win32 build
 Roll back the last attempt, that was not only incomplete, but
 somewhat ill adviced.
 Instead, put in :UNKNOWN as FD-STREAM-FD-TYPE if we need to serve
 events, and :REGULAR otherwise.
Nikodemus Siivola [Sat, 14 May 2011 10:12:13 +0000 (10:12 +0000)]
 
1.0.48.18: ASDF 2.015.3
 Let's hope this one is good enough for a while. :)
Nikodemus Siivola [Sat, 14 May 2011 09:43:28 +0000 (09:43 +0000)]
 
1.0.48.17: hopefully fix build on win32
  Regression from 1.0.48.7. Add missing S_IFMT macro wrappers to win32
  build.
  (Untested on win32 as of yet.)
Nikodemus Siivola [Sat, 14 May 2011 09:14:54 +0000 (09:14 +0000)]
 
1.0.48.16: deadlock detection fixes
 * The same deadlock may be reported in multiple threads: adjust tests
   to account for that.
 * CHECK-DEADLOCK/DEADLOCK-CHAIN could signal an error if the deadlock
   had disappeared between its detection and building up the chain due
   to one of the involved threads unwinding.
   To flush out issues like this a bit better, added looping to some
   of the deadlock tests.
Nikodemus Siivola [Thu, 12 May 2011 17:07:01 +0000 (17:07 +0000)]
 
1.0.48.15: fix null broadcast-streams as RUN-PROGRAM output streams
  Regression from 1.0.48.4.
  Since they have element-type T, COPY-DESCRIPTOR-TO-STREAM complains
  about them -- but it's more efficient to special-case them to the
  null device anyways.
  Also add a missing error message about unknown element types for input
  streams.
  ...and fix numbering of RUN-PROGRAM-CAT-* tests.
Nikodemus Siivola [Thu, 12 May 2011 10:42:20 +0000 (10:42 +0000)]
 
1.0.48.14: more conservative global variable conversion
 Based on patch by Roman Marynchak.
 Fixes lp#722734.
 * Modify IR1-CONVERT-VAR to emit SYMBOL-VALUE wrapper
   for all global variables except those which are
   ALWAYS-BOUND.
 * Modify IR1-STEP-FORM-P to return false for SYMBOL-VALUE
   with constant argument, now that virtually all global
   variables are accessed with a function call (which gets
   converted via a VOP, so the final machine code remains
   the same.)
Nikodemus Siivola [Thu, 12 May 2011 10:02:27 +0000 (10:02 +0000)]
 
1.0.48.13: SET-SYNTAX-FROM-CHAR and dispatch-macro characterness
  Previously when the to-char was a dispatch-macro character in to-readtable,
  but from-char wasn't one in from-readtable, SET-SYNTAX-FROM-CHAR didn't do
  anything.
  CLHS says "If the character is a dispatching macro character, its entire
  dispatch table of reader macro functions is copied." which *can* be taken to
  mean that dispatch table should not be removed even if it doesn't exist at
  all in the from-readtable, but that interpretation doesn't really match with
  the rest of the description or the exhortation to copy the syntax type -- I
  read it as an instruction to copy the whole dispatch table, not just the
  fact that the character is a dispatching macro character.
Nikodemus Siivola [Wed, 11 May 2011 19:42:35 +0000 (19:42 +0000)]
 
1.0.48.12: fix bugs in deadlock detection and tests
 * No timeouts on mutexes on lutex builds: so don't mark the wait as
   having one.
 * No timeouts on spinlocks, so don't mark the wait as having one even
   if there is a deadline.
 * More tests.
Nikodemus Siivola [Wed, 11 May 2011 18:45:51 +0000 (18:45 +0000)]
 
1.0.48.11: update ASDF to 2.015.2
  2.015 and .1 had an unfortunate interaction with Quicklisp.
Nikodemus Siivola [Wed, 11 May 2011 16:48:37 +0000 (16:48 +0000)]
 
1.0.48.10: add deadlock detection to spinlocks and mutexes
 Each thread gets a WAITING-FOR slot which holds the lock it is
 currently trying to acquire.
 After initial try at lock acquisition fails, we check for deadlocks:
 we look at the thread that owns the lock we want -> lock it is
 waiting for, etc, recursively, until we either bottom out or find
 someone waiting for us.
 Print thread as having state WAITING if it is waiting for a lock.
 Add a PRINT-OBJECT methods for MUTEXes and SPINLOCKs.
 SB-THREAD:THREAD-DEADLOCK-CYCLE contains a list of the
 threads and locks involved, so that the situation can be
 analyzed even afer a handler has broken the deadlock.
Nikodemus Siivola [Wed, 11 May 2011 11:15:43 +0000 (11:15 +0000)]
 
1.0.48.9: better source information for compile-time type errors
  Compile-time warning: in addition to the context, also tell exactly
  which form produces the value that is not of the expected type.
  Run-time error: include both the error context and exact form in the
  error message.
  Delete VALUES-TYPE-ERROR, and use SIMPLE-TYPE-ERROR for both legs in
  %COMPILE-TIME-TYPE-ERROR.
Nikodemus Siivola [Tue, 10 May 2011 20:41:51 +0000 (20:41 +0000)]
 
1.0.48.8: better binary stream support in RUN-PROGRAM
  * In COPY-DESCRIPTOR-TO-STREAM, decode octets only if the stream has
    a character element type.
    For :DEFAULT and (UNSIGNED-BYTE 8) just copy the octets over
    directly.
    For others, signal an error. (Would be nice to support, but not a
    high priority.)
  * Similarly for copying to temporary files from non-fd input
    streams.
Nikodemus Siivola [Tue, 10 May 2011 20:05:25 +0000 (20:05 +0000)]
 
1.0.48.7: add FD-STREAM-FD-TYPE, use it to decide when to poll the fd
  1.0.42.43 introduced a regression that caused reads from non-regular files
  to potentially block in an uninterruptible state, as WAIT-UNTIL-FD-USABLE
  started being called only when there was a timeout or events to serve.
  This was a win for regular files, because filling the input buffer then
  required one syscall less.
  ...but since uninterruptible blocking reads aren't fun for anyone, let's
  make things a bit smarter:
  * When creating an FD-STREAM, use fstat() to get the type of the fd, and
    store a keyword describing it in the FD-STREAM.
  * REFILL-INPUT-BUFFER now calls SYSREAD-MAY-BLOCK-P always if the file
    anything but :REGULAR -- so pipes and sockets and whatnot get their
    select() calls, and a read from a stream to one can no longer cause
    SBCL to hang.
Nikodemus Siivola [Tue, 10 May 2011 19:16:53 +0000 (19:16 +0000)]
 
1.0.48.6: %SIMPLE-EVAL and backtraces
  Functions from %SIMPLE-EVAL have names such as (EVAL (DEFMACRO FOO)),
  which looks pretty confusing in the backtrace.
  Replace that with #:EVAL-THUNK, which is more descriptive and
  less head-scratchy.
  Also, calls to SIMPLE-EVAL-IN-LEXENV and EVAL -- when they show
  up in backtraces -- have lisp forms as arguments. This causes
  pretty-printing to try and split things onto multiple lines,
  but *PRINT-LINES* tends to be 1 during backtracing.
  ...so bind *PRINT-PRETTY* to NIL when printing eval-frame
  arguments iff *PRINT-LINES* is 1 in order to have something
  useful show up the backtrace.
Nikodemus Siivola [Mon, 9 May 2011 22:20:49 +0000 (22:20 +0000)]
 
1.0.48.5: update ASDF to 2.015.1
 2.015 broke LOAD-SOURCE-OP, this should fix it.
Nikodemus Siivola [Mon, 9 May 2011 22:12:27 +0000 (22:12 +0000)]
 
1.0.48.4: source locations for init files
 Refactor PROCESS-INIT-FILE to share code with LOAD-AS-SOURCE.
 Also add in contrib/sb-introspect/load-test.lisp which was
 left out from the last commit.
Nikodemus Siivola [Mon, 9 May 2011 19:47:03 +0000 (19:47 +0000)]
 
1.0.48.3: source-locations from LOAD of source files, and EVAL-WHEN :COMPILE-TOPLEVEL
  * Bind *SOURCE-INFO* and bind and populate *SOURCE-PATHS* in
    LOAD-AS-SOURCE.
  * EVAL-TLF provides a way to evaluate things while providing the
    toplevel form number. It also captures the current *SOURCE-INFO*
    and passes it onwards to be reused by ACTUALLY-COMPILE.
  * In ACTUALLY-COMPILE, when asked to reuse a source-info object,
    also retain the old *SOURCE-PATHS*.
Nikodemus Siivola [Mon, 9 May 2011 12:33:46 +0000 (12:33 +0000)]
 
1.0.48.2: ASDF 2.015
 ASDF no longer ships with a separate LICENSE file, so remove it.
Nikodemus Siivola [Mon, 9 May 2011 10:41:25 +0000 (10:41 +0000)]
 
1.0.48.1: WITH-COMPILATION-UNIT :SOURCE-NAMESTRING
  Allows specifying an alternate namestring to use for debug-source.
  This will help us get redefinition warnings working nicely with C-c C-c in
  Slime.