This commit does four things:
* Adds "pb.ss" and "pb.c", which implement a portable bytecode
backend and interpreter that is intended for bootstrapping. A
single set of pb bootfiles can support bootstrapping on all
platforms --- as long as the C compiler supports a 64-bit integer
type. The pb machine supports foreign calls for only a small set of
recognized prototypes, and it does not support foriegn callables.
Use `./configure --pb` to build the pb variant.
* Changes the kernel's casts between `ptr` and `void*` types. In a pb
build, the `ptr` type can be a 64-bit integer type while `void*` is
a 32-bit pointer type, so casts must go through an intermediate
integer type.
* Adjusts the compiler to accomodate run-time-determined endianness.
Making the compiler agnostic to word size is not practical, but
only a few pieces depend on the target machine's endianness, and
those can generally be deferred to a run-time choice of byte-based
operations. The one exception is that ftype bit fields are not
allowed unless accompanied by an explicit endianness declaration.
* Start reducing duplication among platform-specific makefiles. For
example, `Mf-ta6osx` chains to `Mf-a6osx` to avoid repeating most
of it. A lot more can be done here.
original commit: 97533fa9d8b8400b0dc1a890768c7d30c91257e0
- added invoke-library
syntax.ss, primdata.ss,
8.ms, root-experr*,
libraries.stex, release_notes.stex
- updated the date
release_notes.stex
- libraries contained within a whole program or library are now
marked pending before their invoke code is run so that invoke
cycles are reported as such rather than as attempts to invoke
while still loading.
compile.ss, syntax.ss, primdata.ss,
7.ms, root-experr*
- the library manager now protects against unbound references
from separately compiled libraries or programs to identifiers
ostensibly but not actually exported by (invisible) libraries
that exist only locally within a whole program. this is done by
marking the invisibility of the library in the library-info and
propagating it to libdesc records; the latter is checked upon
library import, visit, and invoke as well as by verify-loadability.
the import and visit code of each invisible no longer complains
about invisibility since it shouldn't be reachable.
syntax.ss, compile.ss, expand-lang.ss,
7.ms, 8.ms, root-experr*, patch*
- documented that compile-whole-xxx's linearization of the
library initialization code based on static dependencies might
not work for dynamic dependencies.
system.stex
- optimized bignum right shifts so the code (1) doesn't look at
shifted-off bigits if the bignum is positive, since it doesn't
need to know in that case if any bits are set; (2) doesn't look
at shifted-off bigits if the bignum is negative if it determines
that at least one bit is set in the bits shifted off the low-order
partially retained bigit; (3) quits looking, if it must look, for
one bits as soon as it finds one; (4) looks from both ends under
the assumption that set bits, if any, are most likely to be found
toward the high or low end of the bignum rather than just in the
middle; and (5) doesn't copy the retained bigits and then shift;
rather shifts as it copies. This leads to dramatic improvements
when the shift count is large and often significant improvements
otherwise.
number.c,
5_3.ms,
release_notes.stex
- threaded tc argument through to all calls to S_bignum and
S_trunc_rem so they don't have to call get_thread_context()
when it might already have been called.
alloc.c, number.c, fasl.c, print.c, prim5.c, externs.h
- added an expand-primitive handler to partially inline integer?.
cpnanopass.ss
- added some special cases for basic arithmetic operations (+, -, *,
/, quotient, remainder, and the div/div0/mod/mod0 operations) to
avoid doing unnecessary work for large bignums when the result
will be zero (e.g,. multiplying by 0), the same as one of the
inputs (e.g., adding 0 or multiplying by 1), or the additive
inverse of one of the inputs (e.g., subtracting from 0, dividing
by -1). This can have a major beneficial affect when operating
on large bignums in the cases handled. also converted some uses
of / into integer/ where going through the former would just add
overhead without the possibility of optimization.
5_3.ss,
number.c, externs.h, prim5.c,
5_3.ms, root-experr, patch*,
release_notes.stex
- added a queue to hold pending signals for which handlers have
been registered via register-signal-handler so up to 63 (configurable
in the source code) unhandled signals are buffered before the
handler has to start dropping them.
cmacros.ss, library.ss, prims.ss, primdata.ss,
schsig.c, externs.h, prim5.c, thread.c, gc.c,
unix.ms,
system.stex, release_notes.stex
- bytevector-compress now selects the level of compression based
on the compress-level parameter. Prior to this it always used a
default setting for compression. the compress-level parameter
can now take on the new minimum in addition to low, medium, high,
and maximum. minimum is presently treated the same as low
except in the case of lz4 bytevector compression, where it
results in the use of LZ4_compress_default rather than the
slower but more effective LZ4_compress_HC.
cmacros,ss, back.ss,
compress_io.c, new_io.c, externs.h,
bytevector.ms, mats/Mf-base, root-experr*
io.stex, objects.stex, release_notes.stex
original commit: 72d90e4c67849908da900d0b6249a1dedb5f8c7f
After a bignum computation using temporary thread registers W, U, or V
is complete, clear ther register. (The X and Y registers hold only
small bignums, so clearing them doesn't matter in the same way.)
original commit: a9e11fcf9e86aee5d149764476e1fabfeee12f84
A few shift lefts cause ub because of `(1 << n)` where `n` is 31.
The constant 1 is signed causing ub. Initially my fix was to do `(1U << n)` however, I have seen the pattern `((U32)1 << n)` elsewhere in the file so decided to follow this.
Caught by ubsan racketcs.
original commit: a902c9ab67010f521f786e2027d4e197d78975a4
On a 64-bit platform, the test for "short" arguments to
avoid overflow was incorrect, because `(- (expt 2 30))`
counted as short.
original commit: 6d05b70e86987c0e7a07f221ba5def492300aaaf
- added a cast to eliminate warnings in c/number.c
- fixed bug in Windows version of directory-separator-predicate in s/6.ss when path-* procedures are passed a path that is not a string.
- fixed bug in s/cp0.ss on Windows with $foreign-wchar?.
- fixed spelling of non-existent
original commit: dd1b741f7572cb0d5a6210c7c796aee7c4026040
obviated scale_float in the process.
number.c,
ieee.ms
- fixed 0eNNNN for large NNNN to produce 0.0 rather than infinity
strnum.ss,
5_3.ms
- the reader now raises an exception with condition type implementation
restriction (among the other usual lexical condition types), and
string->number now raises #f, for #e<m>@<a>, where <m> and <a> are
nonzero integers, since Chez Scheme can't represent polar numbers other
than 0@<a> and <m>@0 exactly. <m>@<a> still produces an inexact result,
i.e., we're still extending the set of inexact numeric constants beyond
what R6RS dictates. doing this required a rework of $str->num, which
turned into a fairly extensive rewrite that fixed up a few other minor
issues (like r6rs:string->number improperly allowing 1/2e10) and
eliminated the need for consumers to call $str->num twice in cases
where it actually produces a number. added some related new tests,
including several found lacking by profiling. added a couple of
checks to number->string whose absence was causing argument errors to
be reported by other routines.
strnum.ss, exceptions.ss, read.ss
5_3.ms, 6.ms, root-experr*, patch*
- added pdtml flag, which if set to t causes profile-dump-html to be
called at the end of a mat run.
mats/Mf-base
original commit: 03f2fe86171b0fd096238280b351ce365c701450
left shift to avoid counting on the behavior of << on negative numbers,
which is undefined in C.
mkheader.ss
- Fixed a couple of casts, one harmless and the other causing
Sinteger64_value to return 0 for the most-negative I64 on 32-bit
builds.
number.c
- The configure-generated Makefile distclean target no longer removes
zlib and nanopass, since they are logically part of the git clone.
It does run make distclean in zlib.
makefiles/Makefile.in
original commit: 42e6fed96d69fa17cfcd9cdcec101aaa36ba4512