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