Commit Graph

30 Commits

Author SHA1 Message Date
Matthew Flatt
f78dc5724e add pb (portable bytecode) backend
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
2020-07-24 13:13:46 -06:00
Matthew Flatt
fd3b903c1c sync with https://github.com/cisco/ChezScheme on fasl compression
Merge changes in the way that fasl streams are compressed. The new
approach makes compression explicit in the fasl representation, which
means that tricks like uzing zcat on a fasl file will no longer work
(at least not efficiently).

original commit: 167ac7294a2dc400821e4336f0cfc4de621efe97
2020-07-12 19:07:05 -06:00
Matthew Flatt
b2f74f014e add AArch64 (aka Arm64) support as tarm64le
original commit: 9964f27f64cc743fd1dbff7418fce940a4291b01
2020-07-09 06:32:41 -06:00
Matthew Flatt
bdd1eaa874 add tarm32le
Besides adding supportt for `__collect-safe` and other repairs,
introduce a write-write fence with the write barrier, which is
intended to avoid one thread using an object created in another thread
before the object's initializing writes are visible.

original commit: 543bd16739c08e5a8f88c470b52db0f23a27d260
2020-06-29 05:55:47 -06:00
Matthew Flatt
257a29216e update for ppc32
Besides updating for unboxed floating point, the ppc32 build uses a
return register, and the continuation-attachments implementation was
not right for that mode.

original commit: dd2d01fb26ace819c73f258b9b53739f9dda1d34
2020-06-20 07:36:02 -06:00
Matthew Flatt
4b322677fa flush instruction cache on vfasl load
original commit: 57a7c47dcf1f602d208d14f51f456edb3e2689ae
2020-06-12 14:41:00 -06:00
Matthew Flatt
23e3597778 fix vfasl for library/C entry 0
original commit: ab36ca79585b69db135b9edeadbc26e9a071f813
2020-06-11 17:24:17 -06:00
Matthew Flatt
bbbd5a76ac fix vfasl relocation for arm32
original commit: e15c51c2c29aea545fbb4790f36b15002b7a25a5
2020-06-06 14:29:32 -06:00
Matthew Flatt
120082f3f9 add list-assuming-immutable?
Build in a Racket-style `list?` using GC cooperation to make recording
the result cheaper.

original commit: 32189af3e4dfc3596fba3163fd1a8295b830448b
2020-04-25 15:33:56 -06:00
Matthew Flatt
f53f20b5b9 GC marking (non-copying) mode
Change the GC so that it can mark and sweep objects in-place, instead
of always copying. This change is helpful for reducing peak memory
use while performing a collection on a large, old heap.

Some non-copying support was already in place for locked objects,
but the new implementation is faster and more general. As an
alternative to locking, the storage manager now provides "immobile"
allocation (currently only for bytevectors, vectors, and boxes),
which allocates an object that won't move but that can be GCed if
it's not referenced. A locked object is an object that has been
immobiled and that is on a global list --- mostly the old,
non-scalable implementation of locked objects brought back, since
immobile objects cover the cases that need to scale.

original commit: aecb7b736cb1d52764c292fa6364a674958dfde3
2020-04-22 07:10:02 -06:00
Matthew Flatt
afebbdd6a9 convert GC to "mkgc.ss" implementation
Replace repetitive C code in "gc.c" and "vfasl.c" with an
implementation using a little "Parenthe-C" language, which is a
somewhat declarative description of object tracing. From that
descrition, we generate different kinds of tracing functions, such as
the copy function or the sweep function.

The little language is still bascially C, just with parentheses and
parameterization that is much better than trying to use the C
preprocessor. (The "mkgc.ss" file includes the compiler from
Parenthe-C to C.)

Besides replacing existing code, we also generate a new traversal to
implement `compute-object-sizes`. Finally, the GC can now perform a
fused `collect` and `compute-object-sizes` in a single traversal.

Also improve the way that locked objects are detected during GC. This
can make a significant difference (on the order of 10-20% for a full
collection) when locked objects are long-lived.

original commit: de1f5c41d729ac75822a1f1e633ec6d042c883dc
2020-04-04 10:21:16 -06:00
Matthew Flatt
de465e4f92 fix vfasl problems
Fix problems with record meta-types and symbol interning interleaved
with vfasl loading.

original commit: 2d98d94b3c4d634ba882f10eaebc627a5d9a1ccd
2020-03-28 08:34:48 -06:00
Matthew Flatt
995e53ca71 Merge github.com:cisco/ChezScheme
original commit: 8cf52012e2a7b5928cb2602bb17e0128ae0f2776
2020-02-22 15:18:47 -07:00
Matthew Flatt
745482e3e4 vfasl: repairs for fcallables
A 0 relocation is used by fcallable code as a recognizable cookie, and
its relocations must be preserved.

original commit: 38fb3fdf75cf6540d6bd2568f015af6272d22995
2020-02-20 13:24:47 -07:00
Matthew Flatt
81ea967aea add stencil vectors and fxpopcount
original commit: ec766fca869b5e0407c4f54230b72619af73b40b
2020-01-06 05:34:28 -07:00
Matthew Flatt
0ac2f40d18 vfasl: save relocations if flag is set
original commit: 23ba508373fbcbe1fcba367bce86f60a54bbf4f1
2019-01-02 15:33:04 -07:00
Matthew Flatt
2b090ef32c vfasl repair: terminate segments as needed
When starting a new segment to keep an object on a single segment,
terminate the old one with e forwarding marker.

original commit: 1f1db6d3d2cd930455a3592f2d76a465b30a5592
2019-01-01 15:40:09 -07:00
Matthew Flatt
8b5d7ba02e vfasl repair
original commit: ee6a5df5d180ea1c9487ceb1d565d61120e69168
2018-12-31 08:01:47 -07:00
Matthew Flatt
69b92a0ca4 sync vfasl repair
original commit: b234ef2f5cb8352b9755b2cc908d562a25d18c62
2018-12-29 06:16:55 -06:00
Matthew Flatt
7c548bb3a1 update vfasl merge
original commit: 99dac3f53f4a7d2b2c373489135e5d270c256726
2018-12-28 08:39:21 -06:00
Matthew Flatt
d8dc4c71cc Merge branch 'separate' of ../ChezScheme-vfasl
original commit: 84734ded0f503f6604e7461a8be5e1e795a92efa
2018-12-24 05:32:24 -07:00
Matthew Flatt
545a465cf4 Merge ../ChezScheme-vfasl
original commit: dbe15d6cae6f23c4e218974ac83f36a935292ad2
2018-12-24 05:28:16 -07:00
Matthew Flatt
c3ef889099 fix allocation: avoid malloc and free
original commit: 40da1e7c8820163b4532cc75b6ed3c4229e2c4db
2018-12-23 06:17:53 -07:00
Matthew Flatt
133e820723 simplify vfasl_header
original commit: dab5ea7f7ee761ab6799c242df07ef209657eb74
2018-12-23 05:55:02 -07:00
Matthew Flatt
14e910409c experiment with a different fasl format
Use `vfasl-convert-file` to convert to the vfasl format, something
like this:

 (vfasl-convert-file "orig/petite.boot" "new/petite.boot" '())
 (vfasl-convert-file "orig/scheme.boot" "new/scheme.boot" '("petite"))
 (vfasl-convert-file "orig/racket.boot" "new/racket.boot" '("petite" "scheme"))

original commit: a40886e2fba741ca8cfc5ebd16b902d6414da0ae
2018-12-21 21:06:08 -07:00
Matthew Flatt
f3bbf06ce3 direct to static
original commit: ca6b0890ebd1cdeeae31dc3f11daa7fa02af013e
2018-12-21 14:16:24 -07:00
Matthew Flatt
a993c9c11e combine multiple fasl to one vfasl when possible
original commit: d8d4400b42196088defac994b7f97a26446d8ed2
2018-12-21 08:58:28 -07:00
Matthew Flatt
f0376299a8 experiment with a different fasl format
original commit: e2c50bd7ae5b323fcc796eb78d892f4a2c487dfc
2018-12-20 20:27:41 -07:00
Matthew Flatt
5cace8bee3 repairs
original commit: a7c8036d40fc3c92b6b08ba8d1a62f76f2d5fab6
2018-12-20 20:24:35 -07:00
Matthew Flatt
c90bd7bb6d experiment with a different fasl format
original commit: 6e32ed2a43f6b3d8531e98dfa52a56594dd6a2f4
2018-12-20 17:47:01 -07:00