Use another indirection for representation of promises.
The pairs never change, so merely loading the pair object from the
cell indirection gives us an atomic snapshot of it. This way, there
is no need for without-interrupts in promise-forced?.
This makes each promise cost one more word (previously: one word to
represent plus three words of heap space; now one word to represent
plus four words of heap space), but reducing without-interrupts is a
big win -- this halves the time of test-promise.scm on my machine.
Of course, on a parallel system, the without-interrupts in %force is
still not enough (and we'll need the cell-contentses to be
load-acquire operations, not just loads).
Greatly simplify SCode abstraction and change names to contain "scode".
Also remove all FOO-components and FOO-subexpressions procedures.
More work remains: the lambda abstraction is an unholy mess and needs to be
cleaned up. The scan-defines stuff also merits some consideration.
which kinda reflects on the sensibility of using disjoint type
predicates across domains like this as one does in Scheme.
- Introduces a portable fasdumper that the compiler can use for
cross-compiling.
- Adapt the build system to use it. This form is not final: we
should really be using GNU configure's build/host/target form.
- Fix up the i386 back end, particularly floating-point stuff.
- Split svm1 into four architectures: svm1-32be, svm1-32le,
svm1-64be, svm1-64le. This way you can, e.g., use your x86 laptop
to cross-build an svm1-32le system to run on an arm32 machine.
- Various minor other fixes for cross-compilation.
Also read file in one swell foop, rather than character by character
in a slow painful chain of indirections thousands of times slower.
We'll use legacy strings here because this code was all written under
the assumption that `string' meant byte vector, and legacy strings
still have that semantics.
Eventually this should all be adapted to use bytevectors instead for
storage, and interpret things as strings only as necessary for text
processing beyond mail data formats.
Confirm that a couple screw cases in closure analysis work.
Once upon a time the Y combinator and U combinator would crash the
compiler. It's been fixed now but let's at least immortalize the
code I had lying around that crashed it so it doesn't happen again.
Fix mistaken expansion of flo:<> as flonum-is-less-or-greater?.
Global flo:<> is the ordered version, which raises exception on qNaN;
primitive flonum-is-less-or-greater? is the unordered version, which
returns false on qNaN.
The instruction sequence we had was not very good, e.g. (exp -708)
was off by far more than 1ulp. It can be done that way, but we need
to use 64-bit precision for it, and setting the i387 precision here
is getting a bit far afield from open-coding.
These are no longer integrated, so we can't make a compound procedure
call if they are interpreted -- the interpreter will stomp all over
Free while we're in the middle of allocating the string, leading to
mayhem. But it is safe to call the primitive, even though it is no
longer open-coded.
Do all-compiler/sf/cref only in cross-host, not in cross-target.
In the cross-compiled system when doing cross-target, which depends
on runtime.com and all.com, the dependencies of runtime.com and
all.com were already made by cross-host.
Teach cross-SF/CREF to dump/load in .nib, .txe, .dkp.
These correspond to .bin, .ext, .pkd. LOAD-OPTION still loads from
.bin, .ext, .pkd (and .com) for libraries that are installed and are
not macro definitions of subsystems being cross-compiled.
This backwards suffix business is getting a little out of hand.
Possible partial alternatives:
- .xbin/.xext/.xpkd
- invent a static linker in the toolchain that can run on the cross
host rather than using make.scm and disk-save in the cross target
- devise a portable fasload that sf/cref can use in the cross host
- use a machine-independent file format for .bin/.ext/.pkd
This breaks INHIBIT_FASL_VERSION_CHECK -- but that was already broken
so that Scheme would abort (!) before even getting to the check,
because of the conditional in fasl_object_address which is called by
decode_fasl_header.
If someone wants to revive INHIBIT_FASL_VERSION_CHECK, be my guest,
though it might be easier to do whatever you're trying to do with the
portable fasdumper instead.
1. moc->com in runtime, so the next stages can use a compiled runtime
2. moc->com in the whole tree
3. fni->inf in the whole tree
XXX Maybe the latter stages can be combined; for now this change just
splits the first two apart. Even better, maybe we can nix this step
altogether and teach the cross-fasdumper to do this part itself.
Wouldn't be hard to teach the cross-fasdumper to do the relocation
that currently requires sketchy with-absolutely-no-interrupts crap.
For compile-scode, could maybe just fasdump to a bytevector in memory
and invent a primitive to fasload from that.
Tweak fasdumper to null-terminate bytevectors too.
find_primitive relies on symbol names (which were formerly `strings',
i.e. `vector-8b' or TC_CHARACTER_STRING, and are now `bytevectors')
to be null-terminated.
Rather than try to figure out which ones are primitive names and
which ones are not, we'll just null-terminate all of them.
We can undo this if we change find_primitive. (We need to change the
compile-time tool findprim.c anyway because its strcmp_ci misuses
islower/toupper.)