sbcl.git
11 years agocompiler/sparc/arith: Fix SCs for FAST-EQL{,-C}/FIXNUM.
Alastair Bridgewater [Thu, 8 Nov 2012 23:18:28 +0000 (18:18 -0500)]
compiler/sparc/arith: Fix SCs for FAST-EQL{,-C}/FIXNUM.

  * There's a KLUDGE in build-order.lisp-expr wherein failures
when building this file are ignored.

  * The failures are specifically an SC vs. arg-type mismatch for
the FAST-EQL/FIXNUM and FAST-EQL-C/FIXNUM VOPs.

  * Fix the mismatch by altering the VOP definitions to match what
the MIPS backend uses (since it doesn't have the failure).

  * And remove SPARC from the reader conditional on the KLUDGE.

11 years agoalien type improvement: handle offsets in unparse-alien-record-type
Cyrus Harmon [Mon, 15 Oct 2012 06:12:58 +0000 (23:12 -0700)]
alien type improvement: handle offsets in unparse-alien-record-type

Previously, when recomputing the offset to struct fields we would
ignore the offset and attempt to recompute it, occasionally getting it
wrong. Now store the offset in uparse-alien-record-field and use in
parse-alien-record-fields.

Also, fix some comment typos.

11 years agosb-concurrency: frlocks
Nikodemus Siivola [Mon, 8 Oct 2012 07:09:53 +0000 (10:09 +0300)]
sb-concurrency: frlocks

11 years agoSafepoint protocol upgrade
David Lichteblau [Wed, 31 Oct 2012 17:06:00 +0000 (18:06 +0100)]
Safepoint protocol upgrade

Upgrade to the new stop-the-world protocol from the Windows branch,
dating back to late 2011, an all-in-one readability and correctness
improvement.

Replace per-thread qrl locks with one process-wide lock for all
operations relating to GC state and the threads' CSP area.  Use
condition variables for notifications on GC state changes.

Thanks to Anton Kovalenko.

11 years agoUpdate NEWS; explain Windows system requirements
David Lichteblau [Tue, 30 Oct 2012 13:51:26 +0000 (14:51 +0100)]
Update NEWS; explain Windows system requirements

11 years agoExtend use of the linkage table to static symbols
David Lichteblau [Tue, 23 Oct 2012 19:55:02 +0000 (21:55 +0200)]
Extend use of the linkage table to static symbols

  - Formerly static symbols are static no more:

  - Always use the linkage table, even in cross compilation.  The
    runtime retrieves the resulting list of foreign symbols and installs
    linkage table entries before calling into Lisp for the first time.

  - Simplify/remove various win32 foreign symbol special cases.

  - Almost remove scratch().

Conditional on feature SB-DYNAMIC-CORE; required on Windows and optional
on other platforms supporting the linkage table.

With this feature, changes to src/runtime can be built using make,
without requiring a slam.sh step to update core files.

For LINKAGE-TABLE platforms only.  Currently supported on x86 and
x86-64.  (PowerPC does not yet work.)  In the interest of simplicity,
disable this feature permanently on non-SB-THREAD platforms, because
these would require unpleasant changes to allocation macros.

Thanks to Anton Kovalenko.

11 years agoMove the global safepoint to one page before static space
David Lichteblau [Mon, 29 Oct 2012 12:43:07 +0000 (13:43 +0100)]
Move the global safepoint to one page before static space

New attempt at finding an optimal location for the global safepoint
page.  Hopefully this solution will cover all our use cases for
the foreseeable future.

  - Relative to static space for architectures with small immediates.

  - Also addresses the requirements of sb-dynamic-core, which needs
    the safepoint to have an absolute address on x86(-64).

Hence, a new macro !gencgc-space-setup -- tweaks space parameters to
squeeze in the safepoint page, while also simplifying parms.lisp for
some platforms.

11 years agoWindows console I/O overhaul
David Lichteblau [Mon, 22 Oct 2012 15:04:38 +0000 (17:04 +0200)]
Windows console I/O overhaul

  - Make non-interruptible I/O interruptable by means of a
    background thread.

  - Fixes lp#308923.

  - Use Unicode in stdio streams.

Thanks to Anton Kovalenko.

11 years agoAllow synchronous win32 I/O to be interrupted, too
David Lichteblau [Fri, 5 Oct 2012 20:10:53 +0000 (22:10 +0200)]
Allow synchronous win32 I/O to be interrupted, too

... if and only if running on a version of Windows new enough to
support doing so.  Two scenarios come to mind where synchronous (i.e.
non-overlapped) I/O might matter:

  - There is one kind of HANDLE which is never overlapped: Unnamed
    pipes.  Unlike named pipes, the feature added by this commit is
    our only option of interrupting I/O on the former.

  - User code might pass in a HANDLE through MAKE-FD-STREAM without
    the right flag set.  In principle, non-interruptibily of such a
    HANDLE is a bug in said user code, but it doesn't hurt to deal
    with these correctly as a side benefit.  (The only Windows
    releases which support re-opening of a HANDLE with the right
    flag also have the functions needed by this commit.)

One downside for users might be an element of surprise, in that the
same SBCL binary will exhibit the presence or lack of features,
respectively, when started on recent Windows or old Windows.  However,
the advantages of offering the feature seem to me to outweigh that
disadvantage.

Thanks to Anton Kovalenko.

11 years ago1.1.1: will be tagged as "sbcl-1.1.1"
Christophe Rhodes [Fri, 2 Nov 2012 09:42:04 +0000 (09:42 +0000)]
1.1.1: will be tagged as "sbcl-1.1.1"

11 years agoFix the single-threaded Windows build
David Lichteblau [Fri, 26 Oct 2012 17:35:17 +0000 (19:35 +0200)]
Fix the single-threaded Windows build

For this release, we purport to support Windows without threads as
an option.  Make it so.

11 years agoDo not assert that the integer returned by UNIX-ISATTY is a BIT
David Lichteblau [Thu, 25 Oct 2012 12:49:08 +0000 (14:49 +0200)]
Do not assert that the integer returned by UNIX-ISATTY is a BIT

11 years agoFix build on MinGW (again)
David Lichteblau [Mon, 22 Oct 2012 14:20:15 +0000 (16:20 +0200)]
Fix build on MinGW (again)

Remove -mno-cygwin, re-added by mistake earlier.

11 years ago.gitignore: Add src/runtime/sparc-funcdef.h
nyef [Thu, 11 Oct 2012 19:55:56 +0000 (19:55 +0000)]
.gitignore: Add src/runtime/sparc-funcdef.h

  * Just another auto-generated file for a rarely-maintained
target.

11 years agoDisable an SB-INTROSPECT test on GENCGC SPARC.
nyef [Thu, 11 Oct 2012 18:28:13 +0000 (18:28 +0000)]
Disable an SB-INTROSPECT test on GENCGC SPARC.

  * Test ALLOCATION-INFORMATION.4 is known to be flaky at best on
GENCGC PPC, and has been observed to fail on GENCGC SPARC.  Since
it's been marked :FAILS-ON for GENCGC PPC, mark it as failing for
GENCGC SPARC as well.

11 years agoGENCGC on SPARC/Linux
nyef [Thu, 11 Oct 2012 18:18:59 +0000 (18:18 +0000)]
GENCGC on SPARC/Linux

  * Tweak make-config.sh to automatically select GENCGC, and to
update the fallback message for those poor bsd-using folks.

  * Copied the gencgc memory map from the SunOS version to use for
Linux (the cheneygc maps were identical, we may as well keep the
parallelism).

  * Also tweaked the linker flags to match.  Not because it was
required to build, but because I don't know why they were changed
for SunOS, and in the absence of such knowledge I'd rather keep
things more or less parallel.

11 years agosrc/runtime/sparc-arch.c: Use si_addr in arch_get_bad_addr().
nyef [Thu, 11 Oct 2012 18:13:02 +0000 (18:13 +0000)]
src/runtime/sparc-arch.c: Use si_addr in arch_get_bad_addr().

  * Since the sparc port was first merged, arch_get_bad_addr() has
only worked when the program counter is within read-only or the
current dynamic space.

  * This is fragile simply because of the existance of static
space and PURIFY.  It is WORSE when you add GENCGC to the mix (to
the point where SunOS with GENCGC doesn't even call
arch_get_bad_addr() anymore).

  * The existing implementation looks like it predates the switch
to sigaction(2) style signal handlers.  SBCL uses si_addr on all
other backends save Alpha (long undermaintained) and HPPA (even
longer undermaintained).  Clearly, this approach works on SunOS.
From testing, it works on at least linux-2.6.32.  We might as well
run with it, since we need it for GENCGC anyway, and we can easily
concoct a test case that would cause a failure using CHENEYGC.

  * So, implementation patterned on any of the other backends, but
leaving the old code in place, conditional-compiled out, as a bit
of a historical note / warning to future historians.

11 years agoUpdate NEWS, make-config.sh
David Lichteblau [Tue, 18 Sep 2012 15:11:40 +0000 (17:11 +0200)]
Update NEWS, make-config.sh

11 years agosb-bsd-sockets: Add a test for interruptible I/O
David Lichteblau [Mon, 24 Sep 2012 16:48:34 +0000 (18:48 +0200)]
sb-bsd-sockets: Add a test for interruptible I/O

Test TCP sockets even without :internet-available, albeit only on
threaded builds.  Check that INTERRUPT-THREAD works in a timely
fashion on threads currently blocked in I/O on a socket.

11 years agoWindows: Use overlapped I/O, CreateFile
David Lichteblau [Tue, 18 Sep 2012 15:12:19 +0000 (17:12 +0200)]
Windows: Use overlapped I/O, CreateFile

Overlapped I/O is win32's asynchronous I/O mechanism, which allows
us to start an I/O operation and explicitly wait for it to finish at
a time of our choosing, such that we can simultaneously await other
events instead of blocking unconditionally.

  - Support for overlapped I/O is a per-HANDLE flag specified at
    file opening time, necessitating a switch to win32's CreateFile
    and away from the CRT's _open.

  - Wrap win32 file operations in POSIX-compatible functions, so
    that UNIX-OPEN, UNIX-READ, UNIX-WRITE, UNIX-CLOSE continue to
    work as before.  Under the hood, these now call our Lisp or C
    functions instead of versions from CRT.

  - For now, these functions still return and expect what passes as
    file descriptors in CRT.

  - INTERRUPT-THREAD is now capable of performing the interruption
    in a target thread blocked in socket I/O, indicated using an
    errno of "EINTR".  Minor changes in FD streams to retry the I/O
    operation explicitly in that case.

Does not yet include changes for console I/O, and instead still
falls back to _read and _write in that case.  Also not yet included
is interruptible non-overlapped I/O, e.g. for unnamed pipes.

Thanks to Anton Kovalenko.

11 years agoImprove basic block ordering for some loops.
Lutz Euler [Wed, 17 Oct 2012 19:05:58 +0000 (21:05 +0200)]
Improve basic block ordering for some loops.

Currently the compiler rotates most loops to minimize branching costs,
but for some loops this actually has the opposite effect (i.e., larger
and slower code being generated), namely for those that already have the
termination test at the end.

So, inhibit loop rotation if such a loop is detected. The decision is
based upon whether the loop's back edge starts with a conditional branch
(don't rotate) or an unconditional branch (do rotate). This heuristic is
correct in simple cases but may err, e.g. if a loop has multiple back
edges. As we didn't try before and don't try now to analyse complex
loops to aid the decision whether to rotate or not, or even how far,
hopefully any differences introduced here will cancel on average with
respect to their impact on performance and code size.

(Loops consisting of only one basic block -- which necessarily have the
termination test at the end -- were (obviously) treated correctly
already. But even small loops can easily consist of multiple blocks, for
example if the loop body contains code from inlining a function call.)

11 years agoTypo and other small fixes in the manuals and the man page
Lutz Euler [Sat, 13 Oct 2012 19:11:43 +0000 (21:11 +0200)]
Typo and other small fixes in the manuals and the man page

That is, in the texinfo files of the user manual, the internals manual,
and in sbcl.1. Fix spelling and grammar errors, put sufficiently many
dots in abbreviations and consistently write "SBCL" in all caps in
prose. Also, SIGABORT should be SIGABRT.

11 years agoallow SB-CONTRIB operation without explicitly set CC
Nikodemus Siivola [Mon, 8 Oct 2012 05:49:41 +0000 (08:49 +0300)]
allow SB-CONTRIB operation without explicitly set CC

  Fall back to "cc" with a style-warning.

11 years agodon't close runtime dlhandle on Darwin
Nikodemus Siivola [Sun, 7 Oct 2012 12:20:21 +0000 (15:20 +0300)]
don't close runtime dlhandle on Darwin

  On newish Darwin it works, but some people still run old enough
  version that it won't work. As long as we're not explicitly checking
  for "Darwin new enough?", let's try not to break...

  Fixes lp#957385

11 years agomake it possible to run tests on an installed SBCL
Francois-Rene Rideau [Sat, 14 Apr 2012 16:09:46 +0000 (12:09 -0400)]
make it possible to run tests on an installed SBCL

 Allow override of SBCL location via TEST_SBCL_HOME,
 TEST_SBCL_RUNTIME, and TEST_SBCL_CORE.

 Allow override of temporary file location via TEST_DIRECTORY. (Some
 tests still write to /tmp, though -- so user beware!)

 Small unrelated whitespace / style-warning fixes.

11 years agoteach NODE-CONSERVATIVE-TYPE about union types
Nikodemus Siivola [Sun, 7 Oct 2012 11:12:59 +0000 (14:12 +0300)]
teach NODE-CONSERVATIVE-TYPE about union types

  Conservative type of STRING is STRING -- and this makes it so.

  Fixes lp#1050768 (but also future-proof ARRAY-IN-BOUNDS-P against
  '*) explicitly.

11 years agoKill a build warning about unreachable code in MAKE-SEQUENCE.
Lutz Euler [Sat, 6 Oct 2012 18:36:10 +0000 (20:36 +0200)]
Kill a build warning about unreachable code in MAKE-SEQUENCE.

Drop the T clause in a TYPECASE testing for ATOM, CONS and T as ATOM is
specified to be (NOT CONS) which the compiler well knows.

Break some overly long lines.

11 years agoFix some tests for builds without sb-eval.
Lutz Euler [Sat, 6 Oct 2012 16:56:19 +0000 (18:56 +0200)]
Fix some tests for builds without sb-eval.

Conditionalize on #+SB-EVAL test parts that bind *EVALUATOR-MODE* to
:INTERPRET. The affected tests are:
- compiler.pure.lisp / :multiple-args-to-function
- eval.impure.lisp / (eval :empty-let-is-not-toplevel)

11 years agountangle WITH-IR1-NAMESPACE and WITH-COMPILATION-VALUES
Nikodemus Siivola [Fri, 5 Oct 2012 05:26:47 +0000 (08:26 +0300)]
untangle WITH-IR1-NAMESPACE and WITH-COMPILATION-VALUES

 * Move the first out from the latter, and put parts of the first that
   belong in the latter there. They're sufficiently unrelated that
   it's just confusing. Also clarify why some stuff is in W-C-V and
   not W-IR1-N.

 * Places that need W-IR1-N: %COMPILE, COMPILE-LOAD-TIME-STUFF,
   CONVERT-AND-MAYBE-COMPILE. These are our topmost entry points into
   the convert & compile dance.

   ...and PROCESS-TOPLEVEL-LOCALLY, which needs to process
   declarations. We really should separate environment handling and
   compiler.

 * This also removes the unsightly (REMHASH NAME *FREE-FUNS*) hack
   from couple of places.

 * Move *SOURCE-PATHS* binding to WITH-SOURCE-PATHS (new), also
   sufficiently unrelated to be confusing.

 (This fixes the compiler.test.sh regression I managed to introduce.)

11 years agouse SB-EXT:EXIT in expect.sh instead of QUIT
Nikodemus Siivola [Thu, 4 Oct 2012 21:01:43 +0000 (00:01 +0300)]
use SB-EXT:EXIT in expect.sh instead of QUIT

11 years agofix PARSE-NATIVE-NAMESTRING :JUNK-ALLOWED T
Nikodemus Siivola [Thu, 4 Oct 2012 19:39:35 +0000 (22:39 +0300)]
fix PARSE-NATIVE-NAMESTRING :JUNK-ALLOWED T

 (and word-wrap NEWS)

11 years agofix GC-LOGFILE when none has been set
SANO Masatoshi [Wed, 3 Oct 2012 19:11:17 +0000 (22:11 +0300)]
fix GC-LOGFILE when none has been set

  ...and the return value from (SETF GC-LOGFILE).

11 years agomake walker tests happier
Nikodemus Siivola [Wed, 3 Oct 2012 20:40:01 +0000 (23:40 +0300)]
make walker tests happier

  Our improved handling of specials in the walker broke a few tests,
  investigation of which revealed a few further bogosities -- patch
  over the worst of them, partially in the walker, partially by fixing
  tests which expected bogus results.

  LET* walking is still slightly broken when it comes to specials,
  since it isn't properly recursive the way it has to be. Mark the
  test as expected to fail for now -- fixing it ASAP properly.

  (I must have managed to run tests in the wrong tree once again,
  since I didn't catch this before the last push. Sorry!)

11 years agofix structure stack allocation for high-debug code
Nikodemus Siivola [Thu, 27 Sep 2012 07:18:33 +0000 (10:18 +0300)]
fix structure stack allocation for high-debug code

  * Allow values to flow through casts in good-for-dx analysis.

  * Let-convert main-entry points for already inlined optional
    dispatches.

  * Don't preserve single-use debug vars in system-lambdas, no
    matter what the policy says.

  * Don't add INDEFINITE-EXTENT declarations to hairy entries without
    &REST arguments.

  * SB-C::REST-CONVERSION optimization declaration was pretty
    pointless, take it out.

  * Test our DX stuff in high-debug code as well.

11 years agox86-64: micro-optimize LEA DWORD-REG,EA
Nathan Froyd [Sat, 6 Oct 2012 04:04:25 +0000 (00:04 -0400)]
x86-64: micro-optimize LEA DWORD-REG,EA

If we are loading a DWORD EA into a DWORD register, we may not need the
REX prefix.  Unlikely to occur in current SBCL code, but does come up
when you're writing your own VOPs for 32-bit operations.

11 years agoUpdate tests for threaded windows builds
David Lichteblau [Tue, 18 Sep 2012 15:12:13 +0000 (17:12 +0200)]
Update tests for threaded windows builds

As with previous changes to the test keywords, some tests are marked
as expected failures or skipped, but merely to keep test suite
output clean; these failures are not expected to be permament and
shall be improved upon later.

11 years agoUse futexes on windows
David Lichteblau [Tue, 18 Sep 2012 15:12:11 +0000 (17:12 +0200)]
Use futexes on windows

11 years agoPreliminary work towards threads on win32
David Lichteblau [Tue, 18 Sep 2012 15:12:09 +0000 (17:12 +0200)]
Preliminary work towards threads on win32

  * Implement SB-THREAD

  * Support WITH-TIMEOUT, etc.

Implementation details:

  * Implement pthreads, futex API on top of Win32.
  * Adds support for the timer facility using sb-wtimer.
  * Implement an interruptable `nanosleep' using waitable timers.
  * Threading on Windows uses safepoints to stop the world.
    On this platform, either all or none of :SB-THREAD, :SB-SAFEPOINT,
    :SB-THRUPT, and :SB-WTIMER need to be enabled together.
  * On this platform, INTERRUPT-THREAD will not run interruptions
    in a target thread that is executing foreign code, even though
    the POSIX version of sb-thrupt still allows this (potentially
    unsafe) form of signalling by default.

Does not yet include interruptible I/O, which will be made available
separately.  Slime users are requested to build SBCL without threads
until then.

Note that these changes alone are not yet sufficient to make SBCL on
Windows an ideal backend.  Users looking for a particularly stable
or thread-enabled version of SBCL for Windows are still advised to
use the well-known Windows branch instead.

This is a merge of features developed earlier by Dmitry Kalyanov and
Anton Kovalenko.

11 years agoPort WITH-TLS-EA and other remaining FS prefix uses to Windows.
David Lichteblau [Wed, 13 Jul 2011 16:01:45 +0000 (18:01 +0200)]
Port WITH-TLS-EA and other remaining FS prefix uses to Windows.

- current-thread-offset-sap

- emit-single-step-test

- Allocation routines

- Disable PSEUDO-ATOMIC on threaded Windows entirely instead of
  changing TLS uses of pseudo-atomic-bits.  We would need a
  temporary register for those changes, and Windows threading is all
  safepoint-based, without the need to support asynchronous signals.

Thanks to Dmitry Kalyanov and Anton Kovalenko.

11 years agoDo not trash registers in tests/win32-stack-unwind.c
David Lichteblau [Fri, 5 Oct 2012 17:56:45 +0000 (19:56 +0200)]
Do not trash registers in tests/win32-stack-unwind.c

11 years agoRun sb-bsd-sockets tests on windows
David Lichteblau [Fri, 5 Oct 2012 17:37:28 +0000 (19:37 +0200)]
Run sb-bsd-sockets tests on windows

Previously, we did not attempt tests for this contrib on Windows at
all, presumably because this (otherwise functional) contrib would
have failed some tests and hence would not have been installed.

Instead, mark the remaining failures as expected, so that they get
reported without preventing installation of the contrib.

11 years agoReenable ALLOCATION-INFORMATION.4, mark as known failure
David Lichteblau [Fri, 5 Oct 2012 16:40:38 +0000 (18:40 +0200)]
Reenable ALLOCATION-INFORMATION.4, mark as known failure

It seems unlikely to me that the combination of features currently
identified as problematic is truly accurate.  More plausible seems
that ALLOCATION-INFORMATION is broken and needs a bug fix.  Yet the
warning now given should be clear enough and allow users to report
this issue.

11 years agoAllow use of SB-RT's mechanism for expected test failures in contribs
David Lichteblau [Mon, 24 Sep 2012 16:48:47 +0000 (18:48 +0200)]
Allow use of SB-RT's mechanism for expected test failures in contribs

... In RT, use the list of expected test failures not just for
    debugging output, but return as a primary result only whether
    there are unexpected failures, with additional result values for
    details on expected failures.

... Tweak make-target-contrib.sh so that the `test-passed' file, if
    non-empty, can indicate a `successful' build of the contrib with
    only known failures.

This mechanism is meant to follow in the footsteps of SBCL's main
test suite's mechanism for known failures, and is arguably not in
the original spirit of contribs as user contributions that must
build perfectly or fail to install entirely.  However, for parts of
contrib/ which are very commonly used as a part of SBCL, it is hoped
that this new mechanism will aid work toward bug fixes in those
contribs rather than de-emphasize it.

11 years agoSPARC gencgc
David Lichteblau [Fri, 28 Sep 2012 18:51:21 +0000 (20:51 +0200)]
SPARC gencgc

Based on Raymond Toy's work.

11 years agoPPC, SPARC cross-type build fix
David Lichteblau [Fri, 5 Oct 2012 13:21:44 +0000 (15:21 +0200)]
PPC, SPARC cross-type build fix

Thanks to Christophe Rhodes.

11 years agoupdate NEWS
Nikodemus Siivola [Wed, 3 Oct 2012 06:22:59 +0000 (09:22 +0300)]
update NEWS

11 years agofix walker handling of LET* bindings shadowing symbol macros
Nikodemus Siivola [Sun, 30 Sep 2012 12:33:23 +0000 (15:33 +0300)]
fix walker handling of LET* bindings shadowing symbol macros

  Don't remove variable bindings from lexenv, which would cause
  symbol-macros to be unshadowed.

  Also treat special bindings correctly -- this comes mostly down to
  processing declarations from the body before processing variable
  bindings.

11 years agomore debug output for the once-in-a-blue-moon cache flushing problem
Nikodemus Siivola [Sun, 30 Sep 2012 12:34:03 +0000 (15:34 +0300)]
more debug output for the once-in-a-blue-moon cache flushing problem

  ...was stupidly printing only 1/3rd of the intended amount of
  information. *sigh*

11 years agobind and clear *CONTINUATION-NUMBERS* &co in WITH-COMPILATION-VALUES
Nikodemus Siivola [Tue, 25 Sep 2012 11:16:16 +0000 (14:16 +0300)]
bind and clear *CONTINUATION-NUMBERS* &co in WITH-COMPILATION-VALUES

  This leaves CLEAR-STUFF empty, so delete it. \o/

11 years agobind and clear *LIST-CONFLICTS-TABLE* in LIST-CONFLICTS
Nikodemus Siivola [Tue, 25 Sep 2012 11:01:31 +0000 (14:01 +0300)]
bind and clear *LIST-CONFLICTS-TABLE* in LIST-CONFLICTS

11 years agobind and clear *SEEN-FUNS* and *SEEN-BLOCKS* in CHECK-IR1-CONSISTENCY
Nikodemus Siivola [Tue, 25 Sep 2012 10:52:23 +0000 (13:52 +0300)]
bind and clear *SEEN-FUNS* and *SEEN-BLOCKS* in CHECK-IR1-CONSISTENCY

11 years agomove clearing of *FREE-FUNS* &co to WITH-IR1-NAMESPACE where they're bound
Nikodemus Siivola [Tue, 25 Sep 2012 10:39:25 +0000 (13:39 +0300)]
move clearing of *FREE-FUNS* &co to WITH-IR1-NAMESPACE where they're bound

11 years agoremove world-lock from WITH-COMPILATION-UNIT
Nikodemus Siivola [Tue, 25 Sep 2012 10:30:59 +0000 (13:30 +0300)]
remove world-lock from WITH-COMPILATION-UNIT

   Add it to SUB-COMPILE-FILE and ACTUALLY-COMPILE instead.

11 years agosort *features*ish variable values for repeatability
Christophe Rhodes [Thu, 20 Sep 2012 18:38:46 +0000 (19:38 +0100)]
sort *features*ish variable values for repeatability

11 years agoone more stray GENSYM leading to fasl differences
Christophe Rhodes [Thu, 20 Sep 2012 15:55:40 +0000 (16:55 +0100)]
one more stray GENSYM leading to fasl differences

11 years agoslightly more reproducible builds
Christophe Rhodes [Thu, 20 Sep 2012 15:10:55 +0000 (16:10 +0100)]
slightly more reproducible builds

in vop templates, (:constant <type>) eventually boiled down to a TYPEP
test.  For (:constant fixnum) in the cross-compiler, this is not right,
because the typep test runs on the host.  Use SB!XC:TYPEP instead, which
means making sure that types are available to the cross-compiler (using
DEF!TYPE instead of DEFTYPE).  Tested on x86-64; one issue on ppc fixed
blindly.

11 years agoallow builds with :trace-file flags even with non-sbcl host compilers
Christophe Rhodes [Thu, 20 Sep 2012 15:10:13 +0000 (16:10 +0100)]
allow builds with :trace-file flags even with non-sbcl host compilers

:allow-other-keys t is a marvellous thing

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.