]> gitweb.factorcode.org Git - factor.git/blob - vm/code_heap.hpp
vm: Clean up more code duplication and rename a few methods
[factor.git] / vm / code_heap.hpp
1 namespace factor
2 {
3
4 struct code_heap {
5         /* The actual memory area */
6         segment *seg;
7
8         /* Memory allocator */
9         free_list_allocator<code_block> *allocator;
10
11         /* Set of blocks which need to be initialized by initialize_code_block(). */
12         std::set<code_block *> needs_fixup;
13
14         /* Code blocks which may reference objects in the nursery */
15         std::set<code_block *> points_to_nursery;
16
17         /* Code blocks which may reference objects in aging space or the nursery */
18         std::set<code_block *> points_to_aging;
19
20         explicit code_heap(cell size);
21         ~code_heap();
22         void write_barrier(code_block *compiled);
23         void clear_remembered_set();
24         bool needs_fixup_p(code_block *compiled);
25         bool marked_p(code_block *compiled);
26         void set_marked_p(code_block *compiled);
27         void clear_mark_bits();
28         void code_heap_free(code_block *compiled);
29         void flush_icache();
30 };
31
32 struct code_heap_room {
33         cell size;
34         cell occupied_space;
35         cell total_free;
36         cell contiguous_free;
37         cell free_block_count;
38 };
39
40 }