sbcl.git
11 years agomostly make the build deterministic
Christophe Rhodes [Tue, 18 Sep 2012 21:01:12 +0000 (22:01 +0100)]
mostly make the build deterministic

From clisp, about 10 files still differ in xc fasls after these changes.
At least one remaining issue is obvious (floats, where our float constants
aren't representable on clisp) but there are other mysteries.

11 years ago1.1.0: will be tagged as "sbcl-1.1.0"
Christophe Rhodes [Mon, 1 Oct 2012 21:51:32 +0000 (21:51 +0000)]
1.1.0: will be tagged as "sbcl-1.1.0"

11 years agoTry to make test :deferrables-unblocked-by-lock more robust
David Lichteblau [Sun, 30 Sep 2012 11:59:28 +0000 (13:59 +0200)]
Try to make test :deferrables-unblocked-by-lock more robust

  - Use a join thread, not a kill thread, so that we do not kill the
    background thread while it is currently performing the actual
    test.

  - Give the thread more time to start up, to make it more likely
    that its GRAB-MUTEX call needs to wait -- otherwise deferrables would
    not be unblocked.

11 years agoDo not use RETURN-FROM in MAKE-THREAD
David Lichteblau [Sun, 30 Sep 2012 10:50:04 +0000 (12:50 +0200)]
Do not use RETURN-FROM in MAKE-THREAD

Fix for lp#1058799, regression in 1.0.56.55-f0da2f6.

11 years agoMention safepoints in NEWS
David Lichteblau [Tue, 18 Sep 2012 15:11:40 +0000 (17:11 +0200)]
Mention safepoints in NEWS

11 years agoFix the cheneygc build
David Lichteblau [Thu, 27 Sep 2012 18:11:32 +0000 (20:11 +0200)]
Fix the cheneygc build

Thanks to Christoph Egger for the report.

11 years agoDisable ALLOCATION-INFORMATION.4 on gencgc for this release
David Lichteblau [Thu, 27 Sep 2012 17:32:47 +0000 (19:32 +0200)]
Disable ALLOCATION-INFORMATION.4 on gencgc for this release

This test currently exposes a bug in the contrib, yet users might prefer
to install the contrib in spite of this issue.  For this reason I am
disabling the test for the moment.

11 years agoreplace DEFINE-MORE-FUN with compiler smarts
Nikodemus Siivola [Sun, 23 Sep 2012 00:47:15 +0000 (03:47 +0300)]
replace DEFINE-MORE-FUN with compiler smarts

  Now that the compiler knows how to implement (NTH I REST-ARG) efficiently,
  we don't need to play tricks with &MORE: the compiler does that for us.

11 years agomore funky &REST smartness
Nikodemus Siivola [Sat, 22 Sep 2012 22:48:06 +0000 (01:48 +0300)]
more funky &REST smartness

  Extend the earlier VALUES-LIST optimization for &REST arguments
  into other operations as well. For starters:

    CAR
    ELT
    ENDP
    FIRST
    IF
    LENGTH
    LIST-LENGTH
    NTH

  All of these can now access the hidden &MORE context when given a &REST
  argument that is not used by other operations, making it possible for the
  compiler to elide the entire rest-list allocation in those cases.

11 years agofix "unable to read" compiler-error reporting during SBCL build
Nikodemus Siivola [Sat, 22 Sep 2012 18:55:50 +0000 (21:55 +0300)]
fix "unable to read" compiler-error reporting during SBCL build

  By moving stream-error-position-info into early-extensions.lisp,
  so it's available early enough.

11 years agoadd DEFINE-MORE-FUN, use it for vararg arithmetic functions
Nikodemus Siivola [Sat, 22 Sep 2012 18:46:16 +0000 (21:46 +0300)]
add DEFINE-MORE-FUN, use it for vararg arithmetic functions

  More efficient than consing a rest-list -- even a stack-allocated one, and
  doesn't add extra DX cleanup frames to backtraces.

  Done this way instead of just using &MORE directly in lambda-lists in order
  to mangle the lambda-list into &REST shape for user-consumption.

11 years agoproclaim *CURRENT-THREAD* as always-bound
Nikodemus Siivola [Tue, 18 Sep 2012 21:37:47 +0000 (00:37 +0300)]
proclaim *CURRENT-THREAD* as always-bound

   Eliminates quite a few "check if it's bound" cases from the system, and
   protects against MAKUNBOUND.

11 years agoFix nonthreaded build.
Joshua Elsasser [Sat, 22 Sep 2012 18:44:28 +0000 (11:44 -0700)]
Fix nonthreaded build.

11 years agoFix build on OpenBSD systems with PIE enabled by default in the C compiler.
Joshua Elsasser [Sat, 22 Sep 2012 18:40:50 +0000 (11:40 -0700)]
Fix build on OpenBSD systems with PIE enabled by default in the C compiler.

11 years agoAdd a safepoint-based mechanism to avoid SIGALRM for the TIMER facility
David Lichteblau [Thu, 13 Sep 2012 16:26:19 +0000 (18:26 +0200)]
Add a safepoint-based mechanism to avoid SIGALRM for the TIMER facility

  - Retrofits the signal-free timer thread for Windows (thanks to
    Anton Kovalenko) to POSIXy platforms.

  - Provide os_* functions in the C runtime which simulate the win32
    API for waitable timers.

Currently supported on Linux (timerfd), FreeBSD (kqueue), and SunOS
(completion ports).  A tentative (untested) implementation is
provided for Darwin's kqueue.

11 years agoNew predicate THREAD-EPHEMERAL-P for certain system threads
David Lichteblau [Tue, 18 Sep 2012 17:33:10 +0000 (19:33 +0200)]
New predicate THREAD-EPHEMERAL-P for certain system threads

Adds an `ephemeral' flag to the thread structure and exports it.
When true, we can assume that the thread will be started and stopped
by the runtime automatically as needed.

The flag is currently of a purely informational nature; it does not
change the behaviour of thread-related functions.

Thanks to Anton Kovalenko.

11 years agoadd truly-dynamic-extent declarations for various &rest number functions
Nathan Froyd [Wed, 19 Sep 2012 01:49:16 +0000 (21:49 -0400)]
add truly-dynamic-extent declarations for various &rest number functions

This change eliminates some spurious heap consing when using, e.g.
(REDUCE #'+ ...).  We ought to be able to do a better job of optimizing
REDUCE, but this is a helpful first step in any event.

11 years agoKill leftover threads after each test
Paul Khuong [Fri, 17 Aug 2012 22:17:03 +0000 (18:17 -0400)]
Kill leftover threads after each test

Otherwise, slightly broken tests manifest as hard failures in later
tests.

Thanks to Paul Khuong.

11 years agoFix "exit from normal thread" test
Paul Khuong [Fri, 17 Aug 2012 22:11:47 +0000 (18:11 -0400)]
Fix "exit from normal thread" test

 The test did not wait for the child to exit, resulting in spurious
 failures on loaded or single-core machines.

11 years agoReduce the numbers of threads in test ATOMIC-UPDATE on 32bit platforms
David Lichteblau [Tue, 18 Sep 2012 15:11:14 +0000 (17:11 +0200)]
Reduce the numbers of threads in test ATOMIC-UPDATE on 32bit platforms

This test creates 1000 threads in a row -- too many for some 32bit
platforms due to lack of memory or fragmentation.

11 years agosunos-os.c: Do not lose on mmap failure
David Lichteblau [Tue, 18 Sep 2012 15:11:13 +0000 (17:11 +0200)]
sunos-os.c: Do not lose on mmap failure

Brings this platform in line with other POSIX backends.  It is desirable
that we do not `lose' just because too many threads have been created,
for reasons of user-friendliness -- and also because individual
ill-behaved tests should not cause the entire run-tests process to fail.

11 years agoMinor repair work around odxprint
David Lichteblau [Tue, 18 Sep 2012 15:11:09 +0000 (17:11 +0200)]
Minor repair work around odxprint

Fixes the build on SunOS.

11 years agodon't assume only bits are looked for in bit-vectors
Nikodemus Siivola [Mon, 17 Sep 2012 17:46:18 +0000 (20:46 +0300)]
don't assume only bits are looked for in bit-vectors

11 years agofix unthreaded build
Nikodemus Siivola [Sun, 16 Sep 2012 13:07:01 +0000 (16:07 +0300)]
fix unthreaded build

11 years agoFix clisp cross-compile
Christophe Rhodes [Sat, 15 Sep 2012 17:39:23 +0000 (18:39 +0100)]
Fix clisp cross-compile

Problems:

* least-positive-long-float is unrepresentable in clisp, ending up
  with being zero
* clisp's decode-float returns a 0 exponent for a 0 float (rather
  than something large and negative)
* everything got constant-folded in the cross-compiler, thus using
  the host's runtime.

Solution: compute the value using sb!vm:double-float-digits/bias

11 years agotimeouts for WITH-MUTEX and WITH-RECURSIVE-LOCK
Nikodemus Siivola [Sat, 15 Sep 2012 10:25:46 +0000 (13:25 +0300)]
timeouts for WITH-MUTEX and WITH-RECURSIVE-LOCK

  * Also support :WAIT-P in WITH-RECUSIVE-LOCK.

  * Deprecate GET-MUTEX properly (been deprecated since early 2010, but didn't signal
    a compile-time warning, and we used it internally.)

  * Make WITH-MUTEX signal a runtime error when :VALUE is used and is other
    than current thread or NIL. Releasing it isn't going to work right if
    someone else holds it.

11 years agoimplement ATOMIC-PUSH and ATOMIC-POP
Nikodemus Siivola [Mon, 10 Sep 2012 22:08:48 +0000 (01:08 +0300)]
implement ATOMIC-PUSH and ATOMIC-POP

11 years agofix CAS on DEFCAS-defined places when the form is a macro
Nikodemus Siivola [Sat, 15 Sep 2012 11:21:22 +0000 (14:21 +0300)]
fix CAS on DEFCAS-defined places when the form is a macro

11 years agoPort safepoints to FreeBSD/x86
David Lichteblau [Fri, 14 Sep 2012 17:35:11 +0000 (19:35 +0200)]
Port safepoints to FreeBSD/x86

11 years agox86-bsd-os.c: Include stdio
David Lichteblau [Fri, 14 Sep 2012 17:35:07 +0000 (19:35 +0200)]
x86-bsd-os.c: Include stdio

Fixes the build on FreeBSD 9.1/x86.

11 years agoPort tests/expect.sh, foreign.test.sh to FreeBSD's shell
David Lichteblau [Fri, 14 Sep 2012 17:36:21 +0000 (19:36 +0200)]
Port tests/expect.sh, foreign.test.sh to FreeBSD's shell

Fixes clos.test.sh, foreign.test.sh on FreeBSD 9.1.

11 years agoTweak slam.sh to be slightly more configurable regarding the host binary
David Lichteblau [Tue, 12 Jul 2011 09:15:31 +0000 (11:15 +0200)]
Tweak slam.sh to be slightly more configurable regarding the host binary

Developers building with an existing SBCL as a host, which is not
installed as "sbcl" in the path, or which needs a --core option, can
now set XC_LISP and XC_CORE prior to invoking slam.sh.  Previously,
such a host could only be used with slam.sh after custom
modifications to the script.

The default behaviour is unchanged.

11 years agorelease.sh: Push accumulated automation changes.
Juho Snellman [Tue, 11 Sep 2012 12:49:19 +0000 (14:49 +0200)]
release.sh: Push accumulated automation changes.

11 years agoAdd dyndebug flags backtrace_when_lost, sleep_when_lost
David Lichteblau [Tue, 11 Sep 2012 11:37:21 +0000 (13:37 +0200)]
Add dyndebug flags backtrace_when_lost, sleep_when_lost

Available when :SB-QSHOW is enabled, these settings can be enabled
through the SBCL_DYNDEBUG environment variable to customize SBCL's
behaviour prior to entry to ldb.

With backtrace_when_lost, lossage shows a backtrace before
continuing with the lossage handler as usual.  (Thanks to Dmitry
Kalyanov for this idea, here committed as a dyndebug option.)

With sleep_when_lost activated, the monitor is preempted, and SBCL
will instead cease to do anything except for a OS-level sleep call.
This behaviour has proven useful in preserving a failing thread's
current state until an external debugger can be attached.

11 years agoAdd odxprint, a replacement for FSHOW which can be configured at run-time
David Lichteblau [Tue, 4 Sep 2012 15:16:01 +0000 (17:16 +0200)]
Add odxprint, a replacement for FSHOW which can be configured at run-time

  - A new macro odxprint(flag, "fmt", ...) performs the equivalent of
    a printf("fmt", ...), but only if `flag' has been enabled at
    run-time.

  - Environment variables can be used to set flags, using either
    SBCL_DYNDEBUG="flag1 flag2 flag3" syntax, or
    SBCL_DYNDEBUG__FLAG1="nonempty string" syntax.

  - Lisp feature SB-QSHOW enables support for odxprint-based FSHOW.
    (Users who prefer to edit runtime.h to enable QSHOW can still do
    so...)  SB-QSHOW is enabled by default on Windows, where the
    odxprint mechanism was first used.

  - Implement FSHOW, FSHOW_SIGNAL on top of odxprint.  Corresponding
    flags are called fshow, fshow_signal.

  - For gencgc_verbose, support a flag of the same name, since it is
    conditional on QSHOW (inspite of not being implemented on top of
    FSHOW).

 - Does not yet support odxprint features specific to Windows debugger
   integration; output is currently directed to stderr unconditionally.

This commit backports Anton Kovalenko's Windows-specific odxprint to
POSIX and integrates it with FSHOW.

11 years agowin32-os.c: Split up handle_exception
David Lichteblau [Mon, 3 Sep 2012 11:31:46 +0000 (13:31 +0200)]
win32-os.c: Split up handle_exception

In preparation for various changes to exception handling, split up
handle_exception into separate functions for each kind of exception.

This change is entirely cosmetic in nature.

11 years agofix bug in SYMBOL-VALUE CAS expansion for constant arguments
Nikodemus Siivola [Mon, 10 Sep 2012 22:08:25 +0000 (01:08 +0300)]
fix bug in SYMBOL-VALUE CAS expansion for constant arguments

11 years agoMention sb-safepoint, sb-thruption in base-target-features.lisp-expr
David Lichteblau [Tue, 4 Sep 2012 15:15:31 +0000 (17:15 +0200)]
Mention sb-safepoint, sb-thruption in base-target-features.lisp-expr

11 years agoFix a corner case in RUN-INTERRUPTION
David Lichteblau [Mon, 3 Sep 2012 11:31:36 +0000 (13:31 +0200)]
Fix a corner case in RUN-INTERRUPTION

Loop in C, not Lisp, if only to appease the test suite.

11 years agointerrupt.h: Remove rtmin[01]_handler forward declarations
David Lichteblau [Mon, 3 Sep 2012 11:31:27 +0000 (13:31 +0200)]
interrupt.h: Remove rtmin[01]_handler forward declarations

Left in accidentally from an earlier POSIX safepoint idea.

11 years agoIgnore an argument in x86's EMIT-CONSTANT-SEGMENT-HEADER
David Lichteblau [Fri, 7 Sep 2012 14:09:28 +0000 (16:09 +0200)]
Ignore an argument in x86's EMIT-CONSTANT-SEGMENT-HEADER

Fixes the build on this platform.

11 years agomake SOCKET-RECEIVE work correctly when receiving overly-long UDP packets
Nathan Froyd [Wed, 5 Sep 2012 02:45:03 +0000 (22:45 -0400)]
make SOCKET-RECEIVE work correctly when receiving overly-long UDP packets

Only copy as much data as the provided buffer can hold.  Continue to return
the length provided from recvfrom as per documentation.

Fixes lp#1023438.  Thanks to Robert Uhl for the fix.

11 years agoalign inline constant section with long nops
Nathan Froyd [Wed, 5 Sep 2012 02:24:37 +0000 (22:24 -0400)]
align inline constant section with long nops

Makes the disassembly much nicer, particularly at speed > space.

11 years agoadd SSE instructions with two opcode bytes
Nathan Froyd [Mon, 3 Sep 2012 00:38:09 +0000 (20:38 -0400)]
add SSE instructions with two opcode bytes

This patch just introduces the formats, some helper functions, and most
of, if not all of, the xmm-xmm/mem ones.  There's still quite some
interesting instructions left to add.

11 years agoReading floats with large exponents no longer takes too much time.
Stas Boukarev [Fri, 31 Aug 2012 21:38:13 +0000 (01:38 +0400)]
Reading floats with large exponents no longer takes too much time.

Reading 1.0s1000000000000000 will attempt to construct a very large
bignum, which takes a considerable amount of time just to report in
the end that it cannot be represented as a float. Truncate the
exponent to manageable size before raising it.

Fixes lp#309070. Thanks to Paul Khuong for the help.

11 years agoDefine _GNU_SOURCE when building contribs on Linux.
Stas Boukarev [Sat, 25 Aug 2012 04:57:11 +0000 (08:57 +0400)]
Define _GNU_SOURCE when building contribs on Linux.

sb-posix:o-direct doesn't get grovelled without it.

11 years agodisassemble: New customization variable sb-ext:*disassemble-annotate*.
Stas Boukarev [Fri, 24 Aug 2012 23:34:47 +0000 (03:34 +0400)]
disassemble: New customization variable sb-ext:*disassemble-annotate*.

sb-ext:*disassemble-annotate*: Controls whether to annotate
DISASSEMBLE output with source forms, defaults to T.

Also remove an unused function.

11 years agosb-bsd-sockets: Package clean up.
Stas Boukarev [Fri, 24 Aug 2012 23:18:17 +0000 (03:18 +0400)]
sb-bsd-sockets: Package clean up.

sb-bsd-sockets-internal: Don't use sb-c-call package, it's a
deprecated nickname for sb-alien, and sb-alien is already
used.
sb-win32-sockets-internal: Remove, not used anywhere.

11 years agoFix test-case for bug-511072 in packages.impure.lisp
Stas Boukarev [Wed, 15 Aug 2012 18:07:42 +0000 (22:07 +0400)]
Fix test-case for bug-511072 in packages.impure.lisp

It was creating an error in an additional thread and didn't handle it
properly, which caused SBCL to bail out.
Reported by Mirko Vukovic.

11 years agoAdd type declarations in stable-sort-list
Paul Khuong [Mon, 13 Aug 2012 20:06:50 +0000 (16:06 -0400)]
Add type declarations in stable-sort-list

 * I'd copied some code from a preliminary development version.

11 years agoMore efficient (stable) sort of lists
Paul Khuong [Mon, 13 Aug 2012 06:40:54 +0000 (02:40 -0400)]
More efficient (stable) sort of lists

 * (Reverse-) Sorted runs are mostly processed in linear time;

 * Calls to the :key function are cached;

 * Base cases now include specialised sorts for lists of
   length 3 and shorter.

 * Minimal test case for stable sorting.

11 years agoFix the build on Darwin
Paul Khuong [Mon, 13 Aug 2012 05:27:12 +0000 (01:27 -0400)]
Fix the build on Darwin

 * Darwin's assembler doesn't have default values for .fill directives.

 * Only use call_into_lisp_tramp on darwin/x86, not darwin.

 * Edit NEWS to note that threads have been OK on 10.8 since 1.0.58,
   while we're here.

11 years agoAdd a section about random number generation to the manual.
Lutz Euler [Sun, 12 Aug 2012 18:56:40 +0000 (20:56 +0200)]
Add a section about random number generation to the manual.

Document initial random state consistency, how to achieve or avoid
repeatability of random numbers, extensions with respect to seeding,
generation of random floats, and the currently used PRNG algorithm.

Move the docstring of SEED-RANDOM-STATE over from the "Miscellaneous
Extensions" section.

11 years agoAdd some missing launchpad references to NEWS.
Lutz Euler [Sun, 12 Aug 2012 18:17:17 +0000 (20:17 +0200)]
Add some missing launchpad references to NEWS.

11 years agoMention SB-EXT:EXIT instead of SB-EXT:QUIT in docstrings, etc.
Jan Moringen [Tue, 7 Aug 2012 14:57:49 +0000 (16:57 +0200)]
Mention SB-EXT:EXIT instead of SB-EXT:QUIT in docstrings, etc.

Suggest SB-EXT:EXIT instead of SB-EXT:QUIT in help string in
%INVOKE-DEBUGGER

Refer to SB-EXT:EXIT instead of SB-EXT:QUIT in docstring of
SB-EXT:SAVE-LISP-AND-DIE

Refer to SB-EXT:EXIT instead of SB-EXT:QUIT in docstring of
SB-EXT:*EXIT-HOOKS*

11 years agoRemove executable mode from several source files
David Lichteblau [Fri, 10 Aug 2012 19:05:40 +0000 (21:05 +0200)]
Remove executable mode from several source files

11 years agoFactor out most x86 code using the FS prefix into a macro WITH-TLS-EA.
David Lichteblau [Fri, 1 Jul 2011 20:17:09 +0000 (22:17 +0200)]
Factor out most x86 code using the FS prefix into a macro WITH-TLS-EA.

The macro expands into the exact same forms it replaces at the moment.

Windows threading will be able to plug into this macro with few changes,
and notably much reduced read-time conditionals.

11 years agoUse safepoints for INTERRUPT-THREAD
David Lichteblau [Fri, 17 Jun 2011 12:17:07 +0000 (14:17 +0200)]
Use safepoints for INTERRUPT-THREAD

  * In INTERRUPT-THREAD, stop threads using safepoints instead of
    signals.

  * Currently not used by default.  Users need to set feature
    SB-THRUPTION to enable this code.  SB-THRUPTION should only be set
    when SB-SAFEPOINT is also enabled.

  * This feature should ultimately be rolled into SB-SAFEPOINT, but
    remains as a separate build option until both versions are equally
    well-tested, and until other avoidable uses of signals have also
    been replaced by safepoints.

  * On the term "thruption": Earlier work on this feature sometimes
    used "interrupt" to refer to INTERRUPT-THREAD, causing confusion
    with the traditional meaning of "interrupt" as POSIX signal or WIN32
    exception.  To avoid such confusion, the runtime now refers to
    INTERRUPT-THREAD as a "thruption", short for th(read) (inter)ruption.

  * SIGPIPE is not used for threads running Lisp code, but a low-level
    handler for SIGPIPE still exists which arranges for threads running
    FFI code (in particular, threads blocked in poll, select,
    futex_wait) to be interrupted.

  * OS support: Minor changes to signal handling required, currently
    implemented for Linux and Solaris.

Credits: This is a POSIX backport of Windows threading changes by
Anton Kovalenko and Dmitry Kalyanov.

11 years agoAdd safepoint mechanism
David Lichteblau [Thu, 28 Apr 2011 11:51:35 +0000 (13:51 +0200)]
Add safepoint mechanism

  * Stop threads for GC at safepoints only.

  * Replaces use of SIG_STOP_FOR_GC.

  * Currently not used by default.  Users need to set feature
    SB-SAFEPOINT to enable this code.  SB-SAFEPOINT should only be set
    when SB-THREAD is also enabled.

  * ISA support: Each architecture needs VOP support, and changes to
    foreign call-out assembly; only x86 and x86-64 implemented at this
    point.

  * OS support: Minor changes to signal handling required, currently
    implemented for Linux and Solaris.

  * Performance note: Does not currently replace pseudo-atomic entirely,
    except on Windows.  Only once further work has been done to reduce
    use of signals will pseudo-atomic become truly redundant.  Therefore
    use of safepoints on POSIX currently still implies the combined
    performance overhead of both mechanisms.

  * Design alternatives exist for some choices made here.  In particular,
    this commit places the safepoint trap page into the SBCL binary for
    simplicity.  It is likely that future changes to allow slam-free
    runtime changes will have to go back to a hand-crafted address
    parameter.

  * This feature has been extracted from work related to Windows
    support and backported to POSIX.

Credits: Uses the CSP-based stop-the-world protocol by Anton Kovalenko,
based on the safepoint and threading work by Dmitry Kalyanov.  Use of
safepoints for SBCL originally researched by Paul Khuong.

11 years agoFix NEWS
Juho Snellman [Mon, 6 Aug 2012 20:42:39 +0000 (22:42 +0200)]
Fix NEWS

11 years agosbcl-1.0.58: will be tagged as "sbcl-sbcl-1.0.58"
Juho Snellman [Mon, 6 Aug 2012 06:46:45 +0000 (08:46 +0200)]
sbcl-1.0.58: will be tagged as "sbcl-sbcl-1.0.58"

11 years agoFix threads on Darwin 10.8
Paul Khuong [Wed, 1 Aug 2012 22:00:34 +0000 (18:00 -0400)]
Fix threads on Darwin 10.8

 * We used to pun (64-bit) addresses into 32-bit mach_port_name.

 * We used to assume arbitrary 32-bit addresses were always
   acceptable mach port names.

 * Stop doing that. Instead, allocate small descriptors until one's
   address is an acceptable port name (inspired by CCL).

 * Also, keep a lock-free free-list of descriptors to skip the previous
   loop in common cases.

 * There are still some strange issues, but I can't tell if they're new,
   and they seem preferable to consistently lose-ing when spawning threads.

11 years agoMiscellaneous cleanups for threaded darwin platforms
Cyrus Harmon [Sun, 29 Jul 2012 13:33:45 +0000 (06:33 -0700)]
Miscellaneous cleanups for threaded darwin platforms

 * Gather some related declarations in fewer (conditionalised) places

 * Lay down some infrastructure for mach port different from threads'
   addresses

 * Slightly modified by Paul Khuong

11 years agoFix build of contribs on Windows.
Stas Boukarev [Sat, 28 Jul 2012 15:15:57 +0000 (15:15 +0000)]
Fix build of contribs on Windows.

Set CC variable in make-target-contrib.sh, not in asdf-module.mk, Make
defaults CC to "cc" making it impossible to conditionally set CC to gcc
if it's unset.

11 years agoUpdate to asdf 2.23
Juho Snellman [Fri, 27 Jul 2012 10:31:26 +0000 (12:31 +0200)]
Update to asdf 2.23

11 years agorun-program: Don't make pty the process's controlling terminal.
Stas Boukarev [Thu, 26 Jul 2012 23:09:56 +0000 (03:09 +0400)]
run-program: Don't make pty the process's controlling terminal.

When called without an existing pty, for example in Slime, run-program
will make the created pty as the process's controlling.

(process-close (run-program "cat" () :pty t :search t :wait nil))
was terminated with SIGHUP when called under Slime.

11 years agoRestore buildability of run-program.impure on win32
David Lichteblau [Thu, 19 Jul 2012 18:45:33 +0000 (20:45 +0200)]
Restore buildability of run-program.impure on win32

... which had, unfortunately, been affected negatively by the previous
commit.

11 years agowin32: Mark all currently failing tests as such
David Lichteblau [Thu, 19 Jul 2012 12:42:03 +0000 (14:42 +0200)]
win32: Mark all currently failing tests as such

This change is not to be taken as an indication that these tests are not
going to be fixed.  Instead, it establishes a baseline against which to
measure future improvements, and it guards against further regression.

Please let's mark any newly added, problematic tests in the same fashion.

11 years agoTemporarily disable problematic exhaust tests on Windows
David Lichteblau [Wed, 18 Jul 2012 17:42:13 +0000 (19:42 +0200)]
Temporarily disable problematic exhaust tests on Windows

11 years agoUse preprocessor includes for link_or_copy on Windows
David Lichteblau [Thu, 7 Jul 2011 15:01:11 +0000 (17:01 +0200)]
Use preprocessor includes for link_or_copy on Windows

11 years agoDeclare types for sb-kernel:coerce-to-condition.
Stas Boukarev [Mon, 16 Jul 2012 20:34:43 +0000 (00:34 +0400)]
Declare types for sb-kernel:coerce-to-condition.

Add
(defknown coerce-to-condition ((or condition symbol string function)
                               list type-specifier symbol)
    condition
    (explicit-check))
Which helps to remove optimization notes in some cases with
restart-case.

Fixes lp#1025416.

11 years agoCorrect the info directory entry in sbcl-internals.texinfo.
Lutz Euler [Wed, 11 Jul 2012 19:52:36 +0000 (21:52 +0200)]
Correct the info directory entry in sbcl-internals.texinfo.

The file name was wrong so that the info directory link wasn't working.
LP #1023175, thanks to Orivej Desh for the report and the fix.

11 years agoImprove docstrings of MAKE-RANDOM-STATE and SEED-RANDOM-STATE.
Lutz Euler [Fri, 29 Jun 2012 22:08:34 +0000 (00:08 +0200)]
Improve docstrings of MAKE-RANDOM-STATE and SEED-RANDOM-STATE.

The formatting of some item lists in the docstring of SEED-RANDOM-STATE
was broken in the manual. Fix the indentation of the docstring so that
the conversion to texinfo can correctly collect multiple lines belonging
to the same bullet points, and drop a "- " intended to indicate a
single-item list as that doesn't work (according to comments in
docstrings.lisp item lists must consist of at least two items).

Fix some small grammatical errors.

While MAKE-RANDOM-STATE's docstring is not in the manual, it consists
mostly of a part of SEED-RANDOM-STATE's docstring, so apply the fixes
there, too.

11 years agoSimplify %symbol-value-in-thread further
David Lichteblau [Mon, 18 Jun 2012 13:40:49 +0000 (15:40 +0200)]
Simplify %symbol-value-in-thread further

Since Alastair Bridgewater fixed the race conditions in this function,
there is no need to loop anymore.

11 years agoUse %p for pthread pointers in debugging output
David Lichteblau [Fri, 17 Jun 2011 11:30:14 +0000 (13:30 +0200)]
Use %p for pthread pointers in debugging output

11 years agobrief_print: reset cur_lines
David Lichteblau [Wed, 18 May 2011 19:45:56 +0000 (21:45 +0200)]
brief_print: reset cur_lines

Otherwise, when running with QSHOW, the runtime stops printing
after 5000 objects (for example for traps).

11 years agoMake run-sbcl.sh executable
David Lichteblau [Mon, 18 Jun 2012 13:22:35 +0000 (15:22 +0200)]
Make run-sbcl.sh executable

11 years agoImproved merge-sort implementation for lists
Paul Khuong [Sun, 17 Jun 2012 08:53:47 +0000 (10:53 +0200)]
Improved merge-sort implementation for lists

 The new implementation is simpler and more efficient than the previous
 bottom-up sort.  It only differs from the original patch aesthetically.

 STABLE-SORT-LIST is also now MAYBE-INLINE, to enable selective inlining.

 Thanks to Takeru Ohta for the code and for his patience.

11 years agofix long-standing debug-name confusion
Nikodemus Siivola [Tue, 12 Jun 2012 05:36:58 +0000 (08:36 +0300)]
fix long-standing debug-name confusion

  The calls to IR1-CONVERT-LAMBDA-BODY with the a VARARGS-ENTRY and
  HAIRY-ARG-PROCESSOR debug-names were no such things.

  These calls produces the actual lambda for the main body of the function,
  and as such should have the original source-name and debug-name.

  As proof of the pudding, we previously failed to detect several known
  function that are recursive but aren't marked as such in the DEFKNOWNs. With
  this that changes, so fix the DEFKNOWNs.

11 years agoFix typo in whitespacely-canonical-filenames
David Lichteblau [Sat, 9 Jun 2012 22:12:21 +0000 (00:12 +0200)]
Fix typo in whitespacely-canonical-filenames

Thanks to Lutz Euler.

11 years agoa few more .mailmap entries
Nikodemus Siivola [Sat, 9 Jun 2012 20:48:37 +0000 (23:48 +0300)]
a few more .mailmap entries

  Trying to pick a canonical email for each, so that

    git shortlog -se

  shows only one line per person.

11 years agoadd .mailmap so "git shortlog -ns" counts properly
Nikodemus Siivola [Sat, 9 Jun 2012 20:35:01 +0000 (23:35 +0300)]
add .mailmap so "git shortlog -ns" counts properly

11 years agoAdd tests for two bugs that were incidentally fixed some time ago.
Lutz Euler [Sat, 9 Jun 2012 19:24:21 +0000 (21:24 +0200)]
Add tests for two bugs that were incidentally fixed some time ago.

Commit b894cb41d869bda6ba0c54a491becc7bb58375c1 (make FORMAT signal
errors with illegal COLINC etc. parameters) happened to fix bug 905817
(endless loop in FORMAT with zero COLINC), then unnoticed, so add a
regression test and NEWS now.

Commit 96c62c30ec9164419c790b2fbea953da2193620f (ensure that GCD returns
positive values) besides the one intended also fixed bug 516750 (type
error when trying to convert a sum of rationals to a float). Add the
failing expression from that bug to the existing test.

11 years agotest backtrace-interrupted-condition-wait works on Darwin/x86 as well
Nikodemus Siivola [Sat, 9 Jun 2012 17:39:47 +0000 (20:39 +0300)]
test backtrace-interrupted-condition-wait works on Darwin/x86 as well

11 years agoa few more tests to skip on unithreaded builds
Nikodemus Siivola [Sat, 9 Jun 2012 17:31:27 +0000 (20:31 +0300)]
a few more tests to skip on unithreaded builds

11 years agofix :DEBUGGER :SOURCE 2 test on unithreaded builds
Nikodemus Siivola [Sat, 9 Jun 2012 17:21:17 +0000 (20:21 +0300)]
fix :DEBUGGER :SOURCE 2 test on unithreaded builds

  Trivial layout different on debugger entry cause it to break.

11 years agotest backtrace-interrupted-condition-wait works on Darwin/x86-64
Nikodemus Siivola [Sat, 9 Jun 2012 12:25:01 +0000 (15:25 +0300)]
test backtrace-interrupted-condition-wait works on Darwin/x86-64

11 years agoadjust compiler-macro expansion and lambda-list parsing
Nikodemus Siivola [Sat, 3 Dec 2011 09:37:24 +0000 (11:37 +0200)]
adjust compiler-macro expansion and lambda-list parsing

 * Don't convert errors during compiler-macro expansion into runtime
   PROGRAM-ERRORs: signal a compile-time warning, and simply decline to expand
   the compiler-macro.

   This lives in CAREFUL-EXPAND-MACRO.

 * Make compiler not expand compiler-macros if there are arguments in keyword
   positions that are not self-evaluating constant symbols.

   This lives in two places:

    (1) VERIFY-KEYWORDS signals a COMPILER-MACRO-KEYWORD-PROBLEM when it
        encounters either an unknown keyword or anything except a
        self-evaluating symbol in a keyword position when parsing
        compiler-macro keywords.

    (2) IR1-CONVERT-FUNCTOID handles this condition by unwinding from the
        compiler-macro expansion, printing a note about the problem, and
        returning the original form.

    Calling COMPILER-MACRO-FUNCTION directly behaves exactly as before, for
    both good and ill: good in the sense that it is compliant, ill in the
    sense that doing things that way may expand things the compiler would
    decline to expand:

      (define-compiler-macro foo (&key ((a ax) t)) (format nil "a=~S" ax))

    The compiler would refuse to expand (foo a 42) unless

      (defconstant a 'a)

    had been done beforehand, but calling the COMPILER-MACRO-FUNCTION directly
    would expand it even without that -- as the spec unfortuntely requires.

11 years agosb-alien: some alien refactoring
Nikodemus Siivola [Sat, 31 Mar 2012 09:28:06 +0000 (12:28 +0300)]
sb-alien: some alien refactoring

  * Rename EXTRACT-ALIEN-VALUE & DEPOSIT-ALIEN-VALUE to %ALIEN-VALUE and
    (SETF %ALIEN-VALUE).

  * Split HEAP-ALIEN-INFO-SAP-FORM field into HEAP-ALIEN-INFO-ALIEN-NAME and
    -DATAP. HEAP-ALIEN-INFO-SAP-FORM becomes a function that conses up the form
    for the compiler, and HEAP-ALIEN-INFO-SAP replaces EVAL of the form.

  * Better error checking in PICK-LISP-AND-ALIEN-NAMES, and an error message
    that explains the correct form.

11 years agosb-alien-internals: ALIEN-VALUE to extract value of a symbol bound to an alien
Nikodemus Siivola [Sat, 31 Mar 2012 08:48:13 +0000 (11:48 +0300)]
sb-alien-internals: ALIEN-VALUE to extract value of a symbol bound to an alien

  Used in the evaluators. Also allows the simple evaluator to process alien
  variables without invoking the compiler.

11 years agoMicro-optimization: Avoid byte register writes on x86-64 in LOAD-TYPE.
Lutz Euler [Fri, 8 Jun 2012 15:30:15 +0000 (17:30 +0200)]
Micro-optimization: Avoid byte register writes on x86-64 in LOAD-TYPE.

The optimization guide for AMD's x86-64 processors recommends not
to write a partial register but instead to use MOVZX to write the
corresponding 32/64-bit register. Otherwise the instruction would have
an unnecessary dependency on the most recent write to the register,
reducing the available instruction level parallelism. On Intel's
processors this is not necessary but doesn't hurt.

To follow this recommendation, modify LOAD-TYPE to use MOVZX instead of
a byte MOV and adapt the VOPs that call it: FUN-SUBTYPE, SET-FDEFN-FUN,
and WIDETAG-OF. This additionally spares a temporary register in
FUN-SUBTYPE and allows to shorten all paths through WIDETAG-OF by one
instruction.

The effect on code size is small and mixed.

11 years agoUpdate NEWS
David Lichteblau [Fri, 8 Jun 2012 14:19:01 +0000 (16:19 +0200)]
Update NEWS

Minor SPARC and PPC fixes.

11 years agoturn off *PRINT-PRETTY* when reporting test results, want line per result
Tomas Hlavaty [Wed, 6 Jun 2012 14:31:14 +0000 (16:31 +0200)]
turn off *PRINT-PRETTY* when reporting test results, want line per result

This new format is easier to parse than the old line-wrapped output.

11 years agoRelax an implicit restriction on the number of code constants on SPARC
David Lichteblau [Wed, 6 Jun 2012 14:24:00 +0000 (16:24 +0200)]
Relax an implicit restriction on the number of code constants on SPARC

Previously, LOAD-CONSTANT was restricted by SPARC's particularly small
13 bit immediate field, allowing fewer constants than on other platforms.

Fixes lp#1008996.

11 years agoIn whitespace canonicalization, find a suitable make automatically
David Lichteblau [Wed, 6 Jun 2012 14:23:26 +0000 (16:23 +0200)]
In whitespace canonicalization, find a suitable make automatically

11 years agoSimplify ppc's MOVE-TO-WORD/INTEGER
David Lichteblau [Thu, 7 Jun 2012 21:49:34 +0000 (23:49 +0200)]
Simplify ppc's MOVE-TO-WORD/INTEGER

11 years agoFix inline fixnum LDB on PowerPC for certain bytespecs
David Lichteblau [Thu, 7 Jun 2012 18:08:34 +0000 (20:08 +0200)]
Fix inline fixnum LDB on PowerPC for certain bytespecs

Previously, the inline fixnum version of (ldb (byte 8 24) -1) would
return #x3f instead of #ff.

11 years agoFix test character.pure.lisp / BUG-994487 on non-unicode.
Lutz Euler [Thu, 7 Jun 2012 21:21:47 +0000 (23:21 +0200)]
Fix test character.pure.lisp / BUG-994487 on non-unicode.

Replace a literal 1114111 with (1- CHAR-CODE-LIMIT) so that the test
works on #-sb-unicode, too.

11 years agoAdd a test for range reduction of trigonometric functions on non-x86.
Lutz Euler [Thu, 7 Jun 2012 12:23:11 +0000 (14:23 +0200)]
Add a test for range reduction of trigonometric functions on non-x86.

Trigonometric functions of large float arguments yield differing results
depending on how range reduction is done. There is already a test for
the results expected on x86, float.pure.lisp/(:range-reduction :x87).

Add a test for the results expected from GNU libm and enable it for
all platforms except x86. The new test is impure and therefore added
to "float.impure.lisp". Move the x86 test there, too, to reduce the
potential for future confusion.

11 years agoSkip the float.pure.lisp/RANGE-REDUCTION test outside x86.
Lutz Euler [Thu, 7 Jun 2012 12:23:11 +0000 (14:23 +0200)]
Skip the float.pure.lisp/RANGE-REDUCTION test outside x86.

The test was and is meant only to be used on x86 as it tests for results
the x87 FPU computes, which can differ from those on other platforms.
It was accidentally enabled for all platforms with commit
4c81c652cdc32faefee1bccb84c3c9a7854e3edd.

Revert this by skipping the test on everything except x86. Augment
the test's name and improve its comment so that it hopefully won't be
enabled again everywhere so easily.