Instead of generating GC maps which describe which stack locations that
are uninitialized, we emit ##clear instructions for those locations in
front of ##call-gc instructions. This makes the context root scanning
much simpler because the GC can assume that all stack slots are
initialized. It also removes the compiler.cfg.stacks.vacant pass and
seem to reduce the image size slightly because many fewer GC maps needs
to be emitted.
collector::trace_cards moved to slot_visitor::visit_cards and
collector::trace_code_heap_roots moved to
slot_visitor::visit_code_heap_roots. Both those methods are pointer visitors
callstack objects doesn't have stacks so it doesn't make sense to scrub
and check. also added the methods check_stack and scrub_stack to deal
with code duplication
primitive_minor_gc() iterates the stack twice, first to scrub stack
locations, then to trace overinitialized ones and gc roots. By running
visit_callstack() before visit_stack_elements() you only need to do it
once.
Declaring bignum_roots to contain bignum** instead of cell avoids some
superfluous casts. Casting it to cell is wrong because the items in it
are never tagged. And due to a earlier commit, bignum_roots will never
contain NULL:s so checking for them is not needed.
instead of storing data_root_ranges in data_roots, you can just store
cell pointers directly. the advantage with doing it that way is that
registration and traversal code becomes simpler (and slightly faster).
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
Don't update the map until the very last thing, and pass untranslated addresses to the iterator functors. Somewhat complicated by the fact that, for startup_fixup, the map is initialized with fixed-up values, so the fixup functor needs a flag indicating whether it operates with a fixed or unfixed code heap map.
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
This makes the separate "code" and "entry_point" fields in word and quotation redundant, so also remove them to reclaim an additional cell per word and quotation object, which should help with #318.