9 // First five fields accessed directly by assembler. See vm.factor
14 /* New objects are allocated here */
15 nursery_space nursery;
17 /* Add this to a shifted address to compute write barrier offsets */
21 /* TAGGED user environment data; see getenv/setenv prims */
22 cell special_objects[special_object_count];
24 /* Data stack and retain stack sizes */
25 cell ds_size, rs_size;
27 /* Pooling unused contexts to make callbacks cheaper */
28 context *unused_contexts;
30 /* Canonical truth value. In Factor, 't' */
33 /* External entry points */
34 c_to_factor_func_type c_to_factor_func;
36 /* Is call counting enabled? */
39 /* Global variables used to pass fault handler state from signal handler to
42 cell signal_fault_addr;
43 unsigned int signal_fpu_status;
44 stack_frame *signal_callstack_top;
46 /* GC is off during heap walking */
55 /* Pinned callback stubs */
56 callback_heap *callbacks;
58 /* Only set if we're performing a GC */
62 std::vector<cell> mark_stack;
64 /* If not NULL, we push GC events here */
65 std::vector<gc_event> *gc_events;
67 /* If a runtime function needs to call another function which potentially
68 allocates memory, it must wrap any references to the data and code
69 heaps with data_root and code_root smart pointers, which register
70 themselves here. See data_roots.hpp and code_roots.hpp */
71 std::vector<data_root_range> data_roots;
72 std::vector<cell> bignum_roots;
73 std::vector<code_root *> code_roots;
79 /* Canonical bignums */
84 /* Method dispatch statistics */
85 dispatch_statistics dispatch_stats;
87 /* Number of entries in a polymorphic inline cache */
90 /* Incrementing object counter for identity hashing */
93 /* Sanity check to ensure that monotonic counter doesn't
98 context *alloc_context();
99 void dealloc_context(context *old_context);
101 void unnest_stacks();
102 void init_stacks(cell ds_size_, cell rs_size_);
103 bool stack_to_array(cell bottom, cell top);
104 cell array_to_stack(array *array, cell bottom);
105 void primitive_datastack();
106 void primitive_retainstack();
107 void primitive_set_datastack();
108 void primitive_set_retainstack();
109 void primitive_check_datastack();
110 void primitive_load_locals();
112 template<typename Iterator> void iterate_active_frames(Iterator &iter)
114 context *ctx = this->ctx;
118 iterate_callstack(ctx,iter);
124 void primitive_exit();
125 void primitive_system_micros();
126 void primitive_nano_count();
127 void primitive_sleep();
128 void primitive_set_slot();
131 void primitive_special_object();
132 void primitive_set_special_object();
133 void primitive_identity_hashcode();
134 void compute_identity_hashcode(object *obj);
135 void primitive_compute_identity_hashcode();
136 cell object_size(cell tagged);
137 cell clone_object(cell obj_);
138 void primitive_clone();
139 void primitive_become();
142 void init_profiler();
143 code_block *compile_profiling_stub(cell word_);
144 void set_profiling(bool profiling);
145 void primitive_profiling();
148 void throw_error(cell error, stack_frame *callstack_top);
149 void not_implemented_error();
150 bool in_page(cell fault, cell area, cell area_size, int offset);
151 void memory_protection_error(cell addr, stack_frame *native_stack);
152 void signal_error(int signal, stack_frame *native_stack);
153 void divide_by_zero_error();
154 void fp_trap_error(unsigned int fpu_status, stack_frame *signal_callstack_top);
155 void primitive_call_clear();
156 void primitive_unimplemented();
157 void memory_signal_handler_impl();
158 void misc_signal_handler_impl();
159 void fp_signal_handler_impl();
160 void type_error(cell type, cell tagged);
161 void general_error(vm_error_type error, cell arg1, cell arg2, stack_frame *native_stack);
164 int bignum_equal_p(bignum * x, bignum * y);
165 enum bignum_comparison bignum_compare(bignum * x, bignum * y);
166 bignum *bignum_add(bignum * x, bignum * y);
167 bignum *bignum_subtract(bignum * x, bignum * y);
168 bignum *bignum_multiply(bignum * x, bignum * y);
169 void bignum_divide(bignum * numerator, bignum * denominator, bignum * * quotient, bignum * * remainder);
170 bignum *bignum_quotient(bignum * numerator, bignum * denominator);
171 bignum *bignum_remainder(bignum * numerator, bignum * denominator);
172 cell bignum_to_cell(bignum * bignum);
173 fixnum bignum_to_fixnum(bignum * bignum);
174 s64 bignum_to_long_long(bignum * bignum);
175 u64 bignum_to_ulong_long(bignum * bignum);
176 double bignum_to_double(bignum * bignum);
177 bignum *double_to_bignum(double x);
178 int bignum_equal_p_unsigned(bignum * x, bignum * y);
179 enum bignum_comparison bignum_compare_unsigned(bignum * x, bignum * y);
180 bignum *bignum_add_unsigned(bignum * x, bignum * y, int negative_p);
181 bignum *bignum_subtract_unsigned(bignum * x, bignum * y);
182 bignum *bignum_multiply_unsigned(bignum * x, bignum * y, int negative_p);
183 bignum *bignum_multiply_unsigned_small_factor(bignum * x, bignum_digit_type y,int negative_p);
184 void bignum_destructive_add(bignum * bignum, bignum_digit_type n);
185 void bignum_destructive_scale_up(bignum * bignum, bignum_digit_type factor);
186 void bignum_divide_unsigned_large_denominator(bignum * numerator, bignum * denominator,
187 bignum * * quotient, bignum * * remainder, int q_negative_p, int r_negative_p);
188 void bignum_divide_unsigned_normalized(bignum * u, bignum * v, bignum * q);
189 bignum_digit_type bignum_divide_subtract(bignum_digit_type * v_start, bignum_digit_type * v_end,
190 bignum_digit_type guess, bignum_digit_type * u_start);
191 void bignum_divide_unsigned_medium_denominator(bignum * numerator,bignum_digit_type denominator,
192 bignum * * quotient, bignum * * remainder,int q_negative_p, int r_negative_p);
193 void bignum_destructive_normalization(bignum * source, bignum * target, int shift_left);
194 void bignum_destructive_unnormalization(bignum * bignum, int shift_right);
195 bignum_digit_type bignum_digit_divide(bignum_digit_type uh, bignum_digit_type ul,
196 bignum_digit_type v, bignum_digit_type * q) /* return value */;
197 bignum_digit_type bignum_digit_divide_subtract(bignum_digit_type v1, bignum_digit_type v2,
198 bignum_digit_type guess, bignum_digit_type * u);
199 void bignum_divide_unsigned_small_denominator(bignum * numerator, bignum_digit_type denominator,
200 bignum * * quotient, bignum * * remainder,int q_negative_p, int r_negative_p);
201 bignum_digit_type bignum_destructive_scale_down(bignum * bignum, bignum_digit_type denominator);
202 bignum * bignum_remainder_unsigned_small_denominator(bignum * n, bignum_digit_type d, int negative_p);
203 bignum *bignum_digit_to_bignum(bignum_digit_type digit, int negative_p);
204 bignum *allot_bignum(bignum_length_type length, int negative_p);
205 bignum * allot_bignum_zeroed(bignum_length_type length, int negative_p);
206 bignum *bignum_shorten_length(bignum * bignum, bignum_length_type length);
207 bignum *bignum_trim(bignum * bignum);
208 bignum *bignum_new_sign(bignum * x, int negative_p);
209 bignum *bignum_maybe_new_sign(bignum * x, int negative_p);
210 void bignum_destructive_copy(bignum * source, bignum * target);
211 bignum *bignum_bitwise_not(bignum * x);
212 bignum *bignum_arithmetic_shift(bignum * arg1, fixnum n);
213 bignum *bignum_bitwise_and(bignum * arg1, bignum * arg2);
214 bignum *bignum_bitwise_ior(bignum * arg1, bignum * arg2);
215 bignum *bignum_bitwise_xor(bignum * arg1, bignum * arg2);
216 bignum *bignum_magnitude_ash(bignum * arg1, fixnum n);
217 bignum *bignum_pospos_bitwise_op(int op, bignum * arg1, bignum * arg2);
218 bignum *bignum_posneg_bitwise_op(int op, bignum * arg1, bignum * arg2);
219 bignum *bignum_negneg_bitwise_op(int op, bignum * arg1, bignum * arg2);
220 void bignum_negate_magnitude(bignum * arg);
221 bignum *bignum_integer_length(bignum * x);
222 int bignum_logbitp(int shift, bignum * arg);
223 int bignum_unsigned_logbitp(int shift, bignum * bignum);
224 bignum *digit_stream_to_bignum(unsigned int n_digits, unsigned int (*producer)(unsigned int, factor_vm *), unsigned int radix, int negative_p);
227 void init_card_decks();
228 void set_data_heap(data_heap *data_);
229 void init_data_heap(cell young_size, cell aging_size, cell tenured_size);
230 void primitive_size();
231 data_heap_room data_room();
232 void primitive_data_room();
235 cell instances(cell type);
236 void primitive_all_instances();
238 template<typename Generation, typename Iterator>
239 inline void each_object(Generation *gen, Iterator &iterator)
241 cell obj = gen->first_object();
244 iterator((object *)obj);
245 obj = gen->next_object_after(obj);
249 template<typename Iterator> inline void each_object(Iterator &iterator)
253 each_object(data->tenured,iterator);
254 each_object(data->aging,iterator);
255 each_object(data->nursery,iterator);
260 /* the write barrier must be called any time we are potentially storing a
261 pointer from an older generation to a younger one */
262 inline void write_barrier(cell *slot_ptr)
264 *(char *)(cards_offset + ((cell)slot_ptr >> card_bits)) = card_mark_mask;
265 *(char *)(decks_offset + ((cell)slot_ptr >> deck_bits)) = card_mark_mask;
268 inline void write_barrier(object *obj, cell size)
270 cell start = (cell)obj & (~card_size + 1);
271 cell end = ((cell)obj + size + card_size - 1) & (~card_size + 1);
273 for(cell offset = start; offset < end; offset += card_size)
274 write_barrier((cell *)offset);
278 void check_data_heap();
282 void start_gc_again();
283 void update_code_heap_for_minor_gc(std::set<code_block *> *remembered_set);
284 void collect_nursery();
285 void collect_aging();
286 void collect_to_tenured();
287 void update_code_roots_for_sweep();
288 void update_code_roots_for_compaction();
289 void collect_mark_impl(bool trace_contexts_p);
290 void collect_sweep_impl();
291 void collect_full(bool trace_contexts_p);
292 void collect_compact_impl(bool trace_contexts_p);
293 void collect_compact_code_impl(bool trace_contexts_p);
294 void collect_compact(bool trace_contexts_p);
295 void collect_growing_heap(cell requested_bytes, bool trace_contexts_p);
296 void gc(gc_op op, cell requested_bytes, bool trace_contexts_p);
297 void primitive_minor_gc();
298 void primitive_full_gc();
299 void primitive_compact_gc();
300 void inline_gc(cell *data_roots_base, cell data_roots_size);
301 void primitive_enable_gc_events();
302 void primitive_disable_gc_events();
303 object *allot_object(cell type, cell size);
304 object *allot_large_object(cell type, cell size);
306 template<typename Type> Type *allot(cell size)
308 return (Type *)allot_object(Type::type_number,size);
311 inline void check_data_pointer(object *pointer)
314 if(!(current_gc && current_gc->op == collect_growing_heap_op))
316 assert((cell)pointer >= data->seg->start
317 && (cell)pointer < data->seg->end);
323 template<typename Array> Array *allot_uninitialized_array(cell capacity);
324 template<typename Array> bool reallot_array_in_place_p(Array *array, cell capacity);
325 template<typename Array> Array *reallot_array(Array *array_, cell capacity);
328 void print_chars(string* str);
329 void print_word(word* word, cell nesting);
330 void print_factor_string(string* str);
331 void print_array(array* array, cell nesting);
332 void print_tuple(tuple *tuple, cell nesting);
333 void print_nested_obj(cell obj, fixnum nesting);
334 void print_obj(cell obj);
335 void print_objects(cell *start, cell *end);
336 void print_datastack();
337 void print_retainstack();
338 void print_callstack();
339 void dump_cell(cell x);
340 void dump_memory(cell from, cell to);
341 template<typename Generation> void dump_generation(const char *name, Generation *gen);
342 void dump_generations();
343 void dump_objects(cell type);
344 void find_data_references_step(cell *scan);
345 void find_data_references(cell look_for_);
346 void dump_code_heap();
348 void primitive_die();
351 array *allot_array(cell capacity, cell fill_);
352 void primitive_array();
353 cell allot_array_1(cell obj_);
354 cell allot_array_2(cell v1_, cell v2_);
355 cell allot_array_4(cell v1_, cell v2_, cell v3_, cell v4_);
356 void primitive_resize_array();
357 inline void set_array_nth(array *array, cell slot, cell value);
360 cell string_nth(const string *str, cell index);
361 void set_string_nth_fast(string *str, cell index, cell ch);
362 void set_string_nth_slow(string *str_, cell index, cell ch);
363 void set_string_nth(string *str, cell index, cell ch);
364 string *allot_string_internal(cell capacity);
365 void fill_string(string *str_, cell start, cell capacity, cell fill);
366 string *allot_string(cell capacity, cell fill);
367 void primitive_string();
368 bool reallot_string_in_place_p(string *str, cell capacity);
369 string* reallot_string(string *str_, cell capacity);
370 void primitive_resize_string();
371 void primitive_string_nth();
372 void primitive_set_string_nth_fast();
373 void primitive_set_string_nth_slow();
376 cell tag_boolean(cell untagged)
378 return (untagged ? true_object : false_object);
382 byte_array *allot_byte_array(cell size);
383 void primitive_byte_array();
384 void primitive_uninitialized_byte_array();
385 void primitive_resize_byte_array();
387 template<typename Type> byte_array *byte_array_from_value(Type *value);
390 void primitive_tuple();
391 void primitive_tuple_boa();
394 word *allot_word(cell name_, cell vocab_, cell hashcode_);
395 void primitive_word();
396 void primitive_word_code();
397 void update_word_entry_point(word *w_);
398 void primitive_optimized_p();
399 void primitive_wrapper();
400 void jit_compile_word(cell word_, cell def_, bool relocating);
401 cell find_all_words();
402 void compile_all_words();
405 void primitive_bignum_to_fixnum();
406 void primitive_float_to_fixnum();
407 void primitive_fixnum_divint();
408 void primitive_fixnum_divmod();
409 bignum *fixnum_to_bignum(fixnum);
410 bignum *cell_to_bignum(cell);
411 bignum *long_long_to_bignum(s64 n);
412 bignum *ulong_long_to_bignum(u64 n);
413 inline fixnum sign_mask(fixnum x);
414 inline fixnum branchless_max(fixnum x, fixnum y);
415 inline fixnum branchless_abs(fixnum x);
416 void primitive_fixnum_shift();
417 void primitive_fixnum_to_bignum();
418 void primitive_float_to_bignum();
419 void primitive_bignum_eq();
420 void primitive_bignum_add();
421 void primitive_bignum_subtract();
422 void primitive_bignum_multiply();
423 void primitive_bignum_divint();
424 void primitive_bignum_divmod();
425 void primitive_bignum_mod();
426 void primitive_bignum_and();
427 void primitive_bignum_or();
428 void primitive_bignum_xor();
429 void primitive_bignum_shift();
430 void primitive_bignum_less();
431 void primitive_bignum_lesseq();
432 void primitive_bignum_greater();
433 void primitive_bignum_greatereq();
434 void primitive_bignum_not();
435 void primitive_bignum_bitp();
436 void primitive_bignum_log2();
437 unsigned int bignum_producer(unsigned int digit);
438 void primitive_byte_array_to_bignum();
439 inline cell unbox_array_size();
440 cell unbox_array_size_slow();
441 void primitive_fixnum_to_float();
442 void primitive_bignum_to_float();
443 void primitive_str_to_float();
444 void primitive_float_to_str();
445 void primitive_float_eq();
446 void primitive_float_add();
447 void primitive_float_subtract();
448 void primitive_float_multiply();
449 void primitive_float_divfloat();
450 void primitive_float_mod();
451 void primitive_float_less();
452 void primitive_float_lesseq();
453 void primitive_float_greater();
454 void primitive_float_greatereq();
455 void primitive_float_bits();
456 void primitive_bits_float();
457 void primitive_double_bits();
458 void primitive_bits_double();
459 fixnum to_fixnum(cell tagged);
460 cell to_cell(cell tagged);
461 cell from_signed_1(s8 n);
462 cell from_unsigned_1(u8 n);
463 cell from_signed_2(s16 n);
464 cell from_unsigned_2(u16 n);
465 cell from_signed_4(s32 n);
466 cell from_unsigned_4(u32 n);
467 cell from_signed_cell(fixnum integer);
468 cell from_unsigned_cell(cell integer);
469 cell from_signed_8(s64 n);
470 s64 to_signed_8(cell obj);
471 cell from_unsigned_8(u64 n);
472 u64 to_unsigned_8(cell obj);
473 float to_float(cell value);
474 double to_double(cell value);
475 inline void overflow_fixnum_add(fixnum x, fixnum y);
476 inline void overflow_fixnum_subtract(fixnum x, fixnum y);
477 inline void overflow_fixnum_multiply(fixnum x, fixnum y);
478 inline cell allot_integer(fixnum x);
479 inline cell allot_cell(cell x);
480 inline cell allot_float(double n);
481 inline bignum *float_to_bignum(cell tagged);
482 inline double bignum_to_float(cell tagged);
483 inline double untag_float(cell tagged);
484 inline double untag_float_check(cell tagged);
485 inline fixnum float_to_fixnum(cell tagged);
486 inline double fixnum_to_float(cell tagged);
489 template<typename Type> Type *untag_check(cell value);
494 void primitive_fopen();
495 FILE *pop_file_handle();
496 void primitive_fgetc();
497 void primitive_fread();
498 void primitive_fputc();
499 void primitive_fwrite();
500 void primitive_ftell();
501 void primitive_fseek();
502 void primitive_fflush();
503 void primitive_fclose();
506 cell compute_entry_point_address(cell obj);
507 cell compute_entry_point_pic_address(word *w, cell tagged_quot);
508 cell compute_entry_point_pic_address(cell w_);
509 cell compute_entry_point_pic_tail_address(cell w_);
510 cell code_block_owner(code_block *compiled);
511 void update_word_references(code_block *compiled);
512 void check_code_address(cell address);
513 void undefined_symbol();
514 cell compute_dlsym_address(array *literals, cell index);
515 cell compute_vm_address(cell arg);
516 void store_external_address(instruction_operand op);
517 cell compute_here_address(cell arg, cell offset, code_block *compiled);
518 void initialize_code_block(code_block *compiled);
519 void fixup_labels(array *labels, code_block *compiled);
520 code_block *allot_code_block(cell size, code_block_type type);
521 code_block *add_code_block(code_block_type type, cell code_, cell labels_, cell owner_, cell relocation_, cell parameters_, cell literals_);
524 inline void check_code_pointer(cell ptr)
527 assert(in_code_heap_p(ptr));
531 void init_code_heap(cell size);
532 bool in_code_heap_p(cell ptr);
533 void update_code_heap_words();
534 void primitive_modify_code_heap();
535 code_heap_room code_room();
536 void primitive_code_room();
537 void primitive_strip_stack_traces();
539 template<typename Iterator> void each_code_block(Iterator &iter)
541 code->allocator->iterate(iter);
545 void init_callbacks(cell size);
546 void primitive_callback();
549 void init_objects(image_header *h);
550 void load_data_heap(FILE *file, image_header *h, vm_parameters *p);
551 void load_code_heap(FILE *file, image_header *h, vm_parameters *p);
552 bool save_image(const vm_char *saving_filename, const vm_char *filename);
553 void primitive_save_image();
554 void primitive_save_image_and_exit();
555 void fixup_data(cell data_offset, cell code_offset);
556 void fixup_code(cell data_offset, cell code_offset);
557 void load_image(vm_parameters *p);
560 template<typename Iterator> void iterate_callstack_object(callstack *stack_, Iterator &iterator);
561 void check_frame(stack_frame *frame);
562 callstack *allot_callstack(cell size);
563 stack_frame *fix_callstack_top(stack_frame *top, stack_frame *bottom);
564 stack_frame *second_from_top_stack_frame();
565 void primitive_callstack();
566 code_block *frame_code(stack_frame *frame);
567 code_block_type frame_type(stack_frame *frame);
568 cell frame_executing(stack_frame *frame);
569 cell frame_executing_quot(stack_frame *frame);
570 stack_frame *frame_successor(stack_frame *frame);
571 cell frame_scan(stack_frame *frame);
572 void primitive_callstack_to_array();
573 stack_frame *innermost_stack_frame(callstack *stack);
574 void primitive_innermost_stack_frame_executing();
575 void primitive_innermost_stack_frame_scan();
576 void primitive_set_innermost_stack_frame_quot();
577 template<typename Iterator> void iterate_callstack(context *ctx, Iterator &iterator);
580 char *pinned_alien_offset(cell obj);
581 cell allot_alien(cell delegate_, cell displacement);
582 cell allot_alien(void *address);
583 void primitive_displaced_alien();
584 void primitive_alien_address();
585 void *alien_pointer();
586 void primitive_dlopen();
587 void primitive_dlsym();
588 void primitive_dlclose();
589 void primitive_dll_validp();
590 char *alien_offset(cell obj);
591 void to_value_struct(cell src, void *dest, cell size);
592 cell from_value_struct(void *src, cell size);
593 cell from_small_struct(cell x, cell y, cell size);
594 cell from_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size);
597 void primitive_jit_compile();
598 code_block *lazy_jit_compile_block();
599 void primitive_array_to_quotation();
600 void primitive_quotation_code();
601 void set_quot_entry_point(quotation *quot, code_block *code);
602 code_block *jit_compile_quot(cell owner_, cell quot_, bool relocating);
603 void jit_compile_quot(cell quot_, bool relocating);
604 fixnum quot_code_offset_to_scan(cell quot_, cell offset);
605 cell lazy_jit_compile(cell quot);
606 bool quot_compiled_p(quotation *quot);
607 void primitive_quot_compiled_p();
608 cell find_all_quotations();
609 void initialize_all_quotations();
612 cell search_lookup_alist(cell table, cell klass);
613 cell search_lookup_hash(cell table, cell klass, cell hashcode);
614 cell nth_superclass(tuple_layout *layout, fixnum echelon);
615 cell nth_hashcode(tuple_layout *layout, fixnum echelon);
616 cell lookup_tuple_method(cell obj, cell methods);
617 cell lookup_method(cell obj, cell methods);
618 void primitive_lookup_method();
619 cell object_class(cell obj);
620 cell method_cache_hashcode(cell klass, array *array);
621 void update_method_cache(cell cache, cell klass, cell method);
622 void primitive_mega_cache_miss();
623 void primitive_reset_dispatch_stats();
624 void primitive_dispatch_stats();
627 void init_inline_caching(int max_size);
628 void deallocate_inline_cache(cell return_address);
629 cell determine_inline_cache_type(array *cache_entries);
630 void update_pic_count(cell type);
631 code_block *compile_inline_cache(fixnum index,cell generic_word_,cell methods_,cell cache_entries_,bool tail_call_p);
632 void *megamorphic_call_stub(cell generic_word);
633 cell inline_cache_size(cell cache_entries);
634 cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_);
635 void update_pic_transitions(cell pic_size);
636 void *inline_cache_miss(cell return_address);
639 void c_to_factor(cell quot);
640 void unwind_native_frames(cell quot, stack_frame *to);
643 void default_parameters(vm_parameters *p);
644 bool factor_arg(const vm_char *str, const vm_char *arg, cell *value);
645 void init_parameters_from_args(vm_parameters *p, int argc, vm_char **argv);
646 void prepare_boot_image();
647 void init_factor(vm_parameters *p);
648 void pass_args_to_factor(int argc, vm_char **argv);
649 void start_factor(vm_parameters *p);
651 void start_embedded_factor(vm_parameters *p);
652 void start_standalone_factor(int argc, vm_char **argv);
653 char *factor_eval_string(char *string);
654 void factor_eval_free(char *result);
656 void factor_sleep(long us);
659 void primitive_existsp();
661 void ffi_dlopen(dll *dll);
662 void *ffi_dlsym(dll *dll, symbol_char *symbol);
663 void ffi_dlclose(dll *dll);
664 void c_to_factor_toplevel(cell quot);
668 const vm_char *vm_executable_path();
669 const vm_char *default_image_path();
670 void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length);
671 BOOL windows_stat(vm_char *path);
675 LONG exception_handler(PEXCEPTION_POINTERS pe);
678 void dispatch_signal(void *uap, void (handler)());
682 void call_fault_handler(exception_type_t exception, exception_data_type_t code, MACH_EXC_STATE_TYPE *exc_state, MACH_THREAD_STATE_TYPE *thread_state, MACH_FLOAT_STATE_TYPE *float_state);
689 extern std::map<THREADHANDLE, factor_vm *> thread_vms;