3 // gc_info should be kept in sync with:
4 // basis/compiler/codegen/gc-maps/gc-maps.factor
7 uint32_t gc_root_count;
8 uint32_t derived_root_count;
9 uint32_t return_address_count;
11 cell callsite_bitmap_size() {
15 cell total_bitmap_size() {
16 return return_address_count * callsite_bitmap_size();
19 cell total_bitmap_bytes() { return ((total_bitmap_size() + 7) / 8); }
21 uint32_t* return_addresses() {
22 return (uint32_t*)this - return_address_count;
25 uint32_t* base_pointer_map() {
26 return return_addresses() - return_address_count * derived_root_count;
29 uint8_t* gc_info_bitmap() {
30 return (uint8_t*)base_pointer_map() - total_bitmap_bytes();
34 cell callsite_gc_roots(cell index) {
35 return index * gc_root_count;
38 uint32_t lookup_base_pointer(cell index, cell derived_root) {
39 return base_pointer_map()[index * derived_root_count + derived_root];
42 cell return_address_index(cell return_address) {
43 uint32_t* return_address_array = return_addresses();
45 for (cell i = 0; i < return_address_count; i++) {
46 if (return_address == return_address_array[i])