]> gitweb.factorcode.org Git - factor.git/blob - vm/vm-data-dummy.hpp
small x86 asm cleanup
[factor.git] / vm / vm-data-dummy.hpp
1 namespace factor
2 {
3
4         // if you change this struct, also change vm.factor k--------
5         extern "C" context *stack_chain; 
6         extern "C" zone nursery; /* new objects are allocated here */
7         extern "C" cell cards_offset;
8         extern "C" cell decks_offset;
9 //extern "C" cell userenv[USER_ENV]; /* TAGGED user environment data; see getenv/setenv prims */
10
11         // -------------------------------
12
13         // contexts
14         extern "C" cell ds_size, rs_size;
15         extern "C" context *unused_contexts;
16
17
18         // profiler
19         extern "C" bool profiling_p;
20
21         // errors
22         /* Global variables used to pass fault handler state from signal handler to
23            user-space */
24         extern "C" cell signal_number;
25         extern "C" cell signal_fault_addr;
26         extern "C" unsigned int signal_fpu_status;
27         extern "C" stack_frame *signal_callstack_top;
28
29         //data_heap
30         extern "C" bool secure_gc;  /* Set by the -securegc command line argument */
31         extern "C" bool gc_off; /* GC is off during heap walking */
32         extern "C" data_heap *data;
33         /* A heap walk allows useful things to be done, like finding all
34            references to an object for debugging purposes. */
35         extern "C" cell heap_scan_ptr;
36         //write barrier
37         extern "C" cell allot_markers_offset;
38         //data_gc
39         /* used during garbage collection only */
40         extern "C" zone *newspace;
41         extern "C" bool performing_gc;
42         extern "C" bool performing_compaction;
43         extern "C" cell collecting_gen;
44         /* if true, we are collecting aging space for the second time, so if it is still
45            full, we go on to collect tenured */
46         extern "C" bool collecting_aging_again;
47         /* in case a generation fills up in the middle of a gc, we jump back
48            up to try collecting the next generation. */
49         extern "C" jmp_buf gc_jmp;
50         extern "C" gc_stats stats[max_gen_count];
51         extern "C" u64 cards_scanned;
52         extern "C" u64 decks_scanned;
53         extern "C" u64 card_scan_time;
54         extern "C" cell code_heap_scans;
55         /* What generation was being collected when copy_code_heap_roots() was last
56            called? Until the next call to add_code_block(), future
57            collections of younger generations don't have to touch the code
58            heap. */
59         extern "C" cell last_code_heap_scan;
60         /* sometimes we grow the heap */
61         extern "C" bool growing_data_heap;
62         extern "C" data_heap *old_data_heap;
63
64         // local roots
65         /* If a runtime function needs to call another function which potentially
66            allocates memory, it must wrap any local variable references to Factor
67            objects in gc_root instances */
68         //extern "C" segment *gc_locals_region;
69         //extern "C" cell gc_locals;
70         //extern "C" segment *gc_bignums_region;
71         //extern "C" cell gc_bignums;
72
73         //debug
74         extern "C" bool fep_disabled;
75         extern "C" bool full_output;
76         extern "C" cell look_for;
77         extern "C" cell obj;
78
79         //math
80         extern "C" cell bignum_zero;
81         extern "C" cell bignum_pos_one;
82         extern "C" cell bignum_neg_one; 
83
84     //code_heap
85         extern "C" heap code;
86         extern "C" unordered_map<heap_block *,char *> forwarding;
87
88         //image
89         extern "C" cell code_relocation_base;
90         extern "C" cell data_relocation_base;
91
92         //dispatch
93         extern "C" cell megamorphic_cache_hits;
94         extern "C" cell megamorphic_cache_misses;
95
96         //inline cache
97         extern "C" cell max_pic_size;
98         extern "C" cell cold_call_to_ic_transitions;
99         extern "C" cell ic_to_pic_transitions;
100         extern "C" cell pic_to_mega_transitions;
101         extern "C" cell pic_counts[4];  /* PIC_TAG, PIC_HI_TAG, PIC_TUPLE, PIC_HI_TAG_TUPLE */
102
103 struct factorvmdata {
104         cell userenv[USER_ENV]; /* TAGGED user environment data; see getenv/setenv prims */
105
106         // run
107         cell T;  /* Canonical T object. It's just a word */
108
109         // local roots
110         /* If a runtime function needs to call another function which potentially
111            allocates memory, it must wrap any local variable references to Factor
112            objects in gc_root instances */
113         std::vector<cell> gc_locals;
114         std::vector<cell> gc_bignums;
115 };
116 }