Add hook in dynamically loaded modules for unloading actions.
Dynamically loaded modules can't use reload cleanups, because they
may be unloaded by pruxdld's reload cleanup before their reload
cleanups get to run, causing DISK-RESTORE to attempt to execute
unmapped code. Instead, pruxdld will now call dload_finalize_file
if it is defined in the file.
Use this mechanism in prx11. Fixes DISK-RESTORE after launching
and exiting Edwin. (Does not fix DISK-RESTORE of an image that was
saved while Edwin was running. That is much harder.)
Cache parsed date, subject, author, and recipient in memory in IMAIL.
This is not really the right thing, but it substantially speeds up
sorting, and slightly speeds up summarization, without requiring the
memory overhead of keeping whole headers strongly in memory.
What IMAIL should really do is
(1) store headers (and bodies and body structures and so on) strongly
in memory, and use a secondary GC daemon to discard them when space is
short; and
(2) use a generic, compact, on-disk cache, for every folder, of the
important information for each message: date, subject, author,
recipient, message-id, thread-id.
Conditionalized compilation of the flonum casting primitives.
The primitives `cast-ieee754-double-to-integer' and
`cast-integer-to-ieee754-double' are omitted when the type
<uint64_t> is not available.
Added <AC_INT64_T> and <AC_UINT64_T> to "configure.ac". The latter is
now required by "flonum.c" because of the new primitives I added, and
CPH asked me to include the former, too.
Make the GC cleverer about reallocating the ephemeron array, in order
to avoid potentially quadratic-time behaviour in MAKE-EPHEMERON and
fasloading files with ephemerons in them.
Now fasls and bands with ephemerons in them should really work, this
time with feeling...
In the process, complete the transition to the STACK_END fasl format.
In the EPHEMERON fasl format, the fasl header has an extra field for
the number of ephemerons stored in the fasl, for which the fasloader
reserves space in ephemeron_array.
The fasdumper chooses between the C_CODE, STACK_END, or EPHEMERON
fasl format for maximum compatibility:
- If there are any ephemerons in the fasl, the fasdumper chooses the
EPHEMERON format. Older microcodes don't know about ephemerons and
thus can't handle such fasls anyway.
- If dumping a band, the fasdumper chooses the STACK_END format,
since the only differences between the C_CODE format and the
STACK_END format matter only for bands. Support for reading the
STACK_END format was added in version 15 of the microcode; any
newly created bands are not likely to be used in older microcodes
than that anyway.
- Otherwise, the fasdumper chooses the C_CODE format, like before.
Removed NaN tests because they cause traps on Linux. (It turns out
that they are supposed to on OS X, too, but a bug prevents that).
Taylor is considering adding support for controlling the
floating-point exception mask and flags, in which case we'll be able
to manipulate NaN values and I can add these tests back.
* Renamed `cast-flonum-to-integer' to `cast-ieee754-double-to-integer'.
* Renamed `cast-integer-to-flonum' to `cast-integer-to-ieee754-double'.
* Changed both to use <uint64_t> instead of <unsigned long> for
conversion. That way, they should work on 32-bit systems. (Thanks to
Taylor for pointing out that bug.)
* Added `cast-ieee754-single-to-integer' and `cast-integer-to-ieee754-single'.
* Updated existing tests.
* Added tests for casts to and from single-precision floating-point numbers.
Removed the divisions by zero that I had used to create floating-point
infinities since those are supposed to trap, not actually return
infinities. On OS X, the trap doesn't happen, but I shouldn't depend
on a bug.
Since this is used only to initialize trampolines, the starting
instruction is irrelevant, and will be garbage anyway because the
trampoline blocks are always freshly allocated.
In FLO:VECTOR-LENGTH, coerce length to fixnum before OBJECT->FIXNUM.
The previous open-coding worked whenever OBJECT->FIXNUM merely
shifted left by the tag width, ignoring whatever tag was there
before. The SVM does not do this, however.
Omit continuation code words after interpreter cache references.
The RTL already arranges their continuations to follow them; putting
an extra continuation code word causes the machine to try to execute
the real one as if it were an instruction.
When queueing ephemerons for the key stored at some address, compare
the address to the weak referent address of each ephemeron's key --
not to the object address of each ephemeron's key, which causes us to
miss ephemerons whose keys are compiled entries, because we pass the
addresses of compiled blocks, never those of the compiled entries
stored in them, to queue_ephemerons_for_key.
Omit needless definition of REFERENCE-BARRIER in test-ephemeron.scm.
Due to a bug in the microcode's environment operations, this
definition, which should be harmless, actually renders the tests
unrunnable because it makes REFERENCE-BARRIER spin in an infinite
loop.
Eliminate losing bisection crock in find_block_address.
This wasted several hours of my day in exchange for several
milliseconds of time (`on average') searching through the heap
after a trap that will trigger an interactive debugger anyway
and sit waiting for I/O.
(REFERENCE-BARRIER <x>) guarantees that the garbage collector will
assume <x> to be live at least until the call to REFERENCE-BARRIER,
if control can ever reach it.
This is implemented as an alias for the identity procedure currently,
but a more efficient implementation not involving a general procedure
call is conceivable for the future.
For usage, see runtime/stack-sample.scm. May be worthwhile to write
documentation in the user manual.
This is *not* a replacement for a PC-sampler, which can give
information that is more precise at one level and less precise at
another level. See the comments for details.
This simplifies some of the code (at the expense of a longer
definition for the abstraction leading to a longer hashtb.scm
altogether), and makes it less prone to mistakes with using the
keys and data of entries without checking their validity -- which
will matter especially for hash tables with ephemeron entries when
those are implemented.
Check the results of the key hash table function. Sprinkle some
guarantees throughout the code. Disable type and range checks in
the hash table methods, where it is safe to do so.
With type and range checks still enabled, performance on strong eq
and eqv hash tables is no different from what it was last week.
Performance on weak hash tables is ever so slightly worse, but that
is because weak hash tables were incorrect before.
The specification makes no mention of any constraint that the combine
procedure not update the hash table, so we must be prepared for that
case. The old definition for HASH-TABLE-FOLD now has the new name
%HASH-TABLE-FOLD, used internally by the procedures that need to fold
but need not update the hash table while doing so.
Ephemerons are like weak pairs, except the datum is dropped if the
key is dropped, and references to the key through the datum don't
count if the only references to the datum are through the ephemeron.
In other words, the weak references to the key and datum are dropped
iff the key can be proven dead; conversely, the references to the key
and datum are preserved iff somebody else cares about the key.
Add configure option `--with-termcap=LIB' to select termcap library.
LIB=no disables any termcap library (causing the use of the built-in
termcap emulation); LIB=yes, the default, makes configure choose
whatever termcap library looks best.
I wanted to go further and make the termcap primitives dynamically
loadable, so that the compile-time choice of termcap library can be
made just for some prtermcap.so module separately from the libraries
against which the microcode is linked, but uxtty.c uses termcap for
screen-clearing and window-sizing.
If ^L worked everywhere to clear the screen, and TIOCGWINSZ worked
everywhere to find the screen dimensions, then we could get rid of
those uses of termcap and move it off to a module. But alas, that is
not the case. E.g., ^L doesn't clear the screen in screen.
New procedures FLO:EXPM1 and FLO:LOG1P just like libm's.
Defined only on an interval about 0 of radius 1/log 2 and 1/sqrt 2,
respectively; intended for computing (exp x) - 1 and log (1 + x) for
very small x with high precision, unlike FLO:EXP and FLO:LOG.
Be slightly more consistent about references to MIT_SCHEME_EXE.
It is to be interpreted as a pathname, provided that no character in
it be a make meta-character, or a shell meta-character that has
meaning within double-quotes. It shouldn't have such constraints,
but Unix sucks. To set the library path, use MITSCHEME_LIBRARY_PATH
rather than sticking a `--library' argument in MIT_SCHEME_EXE.
Ensure that signal handlers see the C stack, not the Scheme stack.
Do this by wrapping all the signal handlers in stubs that call an
assembly hook to make the stack pointer point into the C stack rather
than the Scheme stack if necessary. To indicate that this is not
necessary, define SIGNAL_HANDLERS_CAN_USE_SCHEME_STACK. For now, I'm
leaving that undefined by default, because it is the safer option.
This solves a problem on operating systems such as NetBSD that store
the current pthread identifier in the stack pointer. When Scheme's
signal handler calls routines that are pthread cancellation points,
such as waitpid, they try to find the current pthread identifier in a
stack pointer that points off into oblivion (into Scheme's stack) and
promptly crash -- or, worse, trigger SIGSEGV, to be handled by a
signal handler while the stack pointer still points into Scheme's
stack, with the same problem.
I am told that this will be fixed in NetBSD 6 (since it interferes
not just with Scheme but also with sigaltstack, makecontext, and
anything else that wants to mess with the stack pointer), but only on
i386 and amd64 for certain, and in any case, this workaround will
work on any other systems that try to use the same trick to store the
current pthread identifier, of which I believe there may be several.
(E.g., older versions of GNU/Linux with LinuxThreads.)
Use intmax and uintmax to support 64-bit off_t, time_t, &c.
Eliminate BIGNUM_NO_ULONG. Twenty years ago it may have made sense;
now too much of the system relies on having unsigned longs for it to
matter.
New routines convert between integers and intmax/uintmax. The old
ones for long/unsigned long are still there, because they are likely
to be much faster on 32-bit systems. Only a few uses of long have
been replaced by intmax -- the ones where it was obvious we were
converting between time_t, off_t, ino_t, &c., and long. Others may
still be there. Before: