Nikodemus Siivola [Mon, 13 Aug 2007 13:55:15 +0000 (13:55 +0000)]
1.0.8.25: refactor CAN-OPTIMIZE-ACCESS usage and interface
* Make the constant slot-name and the possible new-value-form
additional return values.
* Use CONSTANT-FORM-VALUE instead of EVAL to get the constant
slot-name. Also use the environment correctly to CONSTANTP
and CONSTANT-FORM-VALUE.
* Call CAN-OPTIMIZE-ACCESS in the various instance-access optimizers
and not around calls to them, so that they can directly use the
slot-name and new-value-form results from CAN-OPTIMIZE-ACCESS
instead of having to recompute them.
Nikodemus Siivola [Mon, 13 Aug 2007 13:41:49 +0000 (13:41 +0000)]
1.0.8.24: factor (THE TYPE FORM) => FORM transformations into a function
* EXTRACT-THE, for now only used in PCL.
Nikodemus Siivola [Mon, 13 Aug 2007 13:40:40 +0000 (13:40 +0000)]
1.0.8.23: merge CAN-OPTIMIZE-ACCESS and CAN-OPTIMIZE-ACCESS1
* First is the only caller of the first, so just move
the body to the call site.
Nikodemus Siivola [Mon, 13 Aug 2007 13:36:37 +0000 (13:36 +0000)]
1.0.8.22: merge MAKE-METHOD-FUNCTION and MAKE-METHOD-FUNCTION-INTERNAL
* First was the only caller of the latter -- just move the
body to the call site.
Nikodemus Siivola [Mon, 13 Aug 2007 13:34:49 +0000 (13:34 +0000)]
1.0.8.21: merge REAL-MAKE-METHOD-LAMBDA and MAKE-METHOD-LAMBDA-INTERNAL
* The first was the only caller of the latter, so just make the
body of the latter the body of the first.
Nikodemus Siivola [Mon, 13 Aug 2007 13:33:13 +0000 (13:33 +0000)]
1.0.8.20: replace PVREF by SVREF
* PVREF was a trivial wrapper macro around SVREF, and used in only
src/pcl/vector.lisp. This is easier to read for me at least.
Nikodemus Siivola [Thu, 9 Aug 2007 16:52:03 +0000 (16:52 +0000)]
1.0.8.19: :dont-safe finalizers and fd-stream thread safety issues
* Add :DONT-SAVE keyword argument to FINALIZE, which causes the finalizer
to be removed when core is saved: it is not amusing to have a finalizer
that deallocates system memory to fire in a fresh image which happens
to have freshly allocated memory in the same address. Also good for finalizers
closing FDs.
Use where appropiate.
* Stream buffing should not use (INCF (BUFFER-FOO BUFFER) N), since if another
thread has written to the buffer since we last looked at it this might take
eg. the TAIL index beyond the end of the allocated memory area: by doing
(let ((foo (buffer-foo buffer))) ... (setf (buffer-foo buffer) (+ foo n)) we might
overwrite the data from another thread, but at least we won't trash memory.
* Small graces: check that ALLOCATE-SYSTEM-MEMORY actually succeeds, don't accept
finalizers for NIL (they would just run immediately on next GC, which is almost
certainly not intended), take an extra mile to ensure old buffers from before
SAVE-LISP-AND-DIE don't survive to the new image.
Juho Snellman [Tue, 7 Aug 2007 06:15:13 +0000 (06:15 +0000)]
1.0.8.18: Fix gc-safety bug in x86oid function calls
* Off by one error in conservative stack scavenging, the top of the
stack wasn't pinned.
* In the new calling convention there is a small window during which
the return address only exists on the top of the stack. If a gc
was triggered during that window, the code object could move, and
the return address would point to freed memory.
Nikodemus Siivola [Mon, 6 Aug 2007 11:52:16 +0000 (11:52 +0000)]
1.0.8.16: really increment the fasl version
(file left out from previous commit)
Nikodemus Siivola [Mon, 6 Aug 2007 11:50:46 +0000 (11:50 +0000)]
1.0.8.16: refactored fd-stream buffering
Thanks to David Smith and Andreas Bogkt who diagnosed the memory
leaks this patch fixes.
* Instead of having FD-STREAM objects directly hold onto input and
output buffer SAPs and head/tail indexes, use BUFFER objects which
contain the SAP, size of the memory area, head/tail indexes, and
are have finalizers to deallocate the system memory assosicated
with the SAP. (This fixes system memory leaks when streams are not
properly closed.)
* Make CLOSE :ABORT release the output queue associated with the
stream. (This was another memory leak in the old system: now
the finalizers make not doing this safe, but it's still better
to recycle the buffers.)
* Slightly reduce lock contention by grabbing the *AVAILABLE-BUFFERS*
lock only if there is something there right before the lock is
taken, and by doing allocation outside the lock.
* Rename and refactor FROB-OUTPUT and friends:
BUFFER-OUTPUT is the main interface function, which always
adds new output to the current buffer / output queue.
WRITE-OR-BUFFER-OUTPUT tries to write immediately, falling
back to buffering if writing is not possible.
WRITE-OUTPUT-FROM-QUEUE is called by the SERVE-EVENT
system to deal with output queue.
FLUSH-OUTPUT-BUFFER writes the current buffer out if possible,
queues it otherwise. Ensures that the output buffer of
the stream is empty on return (and returns that buffer).
* Deprecate SB-SYS:OUTPUT-RAW-BYTES. There doesn't seem to be any
real reason to export this kind of stuff.
* Increment the fasl version.
Nikodemus Siivola [Sat, 4 Aug 2007 14:49:32 +0000 (14:49 +0000)]
1.0.8.15: making SBCL sources Git more friendly
* Git for SBCL Hackers guide.
* If branch-version.lisp-expr exists, it's value is concatenated
after the contents of version.lisp-expr, separated out by ".".
Doing this allows reduces spurious conflicts on branches: otherwise
a branch announcing it's name in version.lisp-expr is going to
conflict at every turn, which prevents automatic rebasing and
merging from doing TRT.
* Added .gitignore
Thiemo Seufer [Fri, 3 Aug 2007 22:58:24 +0000 (22:58 +0000)]
1.0.8.14: De-clutter C code.
Thiemo Seufer [Fri, 3 Aug 2007 22:56:07 +0000 (22:56 +0000)]
1.0.8.13: .cvsignore test output.
NIIMI Satoshi [Tue, 31 Jul 2007 03:10:46 +0000 (03:10 +0000)]
1.0.8.12: Fix tests/foreign.test.sh on FreeBSD7/amd64
Thiemo Seufer [Sun, 29 Jul 2007 19:32:10 +0000 (19:32 +0000)]
1.0.8.11: Fix typo in comment.
Thiemo Seufer [Sat, 28 Jul 2007 18:42:00 +0000 (18:42 +0000)]
1.0.8.10: Untabify.
Thiemo Seufer [Sat, 28 Jul 2007 12:53:00 +0000 (12:53 +0000)]
1.0.8.9: fix a potential segfault, and make a lisp pointercheck less obscure.
Nikodemus Siivola [Fri, 27 Jul 2007 12:09:10 +0000 (12:09 +0000)]
1.0.8.8: restore reuse-sap value after incomplete writes in FROB-OUTPUT-LATER
* Unless we do this, we leak each reusable sap that happens to hit this
code path.
* Thanks to David Smith.
Nikodemus Siivola [Fri, 27 Jul 2007 11:13:22 +0000 (11:13 +0000)]
1.0.8.7: printer-control variables affecting MEMBER & ASSOC transforms
Reported by Dan Corkill on sbcl-devel.
* Use WRITE-STRING on SYMBOL-NAME instead of FORMAT %A to ironclad
the specialized function name generation.
* Tests.
Thiemo Seufer [Fri, 27 Jul 2007 01:58:06 +0000 (01:58 +0000)]
1.0.8.6: Fix typo in comment.
Thiemo Seufer [Wed, 25 Jul 2007 22:21:46 +0000 (22:21 +0000)]
1.0.8.5: Conform to strict aliasing rules.
Thiemo Seufer [Wed, 25 Jul 2007 22:08:03 +0000 (22:08 +0000)]
1.0.8.4: One compiler warning less...
Thiemo Seufer [Wed, 25 Jul 2007 22:05:26 +0000 (22:05 +0000)]
1.0.8.3: Include missing headers.
Thiemo Seufer [Wed, 25 Jul 2007 21:46:39 +0000 (21:46 +0000)]
1.0.8.2: Silence compiler warning.
Thiemo Seufer [Wed, 25 Jul 2007 21:37:31 +0000 (21:37 +0000)]
1.0.8.1: Nicer C code
- More consistent formatting.
- Spelling fixes.
- Declare empty parameter lists as void.
William Harold Newman [Wed, 25 Jul 2007 13:39:33 +0000 (13:39 +0000)]
1.0.8: release, will be tagged as sbcl_1_0_8
Thiemo Seufer [Mon, 23 Jul 2007 20:29:55 +0000 (20:29 +0000)]
1.0.7.39: Fix typo in comment.
Thiemo Seufer [Mon, 23 Jul 2007 20:26:38 +0000 (20:26 +0000)]
1.0.7.38: Fix the MIPS single-stepper break instruction.
Nikodemus Siivola [Sat, 21 Jul 2007 13:33:53 +0000 (13:33 +0000)]
1.0.7.37: fix non-x86oid builds
* WITH-PINNED-OBJECTS needs to be a DEF!MACRO, not DEFMACRO. No SB!SYS prefix
needed, as SB-VM uses SB-SYS.
(Tested on only PPC/Darwin.)
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.