Nikodemus Siivola [Tue, 23 Aug 2011 17:01:37 +0000 (20:01 +0300)]
optimize pretty-printing strings and bit-vectors
Since strings and bit-vectors use the ugly output in any case,
exlude them from using PPRINT-ARRAY -- so we don't need to cons up a
pretty stream when printing strings while *PRINT-PRETTY* is true.
Nikodemus Siivola [Mon, 22 Aug 2011 14:46:20 +0000 (17:46 +0300)]
oops, fix recent NANOSLEEP change
If the sleep gets interrupted multiple times on Darwin:
update SECS and NSECS each round.
Nikodemus Siivola [Mon, 22 Aug 2011 11:08:30 +0000 (14:08 +0300)]
NEWS for 5 last commits
Nikodemus Siivola [Mon, 22 Aug 2011 10:30:17 +0000 (13:30 +0300)]
update to ASDF 2.017
Nikodemus Siivola [Wed, 17 Aug 2011 09:28:29 +0000 (12:28 +0300)]
ignore non-function FTYPEs
Fixes lp#738464.
Give a style-warning and ignore the bad type.
Nikodemus Siivola [Tue, 16 Aug 2011 17:58:41 +0000 (20:58 +0300)]
non-consing NANOSLEEP
...and hence SLEEP as well.
Nikodemus Siivola [Tue, 16 Aug 2011 11:26:28 +0000 (14:26 +0300)]
extend ARRAY-TYPE-UPGRADED-ELEMENT-TYPE to work with member types
Fixes lp#826971.
Nikodemus Siivola [Mon, 15 Aug 2011 21:21:54 +0000 (00:21 +0300)]
use WEAKEN-INTEGER-TYPE in ARRAY-IN-BOUNDS-P
The type of the bound might be a union-type. WEAKEN-INTEGER-TYPE
gives us the ends of a range.
lp#826970
Juho Snellman [Sat, 20 Aug 2011 23:15:10 +0000 (01:15 +0200)]
1.0.51: will be tagged as "sbcl-1.0.51"
Nikodemus Siivola [Mon, 15 Aug 2011 11:33:49 +0000 (14:33 +0300)]
fix bogus deadlocks from interrupts and GCs
lp#807475
Going in despite the freeze since this is a regression that can
semi-randomly break correct code. *ouch*
Thanks to Bart Bortta and #sbcl for the analysis.
Problem 1:
T1 holds L1
T2 is waiting for L1
T2 is interrupted, interrupt handler grabs L2
T1 starts waiting on L2
Prior to this patch, when GET-MUTEX in T2's interrupt handler grabbed
L2 is marked T2 as still waiting for L1 -- which is not true until
the interrupt handler returns.
Problem 2:
T1 holds L1
T2 is waiting for L1
GC is triggered in T2 inside GET-MUTEX
T2 grabs *ALREADY-IN-GC* lock
GC is triggered in T1, T1 tries to get *ALREADY-IN-GC* lock.
Prior to this patch, when T1 detects a bogus deadlock as T2 has
been marked as waiting for L1 -- which is not true until the GC is
finished and normal execution resumes.
Problem 3:
T1 holds L1
T2 is waiting for L1
GC is triggered in T2 inside GET-MUTEX
T2 grabs lock L2 due to a finalizer or an after-gc-hook
GC is triggered in T1
T1 tries to grab L2 due to a finalizer, etc.
Same as problem 2, but with a user-lock and POST-GC instead of
*ALREADY-IN-GC* and SUB-GC.
This patch fixes the issue by saving, clearing, and restoring
the waiting-for mark in
1) interrupt handlers
2) SUB-GC
3) POST-GC
Paul Khuong [Sun, 14 Aug 2011 23:27:42 +0000 (19:27 -0400)]
Fix automatic &rest to &more conversion in unsafe code
Applying &rest lists to known/typed functions can lead to a
:fixed values call to %more-arg-values. In that case, unroll
it into several %more-arg of constant indices.
Reported, with test case, by Lutz Euler (lp#826459).
Paul Khuong [Sun, 14 Aug 2011 22:31:52 +0000 (18:31 -0400)]
New function: SB-EXT:SPIN-LOOP-HINT
Some architectures have developed ways to help the processor execute
spin loops efficiently; expose them, where applicable, via
SB-EXT:SPIN-LOOP-HINT.
Assembles to PAUSE on x86oids, and to nothing on other platforms.
Paul Khuong [Sun, 14 Aug 2011 21:32:27 +0000 (17:32 -0400)]
Missing NEWS entry for 4e431db
Also, missing credit for Lutz Euler's bug report on a7b24b5.
Paul Khuong [Sun, 14 Aug 2011 21:28:22 +0000 (17:28 -0400)]
Handle SIMPLE-TYPE-ERROR when propagating bounds
Type conversions (e.g. bignum to float) may signal a
SIMPLE-TYPE-ERROR rather than returning an infinity.
Treat that case like an unknown value.
Add two tests.
Fixes lp#819269.
Paul Khuong [Sun, 14 Aug 2011 20:49:27 +0000 (16:49 -0400)]
New function: SB!KERNEL:%MULTIPLY-HIGH
* Does the same thing as only returning the first value of %MULTIPLY,
only better on some platforms.
* Implemented vas VOPs on x86, x86-64 and PPC. The PPC code sequence
is fully untested, and merely looks correct.
* VOPs for fixnum first argument are included, but will only be used
when the result is forcibly marked as fixnum, e.g., with TRULY-THE.
Questionnable, but I'd rather err on the side of straightforwardness
rather than put even more pressure on representation selection.
* Use it in the division-by-multiplication transform for unsigned
TRUNCATE by constant.
Paul Khuong [Sun, 14 Aug 2011 20:46:01 +0000 (16:46 -0400)]
More efficient integer division by multiplication
* Exploit restricted range for inputs (e.g. fixnums).
* When the divisor is even, simplify with a mask instead of a shift.
* Clean up the code a bit: we don't want modular arithmetic, it's
actually all guaranteed not to wrap around.
* Change the test so that larger divisors are a bit more likely to
get tested too.
* Lots more things can be done, including generalizing the transform
to pretty much arbitrary rational divisor, or avoiding the costly
general code sequence in nearly all cases. Unfortunately, it's a
lot of (somewhat original, at that) code, and can be fairly slow;
if it matters to someone, I can try and find a compromise (contrib?).
Paul Khuong [Sun, 14 Aug 2011 17:34:13 +0000 (13:34 -0400)]
Various (mostly) SSE x86-64 instruction definition fixes and additions
* Fix typos in mnemonics and non-temporal store definitions;
* Add some instructions;
* CLFLUSH was totally broken.
Taken from Alexander Gavrilov's SSE intrinsics branch.
Nikodemus Siivola [Sat, 13 Aug 2011 11:31:17 +0000 (14:31 +0300)]
fix DESCRIBE on compiled closures from EVAL
lp#824974
Christophe Rhodes [Fri, 12 Aug 2011 12:57:51 +0000 (13:57 +0100)]
allow user-defined STRING synonyms in MAKE-SEQUENCE
...and MAP, MERGE, COERCE and CONCATENATE too. This also meant
working a bit on TYPEXPAND, to make (STRING <N>) be unexpanded in the
same way as STRING, and consequently on VALUES-SPECIFIER-TYPE to
ensure that the system would still recognize those types.
Include test cases for the sequence functions but not for TYPEXPAND.
Stas Boukarev [Thu, 11 Aug 2011 23:21:23 +0000 (03:21 +0400)]
Declaim sb-di::valid-lisp-pointer-p inline.
Making it inline prevents from creating a SAP, and thus reduces
consing and improves performance. It's called a lot by
map-allocated-objects when GCing is disabled, so consing less is a
desirable property.
Reported by `lisper' on #lisp
David Lichteblau [Thu, 11 Aug 2011 19:08:09 +0000 (21:08 +0200)]
Fix QUERY-FILE-SYSTEM for Windows UNC and device file names
Thanks to Anton Kovalenko.
Anton Kovalenko [Wed, 18 Aug 2010 21:40:26 +0000 (01:40 +0400)]
sb-bsd-sockets: Fix error code handling on Windows
Factored out into a new function for the win32-specific
WSAGetLastError call.
Run-time results now match the existing constant definitions.
Thanks to Anton Kovalenko.
David Lichteblau [Wed, 10 Aug 2011 18:05:06 +0000 (20:05 +0200)]
sb-simple-streams: In test lp491087, merge the pathname
Needed for Windows.
Thanks to Anton Kovalenko.
David Lichteblau [Wed, 10 Aug 2011 14:50:29 +0000 (16:50 +0200)]
sb-simple-streams: Close files before deleting them on revert
Thanks to Anton Kovalenko.
Anton Kovalenko [Tue, 29 Mar 2011 11:55:42 +0000 (15:55 +0400)]
sb-simple-streams: use the Windows file mapping API for memory-mapped files
Thanks to Anton Kovalenko.
David Lichteblau [Wed, 10 Aug 2011 12:58:21 +0000 (14:58 +0200)]
sb-posix: in win32 tests, avoid certain hardcoded file names
stat.5: Create a fresh file instead of hardcoding c:\pagefile.sys
(was c:\config.sys until recently; was /bin/sh originally).
rmdir.error.3: Use %windir% instead of c:\.
Tests now pass with Wine on my system without local workarounds.
Anton Kovalenko [Tue, 8 Mar 2011 23:36:35 +0000 (02:36 +0300)]
sb-posix: redefined test rmdir.error.3 to accept ENOTEMPTY for win32
Thanks to Anton Kovalenko.
Anton Kovalenko [Thu, 7 Oct 2010 00:37:07 +0000 (04:37 +0400)]
sb-win32: offer low-level bindings for file mapping functions
Includes functions offered by Windows that are similar in
spirit to mmap.
Currently these are low-level FFI versions only, and no attempt
is made to export them from sb-posix under the name mmap. In
sb-posix, only a wrapper for msync and definitions of several
constants is offered, as needed for sb-simple-streams.
Thanks to Anton Kovalenko.
Also take this opportunity to sort the sb-win32 package
definition as a flat list.
Anton Kovalenko [Wed, 13 Oct 2010 23:18:06 +0000 (03:18 +0400)]
Avoid some exceptions in WAIT-UNTIL-FD-USABLE on Windows
Always report the :output direction as usable on win32.
Fixes this function as needed for sb-simple-streams.
Thanks to Anton Kovalenko.
David Lichteblau [Tue, 9 Aug 2011 18:51:06 +0000 (20:51 +0200)]
Tweak os_validate to support running SBCL on recent versions of Wine
SBCL now builds and runs on Wine reliably.
Credits: Fix developed by Anton Kovalenko.
Nikodemus Siivola [Wed, 10 Aug 2011 10:36:36 +0000 (13:36 +0300)]
generate-version.sh fixes
Make it work with detached heads and historical builds.
Previously a detached head broke the build, and trying to
do
git checkout master; git reset --hard sbcl-1.0.50; sh make.sh
got the version number wrong.
William Halliburton [Sun, 13 Feb 2011 19:01:17 +0000 (12:01 -0700)]
fix initial FILE-POSITION for OPEN :IF-EXISTS :APPEND
For O_APPEND opened files, lseek returns 0 until first write.
So we jump ahead initially.
lp#561642
David Lichteblau [Tue, 9 Aug 2011 14:45:13 +0000 (16:45 +0200)]
New toplevel options --quit and --non-interactive
Implements lp#822712.
David Lichteblau [Tue, 9 Aug 2011 14:45:10 +0000 (16:45 +0200)]
Make test toplevel.sh usable
Move toplevel.sh to toplevel.test.sh (where run-tests.sh expects it).
Move one of the tests to script.test.sh (where needed helper files
are set up).
David Lichteblau [Tue, 9 Aug 2011 14:45:05 +0000 (16:45 +0200)]
Document further common toplevel options
--sysinit and --userinit had already been documented.
Now also document the remaining toplevel options for consistency.
Note that --help shows short one-line comments, hence no attempt is
made to sync them with the manpage fully.
Nikodemus Siivola [Tue, 9 Aug 2011 10:37:14 +0000 (13:37 +0300)]
sb-bsd-sockets: less SERVE-EVENT
Socket streams no longer participate in SERVE-EVENT by default.
Adjust MAKE-SOCKET-STREAM docstring for clarity.
Nikodemus Siivola [Tue, 9 Aug 2011 07:57:41 +0000 (10:57 +0300)]
LOAD-TIME-VALUE improvements
* Derive the type of :TOPLEVEL lambdas properly. Without this we were
never able to utilize the type from COMPILE-LOAD-TIME-STUFF.
* Use the source-type whenever it is more accurate than the type from
COMPILE-LOAD-TIME-STUFF -- eg. when using a value cell.
* Add ALIAS argument to IR1-CONVERT, allowing saving alternate forms
into *CURRENT-PATH*: this allows
(defparameter *var* 10)
(compile nil '(lambda () (the list (load-time-value *var*))))
to give the warning
; Derived type of *VAR* is
; (VALUES (INTEGER 10 10) &OPTIONAL),
; conflicting with its asserted type
; LIST.
instead of the much less useful
; Constant 10 conflicts with its asserted type LIST.
* Use THE-IN-POLICY directly in LOAD-TIME-VALUE, allowing the file-
compiler to report the LOAD-TIME-VALUE form for type-conflicts
instead of (TRULY-THE <type> (%LOAD-TIME-VALUE ...))
Nikodemus Siivola [Mon, 8 Aug 2011 10:48:24 +0000 (13:48 +0300)]
better type propagation for MULTIPLE-VALUE-BIND
Previously code such as
(multiple-value-bind (x y) (known-call ...)
...)
could lose the derived type for KNOWN-CALL when it was converted to
an inline lambda: the derived type correctly ended up associated
with the final VALUES call in the inlined code, but
CONVERT-MV-BIND-TO-LET lost that.
Address this by propagating the derived type of VALUES to the
VALUES arguments.
Allows removing the TRULY-THE kludge from the new TRUNCATE
transform.
Paul Khuong [Sat, 6 Aug 2011 21:34:27 +0000 (17:34 -0400)]
Remove non-ASCII characters in comments
It breaks some people's builds (especially on !SBCL).
Nikodemus Siivola [Fri, 5 Aug 2011 09:58:38 +0000 (12:58 +0300)]
implement CEILING and FLOOR in terms of %CEILING and %FLOOR
This allows transforms specific to CEILING and FLOOR fire first.
If they fail, the fallback transforms to %CEILING or %FLOOR,
respectively.
They in turn are inlined, allowing the transforms for TRUNCATE
to pick up the slack.
This allows the new division -> multiplication transforms to fire
for CEILING and FLOOR when SPACE > 1.
Nikodemus Siivola [Fri, 5 Aug 2011 11:56:00 +0000 (14:56 +0300)]
rename %FLOOR to %BIGFLOOR
Lutz Euler [Mon, 25 Jul 2011 00:47:43 +0000 (02:47 +0200)]
Optimize integer division by a constant in several cases.
Convert integer division by a constant into multiplication to gain
a large speedup as the machine instructions for multiplication are
typically executed much faster than those for division.
This is implemented using a deftransform on TRUNCATE that triggers
if the dividend is known to fit in an unsigned machine word and if
the divisor is a constant, also fitting in an unsigned machine word.
(The cases that are optimized by other existing transforms, for example
if the divisor is a power of two, are left to these transforms.)
The replacement code is based on a widening multiply (that is already
available as bignum calculations need it) and possibly some shifts and
an addition to calculate the quotient. If the remainder is needed,
additionally a (normal) multiplication and a subtraction are generated.
As several other integer division operations are implemented using
TRUNCATE, this also affects CEILING, FLOOR, MOD and REM with the same
argument types. CEILING and FLOOR, however, are optimized only when
SAFETY=0 since they are declared MAYBE-INLINE.
Nikodemus Siivola [Fri, 5 Aug 2011 09:05:24 +0000 (12:05 +0300)]
export MOST-POSITIVE-WORD from SB-EXT
We need it internally anyways, and since we export the WORD type, we
might just as well export the constant too.
Nikodemus Siivola [Fri, 5 Aug 2011 08:44:33 +0000 (11:44 +0300)]
skip interrupted-syscall test on unthreaded builds
...and rename it backtrace-interrupted-condition-wait.
Duh.
Robert Brown [Fri, 8 Jul 2011 18:40:31 +0000 (14:40 -0400)]
sb-bsd-sockets: add support for Linux TCP keep alive options
Lutz Euler [Wed, 29 Jun 2011 16:32:46 +0000 (18:32 +0200)]
Correct function argument name generation in DEF-MATH-RTN
Argument names of math functions defined using DEF-MATH-RTN now really
start with "ARG0". Kills a style warning during build and slightly
reduces the number of symbols in the SB-KERNEL package.
Roman Marynchak [Thu, 26 May 2011 16:38:34 +0000 (19:38 +0300)]
Remove the redundant bootstrap hack from %COMPILER-DEFTYPE
Roman Marynchak [Sun, 8 May 2011 10:41:13 +0000 (13:41 +0300)]
move checking for constant ALIEN-INFO into a separate function
Introducing CONSTANT-ALIEN-INFO-OR-ABORT.
Nikodemus Siivola [Thu, 4 Aug 2011 10:31:06 +0000 (13:31 +0300)]
fix short writes when not using SERVE-EVENT
Regression since 1.0.42.43, lp#820599.
Thanks to Robert Brown.
If we remain in the loop, we need to update the local HEAD
variable in the event of a short write.
NOTE: No test case yet, as this is dependant on the size of kernel
buffers, and trying to catch the short-write -case is tricky.
Paul Khuong [Wed, 3 Aug 2011 14:20:41 +0000 (10:20 -0400)]
Fix version string parsing for Linux 3.0
Stop assuming the presence of minor and patch version numbers; missing
values are defaulted to 0 (e.g. 3.0.0).
Reported by a few people on IRC.
Paul Khuong [Mon, 1 Aug 2011 18:06:28 +0000 (14:06 -0400)]
Fix disassembly of CMP[PS][SD] instructions on x86-64
The relevant instruction formats wrongly defined a fixed position for
the immediate byte which broke disassembly when a memory argument was
used.
Fix this by using a prefilter to read the immediate like most other
instructions do.
Refactor for more OAOO-ness: Drop the instruction formats that were
used only for these comparison instructions; instead use others that
are nearly identical. This forces more copy-and-paste in the printer
definitions, so instead abstract the generation of printer lists for
SSE instructions into a separate function and use that here.
Add tests.
Fixes lp#814702.
Patch by Lutz Euler.
Nikodemus Siivola [Mon, 1 Aug 2011 13:46:26 +0000 (16:46 +0300)]
more robust backtraces for syscalls on x86
* new optimization policy: ALIEN-FUNCALL-SAVES-FP-AND-PC Set to 3 for
self-build on x86 to get reliable more backtraces there, and 0 for
other platforms. (1 matches the old SPEED <= DEBUG behaviour.)
* When using a saved FP, and an interrupt context has a bogus
FP, assume it is an interrupted syscall frame.
Nikodemus Siivola [Mon, 1 Aug 2011 12:05:54 +0000 (15:05 +0300)]
add -fno-omit-frame-pointer to x86 builds
GCC >= 4.6 omits it by default, leading to broken backtraces.
Nikodemus Siivola [Mon, 1 Aug 2011 12:02:54 +0000 (15:02 +0300)]
make SBCL_ARCH=x86 build work on 64-bit linux without chroot
(Assuming all the compatibility libs, etc, have been installed.)
Nikodemus Siivola [Fri, 29 Jul 2011 11:41:00 +0000 (14:41 +0300)]
fixed-format floating point printing: zero and scaling factors
Now that FLONUM-TO-DIGITS handles zero, we need to check against
zero before adding in the scaling factor.
Also make sure not to print extra digits when E is negative.
Adjust FORMAT-AUX-EXP to not print the extra-zero: FLONUM-TO-STRING
provides it now.
Fixes lp#811386.
Nikodemus Siivola [Fri, 29 Jul 2011 11:06:50 +0000 (14:06 +0300)]
add missing bug number to NEWS for 816564
EOM
Nikodemus Siivola [Fri, 29 Jul 2011 10:16:26 +0000 (13:16 +0300)]
obsolete instance protocol and class-slots
UPDATE-INSTANCE-FOR-REDEFINED-CLASS needs to be called when
the set of class-slots changes.
...we /tried/ to do that, but embarrasingly
(LOOP FOR X IN LIST1
FOR Y IN LIST2
ALWAYS ...)
returns T if either list has elements missing from the other in the
tail as the iteration terminates when list runs out. Oops.
Joshua Elsasser [Thu, 28 Jul 2011 13:27:26 +0000 (06:27 -0700)]
Have the float.pure.lisp / RANGE-REDUCTION test fail on all x86-64.
It was already marked as failing on Linux, Darwin and Solaris; rather
than add OpenBSD to that list I'm going ahead and assuming that it
fails on FreeBSD and NetBSD too.
Also add a generated header file to .gitignore.
Stas Boukarev [Thu, 28 Jul 2011 12:08:51 +0000 (16:08 +0400)]
Fix xref for (setf name) names.
Use EQUAL instead of EQL when comparing names.
Nikodemus Siivola [Wed, 27 Jul 2011 12:46:06 +0000 (15:46 +0300)]
make sure LVAR-EXTERNALLY-CHECKABLE-TYPE always returns a type
Fixes bug reported by Eric Marsden on sbcl-devel.
Christophe Rhodes [Sun, 24 Jul 2011 05:11:40 +0000 (06:11 +0100)]
fix COERCE to unfinalized extended sequence classes
Just before we're about to create an object, finalize the class if it
isn't already finalized, so that we can get at the class prototype.
Jim Wise [Fri, 22 Jul 2011 19:43:46 +0000 (15:43 -0400)]
Minor tweak for Solaris /bin/sh compatibility.
Paul Khuong [Fri, 22 Jul 2011 15:52:48 +0000 (11:52 -0400)]
Correct RIP-relative offset for strange x86-64 instructions
CMP[PS][SD] and shuffle instructions have extra noise *after* the
reg/mem operand. Take that into account when emitting RIP-relative
EAs.
Their disassembler definition is still broken.
Fixes lp#814688, reported by Eric Marsden on sbcl-devel.
Juho Snellman [Mon, 11 Jul 2011 22:14:03 +0000 (00:14 +0200)]
1.0.50: will be tagged as "sbcl-1.0.50"
Juho Snellman [Mon, 11 Jul 2011 21:51:33 +0000 (23:51 +0200)]
Fix generate_version.sh for release tarballs
Paul Khuong [Fri, 8 Jul 2011 17:04:07 +0000 (13:04 -0400)]
Fix a non-gencgc build failure in UNSAFE-CLEAR-ROOTS
Introduced in
4084b6b9 (armload of DEFINE-HASH-CACHE changes).
Paul Khuong [Wed, 6 Jul 2011 06:16:17 +0000 (02:16 -0400)]
Small cleanups
* Wrap some asserts with with-test in defstruct.impure.lisp
* Remove two unused variables in remap_free_pages.
* Fix the allocation region size estimate in sb-sprof.
Paul Khuong [Wed, 6 Jul 2011 01:46:06 +0000 (21:46 -0400)]
More conservative defaults in GENCGC
* Set GENCGC-ALLOC-GRANULARITY to 0, and thus fully disable the minimal
allocation size logic by default.
* Explicitly zero out pages that fall outside GENCGC-RELEASE-GRANULARITY,
instead of leaving them dirty, when releasing address space.
* Set large_object_size to 4 * MAX(PAGE_SIZE, GENCGC_ALLOC_GRANULARITY,
GENCGC_RELEASE_GRANULARITY).
* I'm getting very strange failures in some branches that I can't replicate
on master, but let's be extra careful for now.
Paul Khuong [Sun, 3 Jul 2011 17:25:27 +0000 (13:25 -0400)]
Fix the build - gencgc broken since 1.0.49.73 (4 commits ago)
Sloppy merge.
Nikodemus Siivola [Sun, 3 Jul 2011 15:52:32 +0000 (18:52 +0300)]
teach debugger about &MORE arguments
LIST-LOCALS displays SB-DEBUG::MORE = (...list of more args...)
in addition to the more-context and count.
EVAL-IN-FRAME bindss SB-DEBUG::MORE when appropriate.
Nikodemus Siivola [Sun, 3 Jul 2011 15:24:12 +0000 (18:24 +0300)]
inhibit &REST -> &MORE conversion when DEBUG is 3
Explicitly inhibit in BREAK.
Paul Khuong [Sun, 3 Jul 2011 16:45:42 +0000 (12:45 -0400)]
Allocate at least gencgc_alloc_granularity bytes at a time, if possible
* While we have large cards, it doesn't really matter, but tuning that
might help some applications that cons a lot of medium-sized objects.
* Defaults to GENCGC_ALLOC_GRANULARITY, and should always be a multiple
of GENCGC_CARD_BYTES.
* GENCGC_ALLOC_GRANULARITY defaults to BACKEND_PAGE_BYTES, so this patch
is a no-op.
Paul Khuong [Sun, 3 Jul 2011 16:45:42 +0000 (12:45 -0400)]
Release address space to the OS at gencgc_release_granularity
* Some platforms perform better on large, aligned mmap/munmap calls.
The GC will only perform such calls in chunks of
gencgc_release_granularity bytes, aligned at that many bytes.
* gencgc_release_granularity defaults to GENCGC_RELEASE_GRANULARITY,
and should always be a power of 2, as well as a multiple of the OS
page size and of GENCGC_CARD_BYTES.
* GENCGC_RELEASE_GRANULARITY defaults to BACKEND_PAGE_BYTES, making
this patch a no-op.
* Also, fix an assumption that BACKEND_PAGE_BYTES = 1024*sizeof(long)
in a safety check in gc_free_heap.
Paul Khuong [Sun, 3 Jul 2011 16:45:42 +0000 (12:45 -0400)]
Split GENCGC_PAGE_BYTES in 3 constants
* We still have BACKEND_PAGE_BYTES, which should be a conservative
over-approximation of the OS's page size.
* GENCGC_PAGE_BYTES is mostly replaced by GENCGC_CARD_BYTES, the
byte granularity at which we track writes to old generations.
While we're using mprotect-based write barriers, this should be
a multiple of BACKEND_PAGE_BYTES.
* GENCGC_ALLOC_GRANULARITY is the minimum size we attempt to make
each allocation region. Should be a multiple of GENCGC_CARD_BYTES.
While we have largeish cards, this shouldn't ever be an issue, but
it might if we ever go down to < 1k cards.
* GENCGC_RELEASE_GRANULARITY is the minimum size at which we release
address space to the OS. This should always be a multiple of
BACKEND_PAGE_BYTES.
* For now, all three new constants are equal to BACKEND_PAGE_BYTES.
Paul Khuong [Sun, 3 Jul 2011 01:52:50 +0000 (21:52 -0400)]
Lazier zero_dirty_pages in gencgc
Upon allocation, only zero out pages that haven't already been cleared.
Paul Khuong [Sun, 3 Jul 2011 01:05:31 +0000 (21:05 -0400)]
Differentiate between object slot initialisation and mutation
INIT-SLOT and SET-SLOT VOPs do the same thing on every platform for
now.
Paul Khuong [Sat, 2 Jul 2011 23:59:54 +0000 (19:59 -0400)]
Fix an off-by-one in MAP-ALLOCATED-OBJECTS
The bug would be extremely hard to tickle with current gencgc, but
that's going to change soon.
Christophe Rhodes [Wed, 29 Jun 2011 14:52:35 +0000 (15:52 +0100)]
restarts for PRINT-NOT-READABLE errors
Two restarts: USE-VALUE, to provide a value to be printed instead
(under the same printer control variable bindings), and
SB-EXT:PRINT-UNDREADABLY, printing the same object but with
*PRINT-READABLY* bound to NIL. Only minimally tested, but should
meet requirements for lp#801255.
Nikodemus Siivola [Sun, 26 Jun 2011 17:47:44 +0000 (20:47 +0300)]
export SIZE-T and OFF-T from SB-ALIEN
They're pretty common interface types.
Nikodemus Siivola [Sun, 26 Jun 2011 17:40:22 +0000 (20:40 +0300)]
fix bogus test in arith.pure.lisp
Didn't actually call the slow-path at all. Thanks to Lutz Euler for the
heads-up.
Paul Khuong [Fri, 24 Jun 2011 03:17:22 +0000 (23:17 -0400)]
Get alignment right for block headers on x86-64, this time
We want to align the code in the block, not the trampoline that
leads to the block. In theory, we could take the trampoline into
account when inserting alignment, but really?
Paul Khuong [Thu, 23 Jun 2011 15:05:54 +0000 (11:05 -0400)]
Microoptimisation for block headers on x86-64
Only emit a jmp over the header if a predecessor falls through to
the current block, and it there is a trampoline. Otherwise, it's
not worth the cost of a branch to skip a few NOPs.
Paul Khuong [Wed, 22 Jun 2011 01:12:36 +0000 (21:12 -0400)]
Let register allocation handle unused TNs due to constant folding
Type-directed constant folding can leave lambda-vars that are neither dead
nor read from or written to. Ideally, it seems like we should make sure to
transform those into REF to CONSTANTs, but the optimisation doesn't seem
guaranteed to fire. It looks like the TN could simply not be allocated
in ASSIGN-LAMBDA-VAR-TNS, but I'm not sure how to test for that situation
ahead of time yet.
Kludges over lp#729765.
Paul Khuong [Tue, 21 Jun 2011 04:31:00 +0000 (00:31 -0400)]
Unboxed implicit value cells on x86[-64]
Implicit value cells are used for bindings that are only closed
over by dynamic-extent functions.
The logic would have to be somewhat modified on platforms with
NFP. As is, only implement support for unboxed implicit value
cells on x86oids (for signed and unsigned words, SAPs and float
reals and complexes).
Paul Khuong [Tue, 21 Jun 2011 03:52:45 +0000 (23:52 -0400)]
Compiler support for specialised implicit value cells
Enables the use of non-T stack TNs for closed-over dynamic-extent variables.
SB!VM:PRIMITIVE-TYPE-INDIRECT-CELL-TYPE takes a primitive-type and returns
NIL, or a list of 4 values:
- the primitive type of the implicit indirect value cell
- the SC of that cell
- a function that takes the NODE, BLOCK, FP, VALUE and RESULT, and
emits a reference to that cell.
- a function that takes the NODE, BLOCK, FP, NEW-VALUE and VALUE, and
emits a write to that cell.
Some correctness tests to make sure codegen is correct (without verifying
DXness).
Paul Khuong [Tue, 21 Jun 2011 03:51:07 +0000 (23:51 -0400)]
Restore the build on x86
Bad copy-pasta in
293488f3.
Paul Khuong [Tue, 21 Jun 2011 02:07:52 +0000 (22:07 -0400)]
Inline local call trampolines on x86[-64]
Allow the insertion of code before entry to blocks from
drop0throughs, jumps, and calls. Used on x86oids to insert
the code to move return addresses to the right location
on local calls without trampolines.
Paul Khuong [Tue, 21 Jun 2011 00:44:07 +0000 (20:44 -0400)]
Faster MAP[-INTO] when (> SPEED SPACE)
Expand into WITH-ARRAY-DATA for non-simple vectors in such cases,
and avoid hairy vector accesses.
Also make sure to exploit that in conset code.
Paul Khuong [Mon, 20 Jun 2011 01:04:20 +0000 (21:04 -0400)]
More constraint propagation in the presence of assignment
When SPEED = 3 > COMPILATION-SPEED, propagate type in code
like (cond ((eql (the fixnum x) y) (setf x 42) y) ...).
Paul Khuong [Sat, 18 Jun 2011 20:36:02 +0000 (16:36 -0400)]
Less constraint propagation when COMPILATION-SPEED > SPEED
Propagate much fewer EQL constraints, and propagate fewer constraints
to EQL variables. Can results in a few orders of magnitude speed ups
in compilation times.
Paul Khuong [Sat, 18 Jun 2011 03:23:43 +0000 (23:23 -0400)]
More explicit high-level interface for consets
Strictly no performance or behaviour difference, but it may be
helpful to understand constraint propagation or even improve it.
Paul Khuong [Sat, 18 Jun 2011 03:18:01 +0000 (23:18 -0400)]
Faster iteration through a variable's constraints during constraint propagation
Store indices of constraints by usage. Practically eliminates the dependence
on conset intersection/iteration performance. Improves compilation speeds,
especially for large functions.
Also improves lp#792363 and lp#394206.
Paul Khuong [Sun, 12 Jun 2011 03:43:28 +0000 (23:43 -0400)]
Smarter FIND-CONSTRAINT during constraint propagation
Use hash tables instead of pure linear search for hash
consing of constraints. Significantly reduces the pressure
on conset iteration performance, and improves compilation
speed of large functions.
Improves lp#792363 and lp#394206.
Nikodemus Siivola [Fri, 17 Jun 2011 18:41:31 +0000 (21:41 +0300)]
RUN-PROGRAM: apply the external-format to the PTY stream as well
Nikodemus Siivola [Wed, 15 Jun 2011 07:46:33 +0000 (10:46 +0300)]
build: tweak generate-version.sh to work with older Git
Pre-1.7.2 Gits are pretty common out in the wild, so use wc -l to
get the revision counts instead of rev-list --count.
This has been verified to work with at least Git v1.6.0.2.
Nikodemus Siivola [Tue, 14 Jun 2011 17:38:56 +0000 (20:38 +0300)]
rename STYLE to HACKING
Also update a bit for the brave new Git-only world.
Nikodemus Siivola [Tue, 14 Jun 2011 10:24:41 +0000 (13:24 +0300)]
whitespace in tests
Nikodemus Siivola [Tue, 14 Jun 2011 09:06:28 +0000 (12:06 +0300)]
add &KEY SILENT to PARSE-LAMBDA-LIST
Passed through to PARSE-LAMBDA-LIST-LIKE, used by %SPLIT-ARGLIST in PCL.
Prior to this GENERIC-FUNCTION-PRETTY-ARGLIST on functions with both
&OPTIONAL and &KEY arguments caused a style-warning -- and inquiring about
the lambda-list isn't the right time for that.
Jim Wise [Mon, 13 Jun 2011 20:27:59 +0000 (16:27 -0400)]
Convert remaining tests in debug.impure.lisp to use with-test.
Nikodemus Siivola [Tue, 7 Jun 2011 09:29:21 +0000 (12:29 +0300)]
tests and NEWS for lp#308961
Also add a random FP read/print consistency tester.
For now it skips denormalized double-floats due to bug 793774.