David Lichteblau [Tue, 4 Sep 2012 15:15:31 +0000 (17:15 +0200)]
Mention sb-safepoint, sb-thruption in base-target-features.lisp-expr
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Lutz Euler [Sun, 12 Aug 2012 18:17:17 +0000 (20:17 +0200)]
Add some missing launchpad references to NEWS.
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*
David Lichteblau [Fri, 10 Aug 2012 19:05:40 +0000 (21:05 +0200)]
Remove executable mode from several source files
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.
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.
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.
Juho Snellman [Mon, 6 Aug 2012 20:42:39 +0000 (22:42 +0200)]
Fix NEWS
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"
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.
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
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.
Juho Snellman [Fri, 27 Jul 2012 10:31:26 +0000 (12:31 +0200)]
Update to asdf 2.23
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.
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.
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.
David Lichteblau [Wed, 18 Jul 2012 17:42:13 +0000 (19:42 +0200)]
Temporarily disable problematic exhaust tests on Windows
David Lichteblau [Thu, 7 Jul 2011 15:01:11 +0000 (17:01 +0200)]
Use preprocessor includes for link_or_copy on Windows
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.
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.
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.
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.
David Lichteblau [Fri, 17 Jun 2011 11:30:14 +0000 (13:30 +0200)]
Use %p for pthread pointers in debugging output
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).
David Lichteblau [Mon, 18 Jun 2012 13:22:35 +0000 (15:22 +0200)]
Make run-sbcl.sh executable
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.
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.
David Lichteblau [Sat, 9 Jun 2012 22:12:21 +0000 (00:12 +0200)]
Fix typo in whitespacely-canonical-filenames
Thanks to Lutz Euler.
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.
Nikodemus Siivola [Sat, 9 Jun 2012 20:35:01 +0000 (23:35 +0300)]
add .mailmap so "git shortlog -ns" counts properly
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.
Nikodemus Siivola [Sat, 9 Jun 2012 17:39:47 +0000 (20:39 +0300)]
test backtrace-interrupted-condition-wait works on Darwin/x86 as well
Nikodemus Siivola [Sat, 9 Jun 2012 17:31:27 +0000 (20:31 +0300)]
a few more tests to skip 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.
Nikodemus Siivola [Sat, 9 Jun 2012 12:25:01 +0000 (15:25 +0300)]
test backtrace-interrupted-condition-wait works on Darwin/x86-64
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.
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.
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.
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.
David Lichteblau [Fri, 8 Jun 2012 14:19:01 +0000 (16:19 +0200)]
Update NEWS
Minor SPARC and PPC fixes.
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.
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.
David Lichteblau [Wed, 6 Jun 2012 14:23:26 +0000 (16:23 +0200)]
In whitespace canonicalization, find a suitable make automatically
David Lichteblau [Thu, 7 Jun 2012 21:49:34 +0000 (23:49 +0200)]
Simplify ppc's MOVE-TO-WORD/INTEGER
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.
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.
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.
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.
Lutz Euler [Wed, 6 Jun 2012 14:30:51 +0000 (16:30 +0200)]
Small enhancements to ISQRT
Replace MULTIPLE-VALUE-LIST with MULTIPLE-VALUE-BIND which conses less
and is slightly faster.
Correct the docstring.
Add a test for correctness.
Stas Boukarev [Mon, 4 Jun 2012 17:24:46 +0000 (21:24 +0400)]
Restore build on sparc/solaris.
gc-internal.h: include interr.h before `lose' is used.
Fixes lp#1008506.
Nikodemus Siivola [Wed, 23 May 2012 05:47:54 +0000 (08:47 +0300)]
emit compiler notes of NLX value-cells when (> SPEED SAFETY)
People have a right to know: it's NEWS.
Nikodemus Siivola [Mon, 21 May 2012 20:30:54 +0000 (23:30 +0300)]
elide value cells for NLXs when it seems like the right thing
Previously we only did this for unsafe code.
Now we also elide them for
(1) exits from DX functions: if a DX function escapes its proper context,
trying to perform NLX to a stale tag is the least of our worries.
(2) functions that cannot escape. Since the escape analysis isn't yet very
tested, disable it for safe code, though. If this raises hairs on your
neck, consider this: even if our analysis is wrong, and a function we
didn't think could escape does, we're in the land of "undefined
consequences" anyways.
If you're wondering if this is worth it, compare
(defun feh (x)
(flet ((meh () (return-from feh 'meh)))
(typecase x
(cons (or (car x) (meh)))
(t (meh)))))
(time (loop repeat 10000 do (feh t)))
with and without the escape analysis.
Nikodemus Siivola [Sun, 27 May 2012 12:38:45 +0000 (15:38 +0300)]
update NEWS
MAP-INTO improvements.
DOSEQUENCE improvement.
Move optimizations above bugs.
Nikodemus Siivola [Sun, 27 May 2012 10:44:12 +0000 (13:44 +0300)]
add DO-VECTOR-DATA, remove special case from VECTOR-MAP-INTO
DO-VECTOR-DATA is like DOVECTOR, but uses WITH-ARRAY-DATA and grabs the
right reffer function so there's no per-element dispatch.
Since MAP used DOSEQUENCE for for-effect/arity-1 case, and DOSEQEUNCE in
turn uses DOVECTOR, replacing DOVECTOR there with DO-VECTOR-DATA we get the
a performance boost while being able to drop the special case in
VECTOR-MAP-INTO.
Add a test for which the special case was broken: mapping a list into a
vector.
Nikodemus Siivola [Sun, 27 May 2012 09:48:43 +0000 (12:48 +0300)]
move vm-array.lisp earlier in the build, remove %%SAETP-INFO%%
This way DEFINE-ARRAY-DISPATCH can use *S-A-E-T-P* directly.
James M. Lawrence [Thu, 24 May 2012 01:33:07 +0000 (21:33 -0400)]
widetag dispatch for MAP-INTO
James M. Lawrence [Thu, 24 May 2012 01:33:07 +0000 (21:33 -0400)]
automate widetag dispatching
* add DEFINE-ARRAY-DISPATCH
* replace the VECTOR-SUBSEQ* dispatch scaffolding
with a DEFINE-ARRAY-DISPATCH call
James M. Lawrence [Thu, 17 May 2012 23:16:54 +0000 (19:16 -0400)]
fix MAP-INTO performance
* remove the O(n^2) algorithm for lists
* use (MAP NIL ...) for all sequence types
* avoid unnecessary LENGTH calls
* update fill pointer after mapping succeeds, not before
* add tests for MAP-INTO (there were none!)
* add some WITH-TESTs to tests/map-tests.impure.lisp
Lutz Euler [Fri, 25 May 2012 15:09:50 +0000 (17:09 +0200)]
Add a missing launchpad reference to NEWS.
Lutz Euler [Fri, 25 May 2012 14:56:49 +0000 (16:56 +0200)]
Use multi-byte NOPs for code alignment on x86-64.
This is intended to speed up execution of such code sequences. It makes
the disassembly output somewhat more readable, too. The multi-byte NOP
instructions are chosen according to the recommendations of both AMD and
Intel. All existing x86-64 processors should support the "0f 1f" opcode
used.
This adds the needed infrastructure to the backend-independent compiler
parts and uses it from x86-64. Backends not using this functionality are
left unchanged.
Extend EMIT-ALIGNMENT to allow to specify multi-byte NOPs to be used
instead of repetitions of the single-byte NOP and change the call in
EMIT-BLOCK-HEADER on x86-64 to trigger this. Extend EMIT-SKIP to call
EMIT-LONG-NOP in this case.
On x86-64, add EMIT-LONG-NOP as the instruction emitter and extend the
disassembler entry for NOP to understand the multi-byte forms, too.
Make EMIT-FILLER decide more carefully whether to join fillers that are
adjacent in the list of segment annotations: Only join them if they are
immediately adjacent in the segment, too. (Otherwise the joined filler
would cover the wrong parts of a shortened alignment sequence.)
In certain circumstances %EMIT-ALIGNMENT splits an alignment into two
parts. This may not be necessary but has not yet been changed, so
sometimes one more long NOP than needed is assembled.
Stas Boukarev [Wed, 23 May 2012 06:01:03 +0000 (10:01 +0400)]
gensym: Don't restrict numerical argument to fixnum.
(gensym number) was restricted to fixnums, restrict it to
unsigned-byte, as per the standard.
Nikodemus Siivola [Mon, 21 May 2012 20:27:53 +0000 (23:27 +0300)]
better SIGNAL
Add *STACK-TOP-HINT*.
Move out the *BREAK-ON-SIGNALS* stuff to a separate function for
clarity. Conditionalize the call there, meaning those restarts don't need to
be allocated unless we actually need them -- making SIGNAL faster and a lot
less consy. (TYPEP calls still cons, though. Can't have everything...)
Stas Boukarev [Tue, 22 May 2012 18:39:07 +0000 (22:39 +0400)]
run-program: Don't use /tmp unconditionally.
* Use TEMP on win32 and TMPDIR on non-win32.
* Don't delete just opened temporary files on windows, because opened
files cannot be unlinked on windows.
Fixes lp#968837.
Stas Boukarev [Tue, 22 May 2012 18:06:06 +0000 (22:06 +0400)]
run-program: Don't decode and re-encode environ.
Leave environ unchanged when no :environment argument is provided.
Closes lp#985904.
Cyrus Harmon [Mon, 21 May 2012 06:22:24 +0000 (23:22 -0700)]
implicit generic function warning improvement
the warning now prints out the package of the symbol that corresponds
to the newly created generic function.
Nikodemus Siivola [Mon, 21 May 2012 18:39:02 +0000 (21:39 +0300)]
some nincompoop broke the build
*blush*
Nikodemus Siivola [Sun, 20 May 2012 17:11:29 +0000 (20:11 +0300)]
make ENSURE-GENERIC-FUNCTION accept method combination arguments
Previously we only accepted a list designating the method combination, but
since MOP also specifies a way to grab the actual method combination, we
should really accept that as well.
Fixes bug 936513.
Nikodemus Siivola [Thu, 17 May 2012 12:22:22 +0000 (15:22 +0300)]
fix source information for functions from EVAL
* Removed the breathtaking (NAMED-LAMBDA (EVAL (DEFUN FOO)) ...) hack, which
caused inconsistent source locations, and broke the built-in debugger
source command for evaluated functions.
Replace it with *SOURCE-FORM-CONTEXT-ALIST*, which allows the simple
evaluator to communicate the original context to the compiler without
messing with the function source.
This also means we no longer have to wrap named-lambdas and lambdas in
another lambda, but can instead compile them directly -- which in turn
allows FUNCTION-LAMBDA-EXPRESSION to work correctly for definitions from
EVAL and LOAD.
* Additionally, use a handler to muffle any compiler notes from EVAL instead
of using a declaration: those can leak to the user via F-L-E.
* Change ACTUALLY-COMPILE to return a function signaling an error instead of
returning NIL when compilation fails fatally. Doing this in
ACTUALLY-COMPILE allows us to rely on COMPILE-IN-LEXENV always returning a
function, and gives easy access to a better error message.
* Properly associate COMPILER-ERRORS with their SIGNAL-ERROR restart.
* Adjust debug.impure.lisp to be less dependent on the details of
%SIMPLE-EVAL.
* Test cases. Pay special attention to TEST-DEBUGGER in debug.impure.lisp.
* New docstring for COMPILE. Added a sneaky teaser about COMPILE being able
to recompile things, which is new starting to look feasible.
Nikodemus Siivola [Sat, 19 May 2012 11:57:06 +0000 (14:57 +0300)]
refactor GET-TOPLEVEL-FORM &co between debugger and disassembler
* Merge the implementations in debug.lisp and target-disassembler.lisp.
* Get rid of most of the cacheing.
* Prefer the DEBUG-SOURCE-FORM if it exists: thanks to *SOURCE-NAMESTRING*
we can have misleading namestrings for functions generated by calls to
EVAL during LOAD, etc.
Nikodemus Siivola [Sat, 19 May 2012 14:09:12 +0000 (17:09 +0300)]
robustify COUNT-FULL-CALLS in the test suite
Move it to compiler-test-utils.lisp, while at it.
Nikodemus Siivola [Sat, 19 May 2012 08:44:03 +0000 (11:44 +0300)]
lazy *STACK-TOP-HINT*s
Allow binding it to a symbol, which is resolved when entering the debugger:
it denotes the name of the first uninteresting frame.
This simplifies ERROR, CERROR, BREAK, %BREAK, and makes interrupts more
efficient as we no longer need to find the interrupted frame when entering
an interupt handler.
It also makes (handler-bind ((error #'invoke-debugger)) ...) once again gain
the benefits of the stack top hint, which we lost when we ceased the provide
the hint around the call to SIGNAL for efficiency reasons. Best of both
worlds, one hopes.
Nikodemus Siivola [Sat, 19 May 2012 12:28:41 +0000 (15:28 +0300)]
factor debug-name cleaning into a separate function
We will need it elsewhere too.
Nikodemus Siivola [Fri, 18 May 2012 19:42:17 +0000 (22:42 +0300)]
COMPILED-PROGRAM-ERROR source form needs *PRINT-ESCAPE*
PRINC-TO-STRING is not what we want here.
Nikodemus Siivola [Tue, 15 May 2012 21:53:51 +0000 (00:53 +0300)]
implement ATOMIC-UPDATE
Nicer than having to write explicit CAS loops.
Also improve COMPARE-AND-SWAP docstring, and remove the EXPERIMENTAL label
from it.
Nikodemus Siivola [Sun, 20 May 2012 09:25:25 +0000 (12:25 +0300)]
break infinite recursion in GENERATE-SLOTD-TYPECHECK
Compilation of a typecheck can cause class finalization, which in turn can
cause calls to GENERATE-SLOTD-TYPECHECK.
Given the right sort of dependency graph, this can cause a cycle which needs
to be broken.
Regression from 1.0.46.11, fixed bug 1001799.
Juho Snellman [Sun, 20 May 2012 18:55:37 +0000 (20:55 +0200)]
1.0.57: will be tagged as "sbcl-1.0.57"
Stas Boukarev [Thu, 17 May 2012 21:10:13 +0000 (01:10 +0400)]
Fix build on windows.
* Include sbcl.h before LISP_FEATURE_WIN32 is used in coreparse.c
* Include stub for _exit.
Stas Boukarev [Wed, 16 May 2012 22:51:51 +0000 (02:51 +0400)]
define-condition: return the name of the defined condition.
Stas Boukarev [Wed, 16 May 2012 16:30:04 +0000 (20:30 +0400)]
Better error for malformed type declarations.
Give proper error messages for things like
(declare (type (integer 1 . 2) a)).
Stas Boukarev [Wed, 16 May 2012 15:04:21 +0000 (19:04 +0400)]
Better error message for malformed IGNORE declarations.
Give better errors for things like (ignore (a)) and
(ignore (function . b)).
Fixes lp#1000239.
Stas Boukarev [Mon, 14 May 2012 01:12:45 +0000 (05:12 +0400)]
Optimize copy-tree.
copy-tree used to always call itself, even on linear lists, which
caused stack exhaustion on long lists. Make it copy linear lists
linearly, and recur only when necessary. This also makes it somewhat
faster.
Fixes lp#98926.
Christophe Rhodes [Sat, 12 May 2012 12:40:24 +0000 (13:40 +0100)]
open intervals and type derivation
When dealing with open intervals, preserving the openness of a bound in
a result depends on the operation being strictly monotonic, rather than
merely monotonic. However, many operations which at first sight seem
strictly monotonic are in fact not, including:
- squaring (expt least-positive-double-float 2) = (expt 0d0 2)
- coercion (coerce (1+ double-float-epsilon) 'single-float)
= (coerce 1d0 'single-float)
Modify various coercion and interval functions to include conservatism
in these situations. (Fixes lp#997528)
Stas Boukarev [Wed, 9 May 2012 22:47:03 +0000 (02:47 +0400)]
Fix --dynamic-space-size 1GB on x86.
Use unsigned longs instead of signed longs for handling
--dynamic-space-size, on x86 it can easily be exhausted.
Stas Boukarev [Mon, 7 May 2012 12:18:33 +0000 (16:18 +0400)]
Optimize truncate, ceiling and friends when divisor is 1 or -1.
If divisor is 1, return (values x 0), if it's -1 (values (- x) 0). If
it's a floating point truncation, like ftruncate or fceiling,
(values (- (float x)) 0).
Stas Boukarev [Sat, 5 May 2012 09:38:21 +0000 (13:38 +0400)]
Update ASDF to 2.21.
Fixes lp#982286.