Nikodemus Siivola [Sat, 21 Jul 2007 01:55:42 +0000 (01:55 +0000)]
1.0.7.36: FIND-SLOT-DEFINITION to return NIL when called with non-slot-classes
* Add a default method to CLASS-SLOT-VECTOR that returns #(NIL), restoring
the pre-1.0.7.26 behaviour of calling SLOT-MISSING when trying to access
slots in non-SLOT-CLASS instances.
* Add a slightly dubious test-case.
Nikodemus Siivola [Sat, 21 Jul 2007 00:05:15 +0000 (00:05 +0000)]
1.0.7.35: SLOT-VALUE and SET-SLOT-VALUE transforms aren't important
* No compiler notes for default policy.
* Test case.
Nikodemus Siivola [Fri, 20 Jul 2007 23:43:21 +0000 (23:43 +0000)]
1.0.7.34: adjust lexenv frobbing in TRANSFORM-CALL to happen earlier
* Need to replace the call lexenv with the frobbed one before
WITH-IR1-ENVIRONMENT-FROM-NODE so that IR1-CONVERT-INLINE-LAMBDA
gets a consistent *LEXENV* binding.
(This has been around since 0.9.17.5, but since it only affects
known functions with optional arguments and transformations it
suddenly become a lot more easy to hit with the new MEMBER and
ASSOC transforms.)
* Test case.
Nikodemus Siivola [Thu, 19 Jul 2007 18:49:44 +0000 (18:49 +0000)]
1.0.7.33: better handling of ASSOC and MEMBER on empty lists
* If the second argument is a constant NIL, remove the whole
call in the transform and just return NIL.
Nikodemus Siivola [Thu, 19 Jul 2007 14:16:40 +0000 (14:16 +0000)]
1.0.7.31: updated TODO file
Let the controversy begin.
No code changes.
Nikodemus Siivola [Thu, 19 Jul 2007 13:44:58 +0000 (13:44 +0000)]
1.0.7.31: paper over bug inlining known functions in high-debug code
NOT A PROPER FIX!
* Don't inline known functions unless let-conversion is enabled, which papers
over the real bug -- apparently due to BIND/UNBIND-SENTINEL vop insertion.
Nikodemus Siivola [Thu, 19 Jul 2007 12:58:59 +0000 (12:58 +0000)]
1.0.7.30: be more paranoid about saps
* Since compiler transformations can introduce closures and hence
cause "this is obviously always on stack or in register" intuition
to be wrong, be more vigilant about pinning objects before
sap-taking.
* Also convert a couple of WITHOUT-GCINGs to WITH-PINNED-OBJECTS
instead.
Nikodemus Siivola [Thu, 19 Jul 2007 10:28:14 +0000 (10:28 +0000)]
1.0.7.29: better ASSOC transform
* Extend the new MEMBER optimizations to handle ASSOC as well, and define
the corresponding %ASSOC[-KEY][-TEST][-NOT] functions as well.
* Clean up the old ASSOC -> ASSQ and MEMBER -> MEMQ transforms that
aren't firing anymore.
* Tests.
Nikodemus Siivola [Tue, 17 Jul 2007 22:26:30 +0000 (22:26 +0000)]
1.0.7.28: compiler being nicer to the compiler
* In MAKE-XEP-LAMBDA-EXPRESSION, use EQL instead of = and NOT <
instead of >= to avoid additional rounds of deftransforms and
lambda-conversion.
* Add a source transform for %COERCE-CALLABLE-TO-FUN to pick of
simple cases, also avoid inserting additional lambdas to the code.
* Use %FUNCALL and %COERCE-CALLABLE-TO-FUN in MAPFOO-TRANSFORM,
providing not just faster compilation, but also making (MAPCAR F
...) faster by lifting the %C-C-T-F out of the loop.
This work was based on Juho's observation that a major source of
compiler slowness are all the lambdas generated by transforms: not
that this changes the big picture in any way -- just shaves a few
corners. If you wish to get a gut feeling of what is going on, stick
a (PRINT (LIST DEBUG-NAME BODY)) in IR1-CONVERT-INLINE-LAMBDA.
Nikodemus Siivola [Tue, 17 Jul 2007 20:50:15 +0000 (20:50 +0000)]
1.0.7.27: SLOT-CLASS cleanups
* No need for two separate implementations of FIND-SLOT-DEFINITION -- just
move the one we care about to slots-boot.lisp along with MAKE-SLOT-VECTOR
(which it is intimately tied up with.) Add comments for posterity.
* There should be no (SETF CLASS-SLOTS) or (SETF CLASS-DIRECT-SLOTS), so
:READER, not :ACCESSOR in SLOT-CLASS.
Nikodemus Siivola [Tue, 17 Jul 2007 18:36:33 +0000 (18:36 +0000)]
1.0.7.26: asymptotically faster FIND-SLOT-DEFINITION
* Add a SLOT-VECTOR slot the SLOT-CLASS. The SLOT-VECTOR contains
plists of slot definition objects hashed on the slot name, allowing
O(1) lookups based on the slot name, instead of the old O(N)
lookups -- where N is the number of slots in a class.
Makes everything requiring slot definition lookups faster, simple
tests showing SLOT-VALUE with variable name on a 5-slot class to be
roughly 50% faster.
Nikodemus Siivola [Tue, 17 Jul 2007 13:18:06 +0000 (13:18 +0000)]
1.0.7.25: better MEMBER transform
* Specialized versions for different keyword combinations: %MEMBER,
%MEMBER-TEST, %MEMBER-KEY-TEST, etc. These versions have positional
arguments, and the callable arguments are known to be functions.
* The transform open codes for all combinations of keywords if the
second argument is constant and (>= SPEED SPACE). Otherwise the
transform selects the appropriate specialized version and open
codes %COERCE-CALLABLE-TO-FUN around keyword arguments, allowing
type inference to optimize it away for arguments known to be
functions.
* Tests.
Christophe Rhodes [Tue, 17 Jul 2007 11:24:26 +0000 (11:24 +0000)]
1.0.7.24: Fix CALL-NEXT-METHOD / EVAL-WHEN interaction
Reported by Sascha Wilde sbcl-devel 2007-07-15. This fix is not
the one that I sent to sbcl-devel 2007-07-16, because that's
just too horrible; instead we expand DEFMETHOD into separate
:LOAD-TOPLEVEL and :EXECUTE branches. (This needs a minor test
adjustment)
Nikodemus Siivola [Tue, 17 Jul 2007 10:13:38 +0000 (10:13 +0000)]
1.0.7.23: delete a large block of commented-out code from seqtran.lisp
* This is why we have version control. (But add a comment pointing out
that this code exists, so that people know where to look for it.)
The code that is deleted here contains the apparent beginnings of a
better sequence transform infrastructure: a compiler representation
of an iteration over a sequence.
Nikodemus Siivola [Mon, 16 Jul 2007 16:52:52 +0000 (16:52 +0000)]
1.0.7.22: (SETF SYMBOL-PLIST) type checking
* Disallow non-lists as the new value.
Nikodemus Siivola [Mon, 16 Jul 2007 16:12:18 +0000 (16:12 +0000)]
1.0.7.21: threaded SET & BIND VOP touchups
* In SET: don't check versus TLS-INDEX == 0: TLS-INDEX 0 already
gives the NO-TLS-VALUE-MARKER. Smaller code, and common case seems
to be assignment to a bound variable.
* In BIND: use one register less, splitting the duties of the old
TEMP between TLS-INDEX and EAX/RAX. Increment the *FREE-TLS-INDEX*
directly in memory.
Nikodemus Siivola [Mon, 16 Jul 2007 11:07:37 +0000 (11:07 +0000)]
1.0.7.20: note for SBCL packagers
See doc/PACKAGING-SBCL.txt.
Nikodemus Siivola [Sun, 15 Jul 2007 22:28:12 +0000 (22:28 +0000)]
1.0.7.19: SB-EXT:COMPARE-AND-SWAP
* New macro SB-EXT:COMPARE-AND-SWAP provides a supported interface to
compare-and-swap functionality.
* New info-type :FUNCTION :STRUCTURE-ACCESSOR allows us to map from
defstruct slot-accessor names to defstruct descriptions.
* Add :CAS-TRANS slot keyword to DEFINE-PRIMITIVE object, and the
compiler machinery needed to support compare and swap on primitive
object slots.
* New VOPs COMPARE-AND-SWAP-SLOT and %COMPARE-AND-SWAP-SYMBOL-VALUE.
* Delete now unnecessary DEFINE-STRUCTURE-SLOT-COMPARE-AND-SWAP.
* Use a consistent %COMPARE-AND-SWAP-FOO naming scheme for CAS
functions.
* Tests.
Tested on x86/Linux & x86/Darwin, x86-64/Darwi, and PPC/Darwin.
Nikodemus Siivola [Fri, 13 Jul 2007 18:57:23 +0000 (18:57 +0000)]
1.0.7.18: automagic debugging-friendly gensyms
* New function: SB-INT:BLOCK-GENSYM, which appends the innermost
enclosing non-NIL block name to the given stem. The default
environment used is the current *LEXENV* if one exists.
* Use it instead of GENSYM in MAKE-GENSYM-LIST and WITH-UNIQUE-NAMES.
Nikodemus Siivola [Thu, 12 Jul 2007 23:05:17 +0000 (23:05 +0000)]
1.0.7.17: SLOT-VALUE and SET-SLOT-VALUE transforms (really 1.0.7.16)
This is the real commit message that was supposed to go in 1.0.7.16.
Sorry.
* Define SLOT-VALUE and SET-SLOT-VALUE as known functions.
* Use &ENVIRONMENT in CONSTANTP and CONSTANT-FORM-VALUE calls in
their compiler-macros.
* Add transforms for SLOT-VALUE and SET-SLOT-VALUE in addition to the
compiler-macros. The transforms are functionally equivalent to the
compiler-macros, but catch more cases: eg.
(define-modify-macro appendf (&rest lists) append)
(appendf (slot-value x 'y) z)
needs the deftransforms as setf-expansion replaces the constant
argument with a gensym.
Keep the compiler-macros around, since they catch the common cases
early and don't mess up the build: the transforms are agressive
enough that we can't enable them until the PCL boot-state is
complete. (The compiler-macros are also slightly cheaper, since
each transform introduces a new lambda.)
Nikodemus Siivola [Thu, 12 Jul 2007 17:28:40 +0000 (17:28 +0000)]
1.0.7.14: thread-safe INTERN, EXPORT, &co
* Modifications to packages grab a global lock. INTERN is the only
real potential performance bottleneck here, but as long as the
symbol already exists it doesn't need to get the lock.
We need a global lock instead of a per-package lock because eg.
(EXPORT 'FOO::BAR :FOO) and (INTERN "BAR" :ZOT) can conflict, even
though they operate on different packages.
Since races should be rare we use a spinlock to avoid making a
system call for every release.
Interrupt safety? Probably no. It's likely that you can wedge the
package system into a bad state if you really try.
Nikodemus Siivola [Thu, 12 Jul 2007 10:31:20 +0000 (10:31 +0000)]
1.0.7.15: fix buglet in NAME-LAMBDALIKE
* Remove stray QUOTE. Reported by David Smith.
Nikodemus Siivola [Wed, 11 Jul 2007 13:56:49 +0000 (13:56 +0000)]
1.0.7.14: thread-safe INTERN, EXPORT, &co
* Modifications to packages grab a global lock. INTERN is the only
real potential performance bottleneck here, but as long as the
symbol already exists it doesn't need to get the lock.
We need a global lock instead of a per-package lock because eg.
(EXPORT 'FOO::BAR :FOO) and (INTERN "BAR" :ZOT) can conflict, even
though they operate on different packages.
Since races should be rare we use a spinlock to avoid making a
system call for every release.
Interrupt safety? Probably no. It's likely that you can wedge the
package system into a bad state if you really try.
William Harold Newman [Wed, 4 Jul 2007 00:15:27 +0000 (00:15 +0000)]
1.0.7.13: Mistakes should be fun, error messages should be beautiful.
take one ~% down, replace it with ~_, several hundred
vintage error message strings in the repository...
Nikodemus Siivola [Tue, 3 Jul 2007 12:11:42 +0000 (12:11 +0000)]
1.0.7.12: fix clos-interrupts.impure.lisp for unithreaded builds
* Forgot #+sb-thread from the test case.
Nikodemus Siivola [Tue, 3 Jul 2007 10:21:21 +0000 (10:21 +0000)]
1.0.7.11: fix test WITHOUT-INTERRUPTS+GET-MUTEX
* Incorrect use of JOIN-THREAD.
William Harold Newman [Mon, 2 Jul 2007 17:48:52 +0000 (17:48 +0000)]
1.0.7.10: added a FINISH-OUTPUT before switching streams
Before this little patch, compiling a source file containing
only three #\. characters gave output like this:
* (compile-file "dots.lisp")
; compiling file "/tmp/dots.lisp" (written 02 JUL 2007 12:27:29 PM):
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; compilation aborted because of fatal error:
; READ failure in COMPILE-FILE:
; READER-ERROR at 3 (line 1, column 3) on #<SB-SYS:FD-STREAM for "file /tmp/dots.lisp" {AB65D21}>:
; /tmp/dots.fasl written
; compilation finished in 0:00:00
#P"/tmp/dots.fasl"
T
; too many dotsT
*
After this patch, the 'too many dots' text ends up where
it should (several lines earlier).
Christophe Rhodes [Mon, 2 Jul 2007 16:58:20 +0000 (16:58 +0000)]
1.0.7.9: DEFAULT-UNKNOWN-VALUES for more than 7 args on x86-64
Convinced myself that my patch was right, and that JMP-SHORT was
an artifact of the previous calling convention. Delete
the JMP-SHORT pseudo-instruction forthwith.
Nikodemus Siivola [Sun, 1 Jul 2007 18:51:19 +0000 (18:51 +0000)]
1.0.7.8: micro-optimize STRING->UTF8
* Slight cleverness about types, and inline ADD-BYTE locally.
* If the utf8-length is the same as the length of the subsequence use
a faster path.
* Up to 60% faster on my test-cases (strings of random characters in
the full character-code range.)
Nikodemus Siivola [Sun, 1 Jul 2007 16:35:04 +0000 (16:35 +0000)]
1.0.7.7: slightly less broken handling of obsolete structures
* Trap them correctly in PCL.
* Correct package so that CLASSOID-TYPEP signals the correct error
instead of running into an undefined function.
* Tests.
Nikodemus Siivola [Sun, 1 Jul 2007 15:03:34 +0000 (15:03 +0000)]
1.0.7.6: additional test case that fails under SB-LUTEX
Buggrit, millenium hand and shrimp!
Nikodemus Siivola [Sun, 1 Jul 2007 12:35:30 +0000 (12:35 +0000)]
1.0.7.5: allow WITH-INTERRUPTS inside "system locked" sections
* Fixes bug reported by Kristoffer Kvello on sbcl-help. (Regression
caused by WITHOUT-INTERRUPT change caused GET-FOREGROUND wait to
become uninterruptible.)
* Test-case for the above, and another to show that condition-wait
should not be interruptible if there is a surrounding
WITHOUT-INTERRUPTS -- which currently fails on SB-LUTEX builds.
Nikodemus Siivola [Sat, 30 Jun 2007 09:21:24 +0000 (09:21 +0000)]
1.0.7.4: RESTRICT-COMPILER-POLICY
* Allow users to set a global minimum for optimization qualities,
overriding declarations and proclamations.
The intended use is to make it easy to recompile large bodies of
code with many local optimization declarations with a minimum
SAFETY or DEBUG everywhere.
* Changes to SBCL itself to allow building with SBCL that has minimum
safety set to 3:
-- Second argument of %MORE-KW-ARG is a negative: DEFKNOWN it as a
FIXNUM, not INDEX.
-- We don't have a deftype for SB-VM::POSITIVE-FIXNUM -- it's only
a backend type. Use (AND UNSIGNED-BYTE FIXNUM) instead.
* Delete some unused functions: READ-SEQUENCE-OR-DIE,
RENAME-KEY-ARGS.
Nikodemus Siivola [Thu, 28 Jun 2007 23:13:45 +0000 (23:13 +0000)]
1.0.7.3: non-consing GETHASH and (SETF GETHASH)
* Add a BLOCK for RETURN-FROM inside WITH-SPINLOCK-AND-WITHOUT-GCING,
so that the compiler will not need to generate code to verify the
tag existence at runtime -- which causes value-cell allocation.
(Performance regression since new WITHOUT-INTERRUPTS implementation.)
* Add a test-case to make sure basic hash-table functionality is non-consing.
Nikodemus Siivola [Thu, 28 Jun 2007 14:24:48 +0000 (14:24 +0000)]
1.0.7.2: fix potential GC errors due to bogus objects in backtraces
Backtrace construction involves calling MAKE-LISP-OBJ on things we
devoutly hope are tagged lisp pointers, but this is not always the
case. When we fail to detect this, and a GC follows while the bogus
object is at location visible to GC bad things will happen. (Pinning
doesn't change anything, as the object still needs to be scavenged.)
To fix this (mostly -- one can still construct bogus lisp-objects
using MAKE-LISP-OBJ, it just takes more work / is less likely to
happen by accident):
* Rename MAKE-LISP-OBJ %MAKE-LISP-OBJ, and MAKE-VALID-LISP-OBJ
MAKE-LISP-OBJ.
* Add an optional ERRORP argument to the former MAKE-VALID-LISP-OBJ,
defaulting to T.
* Always use the function formerly known as MAKE-VALID-LISP-OBJ,
passing in errorp=NIL when in doubt.
* Improve the validation done on x86/x86-64: factor out the checking
logic in possibly_valid_dynamic_space_pointer, and use it to
implment valid_lisp_ponter_p. Could be done on other platforms as
well, but better done by someone who can test the results...
Adjust other code to suit:
* MAP-ALLOCATED-OBJECTS uses %MAKE-LISP-OBJ for now, as the new
MAKE-LISP-OBJ is too slow to use for groveling over the whole
heap. (Though it does detect a bunch of bogus objects we're
constructing in ROOM now, so the time would not be really
wasted...)
No test cases because I've been unable to construct one that calls
MAKE-LISP-OBJ with bogus arguments while backtracing, but such
backtraces have been seen in the wild.
Nikodemus Siivola [Thu, 28 Jun 2007 13:04:54 +0000 (13:04 +0000)]
1.0.7.1: dynamic extent value cells
* Pass DX information from leaf to MAKE-VALUE-CELL, and implement the
DX allocation for it on x86 and x86-64.
* Declare some appropriate closed-over variables dynamic-extent:
allows non-consing WITH-SPINLOCK &co.
* Tests.
William Harold Newman [Wed, 27 Jun 2007 23:44:09 +0000 (23:44 +0000)]
1.0.7: release, will be tagged as sbcl_1_0_7
Nikodemus Siivola [Thu, 21 Jun 2007 15:09:10 +0000 (15:09 +0000)]
1.0.6.60: add test file that was forgotten from 1.0.6.59
* clos-interrupts.impure.lisp
Nikodemus Siivola [Wed, 20 Jun 2007 19:05:53 +0000 (19:05 +0000)]
1.0.6.59: bogus metacircles due to interrupted applicable method comp.
* If an interrupt arrives while have stuff on the *CACHE-MISS-VALUES-STACK*
and the interrupt handler happens to call a gf that is already there,
we used to think this was a metacircle. Instead we need to bind
variables like this to "empty" values for interrupt hanlers.
* Test.
* Note some bugs.
Nikodemus Siivola [Wed, 20 Jun 2007 18:11:57 +0000 (18:11 +0000)]
1.0.6.58: better heap exhaustion information
* Print states of *GC-PENDING*, *GC-INHIBIT*, and
*SIG-STOP-FOR-GC-PENDING* for fatal heap exhaustions.
* Use alloc_number instead of make_fixnum for requested/available.
Juho Snellman [Wed, 20 Jun 2007 08:35:28 +0000 (08:35 +0000)]
1.0.6.57: fix sb-bsd-socket build on win32
* Reported by Yaroslav Kavenchuk.
Nikodemus Siivola [Tue, 19 Jun 2007 21:00:03 +0000 (21:00 +0000)]
1.0.6.56: replace CALL-WITH-DX-FUNCTION with DX-FLET
* Essentially same underlying macroexpansion, but more flexible in
use, and possibly even easier to read.
* Use DX-FLET instead of LAMBDAs in our CALL-WITH-FOO expansions
to avoid consing up closures.
Juho Snellman [Mon, 18 Jun 2007 22:42:12 +0000 (22:42 +0000)]
1.0.6.55: fix ppc/linux build (probably)
Juho Snellman [Mon, 18 Jun 2007 17:52:16 +0000 (17:52 +0000)]
1.0.6.54: fix building contribs from a clean checkout (oops)
Juho Snellman [Mon, 18 Jun 2007 17:16:54 +0000 (17:16 +0000)]
1.0.6.53: oops, forgot to "cvs add" some new files
Juho Snellman [Mon, 18 Jun 2007 16:20:32 +0000 (16:20 +0000)]
1.0.6.52: mark most current tests failures on buildbot as expected
* To make it easier to find out when there are new failures.
Juho Snellman [Mon, 18 Jun 2007 16:18:34 +0000 (16:18 +0000)]
1.0.6.51: clean up compiler warnings in the runtime
* Patch by Robert Brown.
Juho Snellman [Mon, 18 Jun 2007 16:15:54 +0000 (16:15 +0000)]
1.0.6.50: better arglists for generic functions
* Parameter names in the lambda list of the generic function
are given priority to those of the gf's methods, since the
names given in the generic function are likely to be more
general.
* Fix merging of &key parameters of all the methods.
* Patch by Tobias Rittweiler.
Juho Snellman [Mon, 18 Jun 2007 16:11:08 +0000 (16:11 +0000)]
1.0.6.49: make asdf-based contribs more friendly to :FORCE T
* Do the groveling part of sb-grovel only at contrib build time.
If the contrib is later recompiled, reuse the results from that
grovel.
* Doesn't solve the asdf-binary-locations problems related to
groveling, but it looks as if asdf-binary-locations is already
automatically adding SBCL_HOME into it's exceptions list.
Juho Snellman [Mon, 18 Jun 2007 16:02:55 +0000 (16:02 +0000)]
1.0.6.48: Don't instrument the internal flets from the PROGV expansion
* PROGV would get compiled to BINDING-STACK-POINTER -> X, ...,
BIND-SENTINEL, UNBIND-TO-HERE X, UNBIND-SENTINEL. So the
UNBIND-TO-HERE would also pop the sentinel from the binding stack,
and the UNBIND-SENTINEL would then unbalance the stack.
* Ensure that there will only be matched BIND-SENTINEL /
UNBIND-SENTINEL pairs between taking the binding stack pointer
and unwinding by adding some (OPTIMIZE (INSERT-DEBUG-CATCH 0))
declarations.
* Reported by Nikodemus
Nikodemus Siivola [Fri, 15 Jun 2007 16:53:43 +0000 (16:53 +0000)]
1.0.6.47: small fixes
* When expanding the CLOS cache, insert the new value before copying
the old ones, in order to ensure that FILL-CACHE always terminations.
* Cancel deadline before signalling the DEADLINE-ERROR, so that same
deadline cannot be caught again during unwind.
Christophe Rhodes [Mon, 11 Jun 2007 13:47:38 +0000 (13:47 +0000)]
1.0.6.46: better standard-specializer-p implementation
Instead of defining a gf with several methods, define a new
class STANDARD-SPECIALIZER to be used as a superclass to the
various specializers that are handled internally in PCL.
It's not exported, because we don't want people to subclass it:
they will not be able to implement the relevant protocols.
Juho Snellman [Mon, 11 Jun 2007 04:23:08 +0000 (04:23 +0000)]
1.0.6.45: fix compilation speed regression from DATA-VECTOR-REF-WITH-OFFSET
* Change the remaining x86oid DATA-VECTOR-REF VOPs to
DATA-VECTOR-REF-WITH-OFFSETs. The VOPs only accept an offset of
0, and are thus functionally identical to the old ones.
* This allows replacing the conditional deftransform from D-V-R to
D-V-R-W-O with an unconditional source-transform.
* Rewrite transformations with (OR (SIMPLE-UNBOXED-ARRAY (*))
SIMPLE-VECTOR) argument types to instead do the type tests in the
body of the transform, since the test can be expressed
in a cheaper way in the latter case.
Juho Snellman [Mon, 11 Jun 2007 03:29:23 +0000 (03:29 +0000)]
1.0.6.44: make WITHOUT-INTERRUPTS non-consing
* Consing up a closure for CALL-WITHOUT-INTERRUPTS is a performance
problem, stack-allocate the closure on platforms with dx support.
* Doing the stack-allocation properly is a bit tricky, encapsulate
the right way into the CALL-WITH-DX-FUNCTION macro.
* TODO: apply the same procedure to other CALL-WITH-FOOs.
Juho Snellman [Mon, 11 Jun 2007 03:14:50 +0000 (03:14 +0000)]
1.0.6.43: support saving and restoring code coverage state in sb-cover
Juho Snellman [Sun, 10 Jun 2007 11:10:38 +0000 (11:10 +0000)]
1.0.6.42: handle unbound markers (from BIND-SENTINEL) in unbind_to_here
* Like in the x86oid UNBIND-TO-HERE vop
* Fixes calling SAVE-LISP-AND-DIE when the call stack contains
functions compiled with high DEBUG quality
Nikodemus Siivola [Sat, 9 Jun 2007 18:31:37 +0000 (18:31 +0000)]
1.0.6.41: optimized bignum printing
* Cache the power-vectors, the computation of which is the real
bottleneck of bignum printing. So that we don't keep huge bignums
forever, make GC gently scrub the cache.
* Rename %OUTPUT-FIXNUM-IN-BASE to %OUTPUT-REASONABLE-INTEGER-IN-BASE
and %OUTPUT-BIGNUM-IN-BASE to %OUTPUT-HUGE-INTEGER-IN-BASE.
* The ideal cutoff point between the two algorithms isn't the
fixnum/bignum divide, but is (on x86/Darwin) around 87 bits -- so
make the cutoff point N-POSITIVE-FIXNUM-BITS * 3, and hope that
makes sense on other platforms as well.
This improves (on x86/Darwin) bignum printing speed in the reasonable
range by 40%, and by 30% while below 2048 bits. The benefit decreases
after that, as the GC drops bignums with over 2048 bits from the
cache -- this doesn't show in a tight benchmarking loop, though.
Nikodemus Siivola [Sat, 9 Jun 2007 09:09:06 +0000 (09:09 +0000)]
1.0.6.40: missed tests from 1.0.6.38
...for ADD/REMOVE-METHOD thread safety, that is.
Nikodemus Siivola [Fri, 8 Jun 2007 21:24:53 +0000 (21:24 +0000)]
1.0.6.39: COMPUTE-DISCRIMINATING-FUNCTION micro-optimization
* Old versio used WITH-SLOTS to read DFUN-STATE twice per call,
but (let ((dfun-state (slot-value gf 'dfun-state))) ...)
is faster, as it avoids the second lookup.
Nikodemus Siivola [Fri, 8 Jun 2007 20:38:21 +0000 (20:38 +0000)]
1.0.6.38: thread and interrupt safe ADD/REMOVE-METHOD
* ADD/REMOVE-METHOD need to grab the GF lock and disable interrupts.
* ADD/REMOVE-DIRECT-METHOD, and SPECIALIZER-DIRECT-GENERIC-FUNCTIONS
need a lock as well, but instead of adding per-specializer lock
just use one global one: contention should be minimal here.
* INTERN-EQL-SPECIALIZER needs a lock.
* Fix non-threaded build.
* Delete dead NAME variables from ADD/REMOVE-METHOD.
* Tests.
Nikodemus Siivola [Fri, 8 Jun 2007 12:47:50 +0000 (12:47 +0000)]
1.0.6.37: thread safety test for the CLOS cache
...better late then never.
Nikodemus Siivola [Fri, 8 Jun 2007 12:15:44 +0000 (12:15 +0000)]
1.0.6.36: ALLOW-WITH-INTERRUPTS and interrupt safe WITH-MUTEX &co
* Remove the *IN-INTERRUPTION* kludge, and replace it with a
general-purpose mechanism.
* New variable: *ALLOW-WITH-INTERRRUPTS*. WITH-INTERRUPTS is a no-op
unless it is true and interrupts are inhibited.
* WITHOUT-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to NIL, and
establishes ALLOW-WITH-INTERRUPTS and WITH-LOCAL-INTERRUPTS as
local macros.
ALLOW-WITH-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to the value it
held before entry to WITHOUT-INTERRUPTS.
WITH-LOCAL-INTERRUPTS is equivalent to
(allow-with-interrups (with-interrupts ...))
but somewhat more efficient.
* Use the above to make WITH-MUTEX &co interrupt-safe, but still
interruptible: WITH-FOO becomes
(without-interrupts
(unwind-protect
(when (setf foo (allow-with-interrupts (get-foo)))
(with-local-interrupts ...))
(when foo
(release-foo foo))))
and GET-FOO wraps it's waiting section inside a WITH-INTERRUPTS.
* While at it, rewrite WITH-MUTEX &co to use CALL-WITH-FOO style
expansions.
* Write CALL-WITH-SYSTEM-MUTEX as a more efficient alternative to:
(without-interrupt (with-mutex ...)) ; and
(without-gcing (with-mutex ...))
Similarly for CALL-WITH-RECURSIVE-SYSTEM-SPINLOCK, for the benefit
of PCL.
* No need to signal a WARNING for WITH-INTERRUPTS inside a WITHOUT-GCING,
as *ALLOW-WITH-INTERRUPTS* is always false there, so interrupts will
not be enabled.
Nikodemus Siivola [Fri, 8 Jun 2007 11:42:45 +0000 (11:42 +0000)]
1.0.6.35: slightly bigger +cache-vector-max-length+
Nikodemus Siivola [Fri, 8 Jun 2007 11:40:43 +0000 (11:40 +0000)]
1.0.6.34: AVER that the GF lock is held during SET-DFUN
...and adjust commentary in UPDATE-DFUN.
Nikodemus Siivola [Fri, 8 Jun 2007 08:37:10 +0000 (08:37 +0000)]
1.0.6.33: small CLOS cache improvements
* General PCL cleanups:
-- Get rid of FUNCTION-FUNCALL and FUNCTION-APPLY: instead just
declare the argument type. ETOOMANYLAYERSOFABSTRACTION.
-- Implement the unused GET-FUN in terms of GET-FUN1 for clarity.
* Use a single bitmask instead of multiply and mask to compute the
cache index (like the original implementation).
* Slower probe depth limit growth: caches with 1024 lines used to
have probe depth 16, which is starting to be on the slow side, and
some fairly common generics like PRINT-OBJECT have caches with
enough entries that they will be large no matter what. Instead of
(ceiling (sqrt lines) 2) make it (ceiling (sqrt (sqrt lines))).
* Better CACHE-HAS-INVALID-ENTRIES-P (does less work, picks up
incomplete lines.)
* MAP-ALL-CACHES and CHECK-CACHE-CONSISTENCY for debugging and
analysis.
* Typo in the format string in PRINT-OBJECT (CACHE T).
* A couple of non-CLOS optimization possibilities recorded.
Nikodemus Siivola [Fri, 8 Jun 2007 07:55:53 +0000 (07:55 +0000)]
1.0.6.32: printing of layoutless structures
* This used be conditionalized for SB-SHOW builds, but they come up often
enough when in the debugger during PCL build that it seems worthwhile
to keep in core.
Nathan Froyd [Wed, 6 Jun 2007 22:28:52 +0000 (22:28 +0000)]
1.0.6.31: use proper types for STRING-DISPATCH
* We only want to let one-dimensional character strings through.
This change will probably produce better code, too.
Nathan Froyd [Wed, 6 Jun 2007 21:12:48 +0000 (21:12 +0000)]
1.0.6.30: clean up FD-SOUT a little bit
* Apparently the bozos have been dealt with; we now receive strings
to all calls to this function;
* Declare types appropriately.
Nathan Froyd [Wed, 6 Jun 2007 02:23:46 +0000 (02:23 +0000)]
1.0.6.29: improved WITH-ARRAY-DATA on simple multi-dimensional arrays
* Instead of looping to find the underlying one-dimensional simple
array, just return it directly.
Juho Snellman [Tue, 5 Jun 2007 21:32:57 +0000 (21:32 +0000)]
1.0.6.28: fix UNWIND-TO-FRAME-AND-CALL for #+SB-THREAD
* Ensure that *UNWIND-TO-FRAME-FUNCTION* has a TLS index
Nathan Froyd [Tue, 5 Jun 2007 20:18:43 +0000 (20:18 +0000)]
1.0.6.27: make FD-SOUT slightly faster
* Eliminate spurious call to FIND; POSITION gives us enough info.
Juho Snellman [Tue, 5 Jun 2007 16:17:00 +0000 (16:17 +0000)]
1.0.6.26: fix sb-posix build on win32
* patch from Yaroslav Kavenchuk
Juho Snellman [Tue, 5 Jun 2007 15:28:34 +0000 (15:28 +0000)]
1.0.6.25: fix non x86oid build
* Oops, missing an IGNORE declaration
Juho Snellman [Tue, 5 Jun 2007 11:42:54 +0000 (11:42 +0000)]
1.0.6.24: a more sophisticated UNWIND-TO-FRAME-AND-CALL for x86 and x86-64
* Implement three new VOPs:
** UNWIND-TO-FRAME-AND-CALL constructs a fake catch block for a
given frame pointer, runs all unwinds for that block, sets
the frame pointer to the new value, and calls a given function.
** BIND-SENTINEL (stores a marker on the binding stack, used
to determine how far the binding stack needs to be unwound
during a U-T-F-A-C).
** UNBIND-SENTINEL (pops one of these markers from the stack).
* Modify IR2 to use these VOPs when converting suitable functions.
* Modify the IR1 translation in maybe-insert-debug-catch to only
ensure that tail recursion doesn't happen (needed to match the
BIND-SENTINELs with UNBIND-SENTINELs).
* Use these to implement SB-DEBUG:UNWIND-TO-FRAME-AND-CALL:
** Grovel the binding stack, uwp block chain and the catch block
chain for the values needed to reconstruct the dynamic state.
** Call SB-VM:U-T-F-A-C.
* The new implementation should be substantially the same as the
old one (minor difference in handling of functions with special
variables in the lambda list). Some tests added to verify this.
* New implementation is somewhat faster at runtime (a simple
function call overhead benchmark on (DEBUG 2) improved from 3.4s
to 2.9s), and significantly faster at compiling (generally around
15-30% improvement with (DEBUG 2)).
* Other platforms still use the old implementation that instruments
the code with a CATCH during IR1 translation.
* Based on an earlier hack by Alastair Bridgewater.
Juho Snellman [Tue, 5 Jun 2007 09:56:50 +0000 (09:56 +0000)]
1.0.6.23: fix a source location tracking problem in sb-cover
* The logic for selecting the innermost form that contains
a given character in the source file did not work correctly in
cases where an exact location could not be found for some source
path. This should mainly happen when reader macros are involved.
* Instead of sorting the source paths by the length of the path,
sort them by the length of the character range of the source
location.
Juho Snellman [Tue, 5 Jun 2007 09:44:12 +0000 (09:44 +0000)]
1.0.6.22: fix occasional UNBOUND-VARIABLE errors in MAP-REFERENCING-OBJECTS
* Introduced by the removal of (SAFETY 0) in room.lisp a while ago
Juho Snellman [Tue, 5 Jun 2007 09:41:29 +0000 (09:41 +0000)]
1.0.6.21: get rid of a runtime compiler note in the PCL cache code
* For some reason appeared only on x86-64, not x86.
Nathan Froyd [Tue, 5 Jun 2007 02:13:19 +0000 (02:13 +0000)]
1.0.6.20: add INSERT-ARRAY-BOUNDS-CHECKS declaration to WITH-PUSH-CHAR
* Part of the fun of having good abstractions is being able to
throw all caution to the wind inside the abstraction. This
gives another little speedup on printing floats.
Nathan Froyd [Mon, 4 Jun 2007 23:11:46 +0000 (23:11 +0000)]
1.0.6.19: optimize BIGNUM-TRUNCATE'ing by small powers of two
* This is a common case when printing floating-point numbers. On
the simple "print a million single-floats" benchmark, this wins
by about 20-25%;
* Also fold a few i+1 loop variables into their only use; doing so
is not much worse that what we had before and slightly better if
the backend supports DATA-VECTOR-REF-WITH-OFFSET.
Christophe Rhodes [Sun, 3 Jun 2007 20:02:35 +0000 (20:02 +0000)]
1.0.6.18: Two fixes from Eric Marsden
... DEFPACKAGE :USE/:IMPORT-FROM takes package designators
... REMOVE-DUPLICATES / :TEST-NOT / vectors
Include test cases, and do a little bit of other tidying
of test case expected failures.
Christophe Rhodes [Sun, 3 Jun 2007 18:20:08 +0000 (18:20 +0000)]
1.0.6.17: Housekeeping from specializer changes
Comments and documentation only.
Nikodemus Siivola [Sat, 2 Jun 2007 13:26:34 +0000 (13:26 +0000)]
1.0.6.16: add SB-POSIX:GETCWD
* Based on patch by Tassilo Horn.
* Factor out the growing buffer -logic used by both getcwd() and
readlink(), and make it not leak memory so easily.
Nikodemus Siivola [Sat, 2 Jun 2007 12:33:42 +0000 (12:33 +0000)]
1.0.6.15: add SB-POSIX:LOCKF
* Patch by Zach Beane, also add a CREDITS entry for him.
Nikodemus Siivola [Sat, 2 Jun 2007 12:12:37 +0000 (12:12 +0000)]
1.0.6.14: slightly more efficient FLONUM-TO-DIGITS
* Implement SB-IMPL::WITH-PUSH-CHAR: an efficient way of constructing
shortish strings one character at a time.
* Use it instead of a string with fill-pointer in FLONUM-TO-DIGITS:
Speeds up naive float printing tests by ~10%, and causes them to
cons approx. 7% less.
Nikodemus Siivola [Sat, 2 Jun 2007 10:50:59 +0000 (10:50 +0000)]
1.0.6.13: minor fix to the compiler's interval-arithmetic
* When calculating the interval of (* some-number constant-zero),
multiply the signums of the interval endpoints, not the numbers
themselves: this avoids compile-time breakage when the zero is a
float and the non-zero number is too large to be represented as a
float.
Christophe Rhodes [Sat, 2 Jun 2007 09:04:10 +0000 (09:04 +0000)]
1.0.6.12: Improve user-subclassed SB-MOP:SPECIALIZER support
In order to support surface syntax for users in DEFMETHOD,
define and bootstrap a new SB-PCL:MAKE-METHOD-SPECIALIZERS-FORM
(a bit like SB-MOP:MAKE-METHOD-LAMBDA). This or something like
it is fundamentally necessary to support EQL specializers, which
as syntax have a bit which is syntax and a bit which is
evaluated in the lexical environment of the DEFMETHOD form.
Bootstrapping it is a little tedious, but (eventually) work out
where parsed specializers can be made and where we don't yet
have FIND-CLASS in the bootstrap. In the course of that, note
that we need to be able to parse and unparse specializers at
runtime: parsing to support FIND-METHOD; unparsing to get nice
names for our method functions in backtraces. Define an
experimental interface for that, too (see NEWS).
In the process, fix a couple of bugs in NO-NEXT-METHOD handling;
it is not safe to assume that the compile-time method name can
be used to find the method object. Instead, fight a little bit
with the file compiler to have a cons cell shared between the
method function and the method initargs, and arrange to have the
cell's CAR be set to the method once it is created; then we can
do NO-NEXT-METHOD sanely.
Tests for the no-next-method stuff, and adjust wonky find-method
specializer arguments in other tests.
Nikodemus Siivola [Fri, 1 Jun 2007 17:51:53 +0000 (17:51 +0000)]
1.0.6.11: PRINT-OBJECT method adjusted for new caches
* "Oops" -- missed from the original cache commit.
Nathan Froyd [Fri, 1 Jun 2007 03:05:10 +0000 (03:05 +0000)]
1.0.6.10: put --disable-debugger back where it belongs
* it was accidentally deleted in a previous commit.
Nathan Froyd [Fri, 1 Jun 2007 03:02:11 +0000 (03:02 +0000)]
1.0.6.9: micro-optimize portions of the reader
* use the more idiomatic (and better optimized) MAKE-ARRAY/REPLACE
combination to grow the read buffer;
* host some special variable accesses and eliminate bounds checking
in CASIFY-READ-BUFFER.
Nathan Froyd [Fri, 1 Jun 2007 02:57:48 +0000 (02:57 +0000)]
1.0.6.8: improve (SUBSEQ FOO 0 ...) on arrays with elements >= word-size
* check for a constant-valued start parameter and pass its value
through to the loop-generating machinery. Before we would have
compared 'START to 0, which always fails; now we can recognize
that case and generate better code.
Nikodemus Siivola [Wed, 30 May 2007 13:55:59 +0000 (13:55 +0000)]
1.0.6.7: thread-safe UPDATE-DFUN
* Make GET-SPINLOCK detect unwanted recursion. Despite the old
comments in GET/RELEASE-SPINLOCK, we can store EQ-comperable lisp
objects in SPINLOCK-VALUE -- just like we do for mutexes.
(Potentially freshly consed bignums that the old comments referred
to are not sanely EQ-comperable, of course.)
* Implement WITH-RECURSIVE-SPINLOCK.
* Adjust thread.impure.lisp accordingly.
* Add a per generic function spinlock. (We could use mutexes, but
since contention is presumed to be rare we don't want to pay the
wakeup syscall cost for every UPDATE-DFUN call: if and when our
mutexes get smart doing the wakeup only when there are threads
waiting we can and should switch this -- and probably almost all
uses of spinlocks -- to mutexes.) This spinlock is grabbed to
ensure that the dfun state, fin function, and name are all updated
atomically.
Nikodemus Siivola [Tue, 29 May 2007 15:31:48 +0000 (15:31 +0000)]
1.0.6.6: delete remains of the unoptimized-cache function code paths
* 1.0.6.3 did away with the main body of the code, but actual access
points to the now-missing code paths were accidentally left in.
Nikodemus Siivola [Tue, 29 May 2007 14:36:23 +0000 (14:36 +0000)]
1.0.6.5: potential CLOS GC safety issue
* EMIT-FETCH-WRAPPER needs to emit code that checks that it has a
real standard instance (as opposed to a structure) before it can
pull the slots: if the structure eg. has no slots at all we would
be pulling garbage into a lisp variable, which is not good (TM),
though it should be non-serious on GENCGC platforms.
To make this fast we add a new slot to LAYOUT: FOR-STD-CLASS-P,
which is always NIL for layouts, and T for wrappers.
* Remove one redundant SET-DFUN, which may have been needed in long-gone
days when cache vectors were resourced, but not anymore.
Nikodemus Siivola [Tue, 29 May 2007 08:46:32 +0000 (08:46 +0000)]
1.0.6.4: restore buildability on non-SBCL hosts
* SB!VM, not SB-VM in genesis.lisp. Reported by Peter Graves on sbcl-devel.
Nikodemus Siivola [Mon, 28 May 2007 18:52:26 +0000 (18:52 +0000)]
1.0.6.3: thread and interrupt safe CLOS cache
* New cache implementation. While the patch appears to modify
src/pcl/cache.lisp, it is really a wholesale reimplementation.
-- Use compare-and-swap to provide atomicity where necessary.
-- Layouts are write-once, but cached values can be replaced
atomically.
-- Expanding the cache (or dropping invalidated and incomplete
entries) copies the cache.
-- Use ..EMPTY.. as a sentinel value to denote unused cache line
slot.
-- Cache index zero is no longer special.
-- Maximum cache size is limited to avoid ridiculously huge caches.
-- API changes in the cache code: MAKE-CACHE replaces GET-CACHE.
PROBE-CACHE now returns a primary indicating a hit or a miss,
and returns the probed value as the second return value.
* Move remaining non-cache related code from cache.lisp.
* Delete unused closure-based dispatch code (src/pcl/dlisp2.lisp). If
we want to support a compilerless build at some future date this
code can be always resurrected from the CVS -- or better yet, can
be re-implemented.
* Delete MAKE-FINAL-ONE-INDEX-ACCESSOR-DFUN, inlining it to the
call-sites for easier understanding. (Yes, there is such a thing as
too much abstraction.)
Nikodemus Siivola [Mon, 28 May 2007 15:16:22 +0000 (15:16 +0000)]
1.0.6.2: remove multiple layout-clos-hash slots
* It seems that despite the claims of the paper "Efficient Method
Dispatch in PCL" the multiple hash seeds yield a neglible benefit.
* The soon-to-come thread safe cache also uses only a single hash
value, so removing these now allows better performance comparisons:
multiple hash values vs. single hash value vs. new cache.
Actual work done mostly by Christophe Rhodes.
Nikodemus Siivola [Mon, 28 May 2007 14:07:03 +0000 (14:07 +0000)]
1.0.6.1: marginally nicer "name" for socket streams
* "a socket" instead of "a constant string". It might be worth while
to actually make this based on the socket-name and -peername,
though.
William Harold Newman [Sun, 27 May 2007 01:13:28 +0000 (01:13 +0000)]
1.0.6: release, will be tagged as sbcl_1_0_6
Nikodemus Siivola [Sun, 20 May 2007 12:34:29 +0000 (12:34 +0000)]
1.0.5.56: conditionally re-enable interrupts interrupting current thread
* New variable: *IN-INTERRUPTION* is true IFF we're being called inside
*IN-INTERRUPTION* and there are no intervening WITHOUT-INTERRUPTS.
* INTERRUPT-THREAD calls the interrupt function inside WITH-INTERRUPTS
when interrupting the current thread IFF *IN-INTERRUPTION* is true.
* Remove bogus FIXME by yours truly from INVOKE-INTERRUPTION and
properly explain what is going on -- and add another FIXME in its
place.
This makes nested SIGINTs DTRT.
Nikodemus Siivola [Sun, 20 May 2007 11:34:59 +0000 (11:34 +0000)]
1.0.5.55: interrupt safe REFILL-BUFFER/FD
* Check for blocking / wait for new input before touching the stream.
* Check that the SAP is still there after the wait, in case an interrupt
handler or an FD handler closed the stream from under us.
* Wrap the main action in WITHOUT-INTERRUPTS to prevent asynch unwinds
from leaving the stream in an inconsistent state. (Since the read
is going to be non-blocking it should be over soon enough.)
* Arrange to signal errors outside the WITHOUT-INTERRUPTS.