All the unibyte-mapper-based external-formats had huge amounts of
cut-and-pasted code, differing only in names of functions. This is,
oddly enough, a clear case for abstracting away the repeated code into a
macro.
In the process, convert them to the multibyte apparatus, which has support
for the nice restarts, and remove the too-simple unibyte
DEFINE-EXTERNAL-FORMAT (and EXTERNAL-FORMAT-DECODING-ERROR) which are now
unused.
Include a far-from-comprehensive set of tests, which are mostly for
iso-8859-x formats
* Add a source transform for MAKE-ARRAY that declaims LIST and VECTOR
as NOTINLINE, so the the MAKE-ARRAY deftransforms are able to pick
them apart (for DIMENSIONS and :INITIAL-CONTENTS.)
* INITIALIZE-VECTOR is a new magic function with a IR2-CONVERT
transform. It's purpose is to allow open coding :INITIAL-CONTENTS
initialization without inhibiting stack allocation.
* Turns out that making stack allocation decisions during locall
analysis is not enough since optimization iterates: if a transform
occurs and introduces new LVARs that would be good for DX after
the locall analysis has run for the combination, the new LVARs
will not get their share of stacky goodness. Therefore, after
a transform propagate DX information to the new functional
explicitly (see MAYBE-PROPAGATE-DYNAMIC-EXTENT.)
* The new logic is in TRANSFORM-MAKE-ARRAY-VECTOR, which handles
all the cases of vector allocation with a known element type:
** :INITIAL-CONTENTS (LIST ...), (VECTOR ...) and (BACKQ-LIST ...)
are picked apart when the length matches the vector length,
and their arguments are spliced into the call.
Constant :INITIAL-CONTENTS is picked apart as well.
Initialization is done using INITIALIZE-VECTOR.
** Otherwise :INITIAL-CONTENTS is splatted in place using
REPLACE after we have checked that the length matches.
** :INITIAL-ELEMENT not EQL to the default element uses
FILL.
** Otherwise the default initialization is fine.
Some additional hair here, since MAYBE-PROPAGATE-DYNAMIC-EXTENT
cannot deal with OPTIONAL-DISPATCH functionals. So to ensure we get
full benefit of it, make sure the lambdas we transform to have only
required arguments -- courtesy of new ELIMINATE-KEYWORD-ARGUMENT
utility. (Note: it might be worth it to do something like this for
many cases automatically, to reduce the number of lambdas the
compiler generates. For inline lambdas we could do the whole &key
handling _before_ the lambda is converted...)
* Identify the case of (LIST N) as dimensions as being a vector,
and delegate to TRANSFORM-MAKE-ARRAY-VECTOR.
* More efficient allocation of simple multidimensional arrays in
the presence of :INITIAL-CONTENTS (still slow, though) and
:INITIAL-ELEMENT (not bad.)
* Fix the source transform for VECTOR so that it too can stack
allocate.
* Updates tests and docs.
* Core change: %COERCE-CALLABLE-TO-FUN can now convert to
GLOBAL-FUNCTION.
* While at it, refactor the whole "make up a form that returns a
function to use instead of this lvar or source form" thing for
clarity.
* Record slightly crazy OPTIMIZATION possibility.
* Coalesce non-circular lists, bit-vectors, and non-base-strings in the
file-compiler. (We could do more, but these are the "easy" ones.) Takes
care of OPTIMIZATIONS #34 in practice: outside the file compiler one can
still trick the system into similar behaviour, but that seems a fairly
academic concern.
* Never go through SYMBOL-VALUE at runtime to fetch the value of a constant
variable in compiled code.
* Use (SYMBOL-VALUE <NAME>) as the load-form to dump references to named
constants into fasls.
* Signal a continuable error if an attempt to change the SYMBOL-VALUE of a
constant variable is made.
* Assignments to undefined variables go through SET, so that one
cannot accidentally modify a constant by doing something like:
(defun set-foo (x) (setq foo x))
(defconstant foo 42)
(set-foo 13)
* Gets rid of INFO :VARIABLE :CONSTANT-VALUE, and just uses SYMBOL-VALUE to
store constant values.
* Move definition of SB!XC:LAMBDA-LIST-KEYWORDS to be beginning of the build,
and use it instead of the host LAMBDA-LIST-KEYWORDS where appropriate.
* Tests.
* HANDLE-NESTED-DYNAMIC-EXTENT maps over all the uses of the LVAR,
collecting their argument lvars as well.
* RECHECK-DYNAMIC-EXTENT-LVARS accepts multiply-used DX LVARs,
checking that all uses support stack allocation.
* UPDATE-UVL-LIVE-SETS accepts multiply-used DX LVARs, doing that
lifetime merging with all uses.
* ...and OOPS, move the NEWS entries of .5 and .6 to a new section for
1.0.11...
* RECOGNIZE-DYNAMIC-EXTENT-LVARS needs to propagate DX information to
combination arguments, so that
(LET ((X (LIST (LIST 1 2) (LIST 3 4))))
(DECLARE (DYNAMIC-EXTENT X))
(FOO X))
does the right thing.
* Extend EMIT-FIXED-ALLOC to support stack-allocation.
* Appropriate DEFOPTIMIZER for CONS.
Note: it seems like it should be a simple matter to support stack
allocation of all primitive objects allocated using the :ALLOC-TRANS
framework.
* 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.
Add RESTART-FRAME command to the debugger, reduce the runtime cost
of the debug catch tags.
* Change the debugger catch tag to funcall the thrown value, rather
than just returning it.
* Make RETURN throw a thunk that returns an appropriate value,
and RESTART-FRAME throw a thunk that calls the same function again
with the same arguments.
* Always emit the debug catch with a static tag, rather than consing
up a new tag every time the catch is entered.
* To ensure that the tags are unique, the RETURN and RESTART-FRAME
commands will first cons up a new tag, find the right catch-block
structure on the stack, assign the new tag to the tag slot, and
then throw the new tag.
* Don't add the catch tags to some uninteresting (usually
compiler-generated) functions, to reduce the compilation speed
hit.
Introduce new vm-support-routine COMBINATION-IMPLEMENTATION-STYLE
for letting the backend have a crack at implementing certain
functions directly (cf. OPTIMIZATIONS, #29);
...implement a few efficient cases for PPC and x86.
Micro-optimizations:
* MAKE-FIXNUM on PPC now takes one instruction rather than two;
* signed-num INTEGER-LENGTH VOP on PPC does not require a
temporary register;
* Added unsigned-num INTEGER-LENGTH VOP on PPC;
* Musings on processor-specific micro-optimizations added to
OPTIMIZATIONS.
Merge DFL raw-slots patch (sbcl-devel "raw slot changes"
2005-05-18)
... with an amalgam of ths' two mips versions;
... note in OPTIMIZATIONS about the negative index idea, and the
disabledness of HPPA
* Changed implementation on ALLOCATE-VECTOR on X86:
... two VOPs: A-V-ON-HEAP and A-V-ON-STACK;
... choice between them is made with LTN-ANALYZEr;
... A-V-ON-STACK always fills vector with zeroes (fixes bug
reported by Brian Downing).
Port over / reconstruct ancient CMUCL loop analysis code.
Improve register allocation:
... Pack TNs that are used in deep loops first, giving them a
higher chance of getting allocated in a register.
... Inside loops, pack the most used TNs first.
... When (> SPEED COMPILE-SPEED) attempt to pack the TNs into
the most used locations in the SB instead of the earlier
behaviour of scattering them into as many locations as
possible. This results in tighter allocation / fewer spills.
Possibly pointless micro-optimization for SXHASH
... type tests for CONS are more expensive than type tests for
LIST. Distinguish between CONS and LIST manually, then,
so that we can return the right answer more quickly for
NIL.
... exposes a bug in the cross-compiler: SXHASH is most
definitely not constant-foldable there.
... be even more paranoid about SXHASH/PSXHASH testing
Minor adjustment to BIT, SBIT source transforms
... assert the dimensionality of the bit array based on the
number of arguments in the call;
... note potential for further optimization in OPTIMIZATIONS
Compiler fixes (touching only files in the alpha backend)
... the assembly routine for (signed-byte 32) [sic] truncate did
in fact work only for signed-byte 32 quantities, but was
being called on signed-byte 64 quantities. Fix it.
... the translators for ASH were broken in amusing ways: some
led to internal compiler errors when fed out-of-range
numbers; more insidiously, others allowed temporaries
to be overwritten in some cases. Fix them.
... lastly but not leastly, the %LI code to load an immediate
was wrong in a very small proportion of cases. After
much scribbling, deduce why and fix it.
... test cases to go with all of the above.
* Try to fix bug 267 = optimization issue #7: inside
NAMED-LAMBDA replace references to a function with the same
name with self-references;
* ASSERT-GLOBAL-FUNCTION-DEFINITION-TYPE: do not put type
assertions for functions with EXPLICIT-CHECK attribute;
... FLOAT-RADIX does not perform explicit check;
* implement cross-compiler versions of %DPB and %WITH-ARRAY-DATA.
Fix PPC (complex double-float) bug as reported on sbcl-devel
by Clemens Heitzinger 2003-08-12
... the right way, not as per CSR patch sbcl-devel, but as per
CSR words sbcl-devel;
... also fix error reporting in CERROR format DEFTRANSFORM
(oh, the irony).
Fix OPTIMIZATIONS #1b on x86, at Gilbert Baumann's request (on
#lisp IRC 2003-07-01)
... new VOPs for base-char comparisons with constant second
argument;
... new transforms for CHAR< and CHAR> to ensure that any constant
argument is second;
... don't fall into the trap of assuming that the world is ASCII;
instead, define SB!XC:CODE-CHAR and SB!XC:CHAR-CODE that
deal with converting STANDARD-CHARs to and from ASCII codes;
... in the interest of the sanity of those with slow machines, refactor
tests/seq.impure.lisp slightly so that it takes somewhat less
time than the cosmological epoch to run
* Fixed bug reported by Robert E. Brown on sbcl-devel
2003-01-21 (optimization issue 10)
** DERIVE-NODE-TYPE replaces references to lambda variables
of type (EQL x) with a constant reference to x;
** UNLINK-NODE checks for a possibility of IF optimization;
Fixed some bugs revealed by Paul Dietz' test suite:
** BOA constructor with &AUX argument without a default value does
not cause a type error;
** CONSTANTP now returns true for all self-evaluating objects.