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 */
11 // -------------------------------
14 extern "C" cell ds_size, rs_size;
15 extern "C" context *unused_contexts;
19 extern "C" bool profiling_p;
22 /* Global variables used to pass fault handler state from signal handler to
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;
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;
37 extern "C" cell allot_markers_offset;
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
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;
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;
74 extern "C" bool fep_disabled;
75 extern "C" bool full_output;
76 extern "C" cell look_for;
80 extern "C" cell bignum_zero;
81 extern "C" cell bignum_pos_one;
82 extern "C" cell bignum_neg_one;
86 extern "C" unordered_map<heap_block *,char *> forwarding;
89 extern "C" cell code_relocation_base;
90 extern "C" cell data_relocation_base;
93 extern "C" cell megamorphic_cache_hits;
94 extern "C" cell megamorphic_cache_misses;
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 */
103 struct factorvmdata {
104 cell userenv[USER_ENV]; /* TAGGED user environment data; see getenv/setenv prims */
107 cell T; /* Canonical T object. It's just a word */
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;