Commit Graph

14 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
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
d755dbc00f cs: fix phantom bytes effect on maximum-memory-bytes
original commit: 78f2c1e3ee1329f44742a23c28a76538eef8cbdd
2020-04-22 16:30:47 -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
5458323280 fix segment initialization for new fields
original commit: 90f358a2a33f90d9b64b6750988f679a6fcfcc7d
2020-04-04 12:43:04 -06:00
Matthew Flatt
f828cb1eaa fix emphemeron-key tracking in a segment with locked objects
original commit: 9d1252b176e972f92030599dae0ce159c9d36c5b
2020-04-01 07:53:32 -06:00
Matthew Flatt
c195288251 scalable object locking
The `unlock-object` operation was O(N) with N currently locked objects
--- so, O(N^2) to lock N objects and then unlock them --- because
locked objects were stored in and searched in a global list. Also, GC
was O(N) at any generation with N locked objects across generations,
since every locked object was scanned.

Fix these poblems so that locking and unlocking is practically O(1)
and GC is not poportional to locked objects. More precisely, locking
and unlocking is now O(C) for locking an individual object C times to
be balanced by C unlocks. (Since multiple locks on a single object
is rare, this performance seems good enough.)

The implementation replaces the global list with segment-specific
lists. Backpointers are managed using the general generational
support, so that unmodified, old-generation locked objects do not
need to be swept duing a new-generation collection.

original commit: a57d256ca73a3d507792c471facb7e35afbe88b3
2019-09-01 07:03:16 -06:00
Matthew Flatt
21fc705234 adjust GC to preserve eq? on flonums
original commit: d405416eb2ec6d5dd147afc7a2af5a6c2f0a8130
2019-01-22 05:24:05 -07:00
Matthew Flatt
6e999d02c3 add ordered guardians
Also, avoid quadratic time in GC for guardian chains.

original commit: 273f79a7be5c04370c399e6b1d8af799efc8b33f
2019-01-22 05:19:38 -07:00
R. Kent Dybvig
b7cca1a835 Minor tweak
original commit: d2b5ba5d5c45660e63b32fb501b6684d3d11036b
2018-12-05 15:30:40 -08:00
Christian Häggström
d9d0e94d95 Initialize more fields of seginfo
original commit: 48e93161f6ac2796d17a0f147f0dca1e1e195684
2018-12-05 23:36:57 +01:00
Bob Burger
831ea8ad18 changed copyright year to 2017
7.ss, scheme.1.in, comments of many files

original commit: 06f858f9a505b9d6fb6ca1ac97234927cb2dc641
2017-04-06 11:41:33 -04:00
Bob Burger
0d0e876fb7 fixed a couple typos in comments
original commit: 9e2347eeb2bd57b35f96f0f1938ef84d624ed6a4
2016-06-23 16:43:39 -04:00
dyb
1356af91b3 initial upload of open-source release
original commit: 47a210c15c63ba9677852269447bd2f2598b51fe
2016-04-26 10:04:54 -04:00