]> gitweb.factorcode.org Git - factor.git/blob - vm/primitives.hpp
e9965c2f3b98a63f12acd87b6eb13a98b447d4e2
[factor.git] / vm / primitives.hpp
1 namespace factor
2 {
3
4 /* Generated with PRIMITIVE in primitives.cpp */
5
6 #define EACH_PRIMITIVE(_) \
7         _(alien_address) \
8         _(all_instances) \
9         _(array) \
10         _(array_to_quotation) \
11         _(become) \
12         _(bignum_add) \
13         _(bignum_and) \
14         _(bignum_bitp) \
15         _(bignum_divint) \
16         _(bignum_divmod) \
17         _(bignum_eq) \
18         _(bignum_greater) \
19         _(bignum_greatereq) \
20         _(bignum_less) \
21         _(bignum_lesseq) \
22         _(bignum_log2) \
23         _(bignum_mod) \
24         _(bignum_multiply) \
25         _(bignum_not) \
26         _(bignum_or) \
27         _(bignum_shift) \
28         _(bignum_subtract) \
29         _(bignum_to_fixnum) \
30         _(bignum_xor) \
31         _(bits_double) \
32         _(bits_float) \
33         _(byte_array) \
34         _(callback) \
35         _(callstack) \
36         _(callstack_bounds) \
37         _(callstack_for) \
38         _(callstack_to_array) \
39         _(check_datastack) \
40         _(clone) \
41         _(code_blocks) \
42         _(code_room) \
43         _(compact_gc) \
44         _(compute_identity_hashcode) \
45         _(context_object) \
46         _(context_object_for) \
47         _(current_callback) \
48         _(data_room) \
49         _(datastack) \
50         _(datastack_for) \
51         _(die) \
52         _(disable_gc_events) \
53         _(dispatch_stats) \
54         _(displaced_alien) \
55         _(dlclose) \
56         _(dll_validp) \
57         _(dlopen) \
58         _(dlsym) \
59         _(dlsym_raw) \
60         _(double_bits) \
61         _(enable_gc_events) \
62         _(existsp) \
63         _(exit) \
64         _(fclose) \
65         _(fflush) \
66         _(fgetc) \
67         _(fixnum_divint) \
68         _(fixnum_divmod) \
69         _(fixnum_shift) \
70         _(fixnum_to_bignum) \
71         _(fixnum_to_float) \
72         _(float_add) \
73         _(float_bits) \
74         _(float_divfloat) \
75         _(float_eq) \
76         _(float_greater) \
77         _(float_greatereq) \
78         _(float_less) \
79         _(float_lesseq) \
80         _(float_multiply) \
81         _(float_subtract) \
82         _(float_to_bignum) \
83         _(float_to_fixnum) \
84         _(fopen) \
85         _(format_float) \
86         _(fputc) \
87         _(fread) \
88         _(fseek) \
89         _(ftell) \
90         _(full_gc) \
91         _(fwrite) \
92         _(identity_hashcode) \
93         _(innermost_stack_frame_executing) \
94         _(innermost_stack_frame_scan) \
95         _(jit_compile) \
96         _(load_locals) \
97         _(lookup_method) \
98         _(mega_cache_miss) \
99         _(minor_gc) \
100         _(modify_code_heap) \
101         _(nano_count) \
102         _(optimized_p) \
103         _(profiling) \
104         _(quot_compiled_p) \
105         _(quotation_code) \
106         _(reset_dispatch_stats) \
107         _(resize_array) \
108         _(resize_byte_array) \
109         _(resize_string) \
110         _(retainstack) \
111         _(retainstack_for) \
112         _(save_image) \
113         _(save_image_and_exit) \
114         _(set_context_object) \
115         _(set_datastack) \
116         _(set_innermost_stack_frame_quot) \
117         _(set_retainstack) \
118         _(set_slot) \
119         _(set_special_object) \
120         _(set_string_nth_fast) \
121         _(size) \
122         _(sleep) \
123         _(special_object) \
124         _(string) \
125         _(strip_stack_traces) \
126         _(tuple) \
127         _(tuple_boa) \
128         _(unimplemented) \
129         _(uninitialized_byte_array) \
130         _(word) \
131         _(word_code) \
132         _(wrapper)
133
134 #define EACH_ALIEN_PRIMITIVE(_) \
135         _(signed_cell,fixnum,from_signed_cell,to_fixnum) \
136         _(unsigned_cell,cell,from_unsigned_cell,to_cell) \
137         _(signed_8,s64,from_signed_8,to_signed_8) \
138         _(unsigned_8,u64,from_unsigned_8,to_unsigned_8) \
139         _(signed_4,s32,from_signed_cell,to_fixnum) \
140         _(unsigned_4,u32,from_unsigned_cell,to_cell) \
141         _(signed_2,s16,from_signed_cell,to_fixnum) \
142         _(unsigned_2,u16,from_unsigned_cell,to_cell) \
143         _(signed_1,s8,from_signed_cell,to_fixnum) \
144         _(unsigned_1,u8,from_unsigned_cell,to_cell) \
145         _(float,float,allot_float,to_float) \
146         _(double,double,allot_float,to_double) \
147         _(cell,void *,allot_alien,pinned_alien_offset)
148
149 #define DECLARE_PRIMITIVE(name) VM_C_API void primitive_##name(factor_vm *parent);
150
151 #define DECLARE_ALIEN_PRIMITIVE(name, type, from, to) \
152         DECLARE_PRIMITIVE(alien_##name) \
153         DECLARE_PRIMITIVE(set_alien_##name)
154
155 EACH_PRIMITIVE(DECLARE_PRIMITIVE)
156 EACH_ALIEN_PRIMITIVE(DECLARE_ALIEN_PRIMITIVE)
157 }