* 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.
* 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.
* To make it easier to find out when there are new failures.
* Patch by Robert Brown.
* 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.
* 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.
* 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
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.
…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.
* 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.
* 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
* 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.
* 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.
* 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.
* 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.
...and adjust commentary in UPDATE-DFUN.
* 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.
* Instead of looping to find the underlying one-dimensional simple array, just return it directly.
* Ensure that *UNWIND-TO-FRAME-FUNCTION* has a TLS index