| 
									
										
										
										
											2009-05-04 02:46:13 -04:00
										 |  |  | namespace factor | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-19 08:48:31 -05:00
										 |  |  | /* Generated with PRIMITIVE in primitives.cpp */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | #define EACH_PRIMITIVE(_) \
 | 
					
						
							|  |  |  | 	_(alien_address) \ | 
					
						
							|  |  |  | 	_(all_instances) \ | 
					
						
							|  |  |  | 	_(array) \ | 
					
						
							|  |  |  | 	_(array_to_quotation) \ | 
					
						
							|  |  |  | 	_(become) \ | 
					
						
							|  |  |  | 	_(bignum_add) \ | 
					
						
							|  |  |  | 	_(bignum_and) \ | 
					
						
							|  |  |  | 	_(bignum_bitp) \ | 
					
						
							|  |  |  | 	_(bignum_divint) \ | 
					
						
							|  |  |  | 	_(bignum_divmod) \ | 
					
						
							|  |  |  | 	_(bignum_eq) \ | 
					
						
							|  |  |  | 	_(bignum_greater) \ | 
					
						
							|  |  |  | 	_(bignum_greatereq) \ | 
					
						
							|  |  |  | 	_(bignum_less) \ | 
					
						
							|  |  |  | 	_(bignum_lesseq) \ | 
					
						
							|  |  |  | 	_(bignum_log2) \ | 
					
						
							|  |  |  | 	_(bignum_mod) \ | 
					
						
							| 
									
										
										
										
											2012-04-05 12:17:35 -04:00
										 |  |  | 	_(bignum_gcd) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(bignum_multiply) \ | 
					
						
							|  |  |  | 	_(bignum_not) \ | 
					
						
							|  |  |  | 	_(bignum_or) \ | 
					
						
							|  |  |  | 	_(bignum_shift) \ | 
					
						
							|  |  |  | 	_(bignum_subtract) \ | 
					
						
							|  |  |  | 	_(bignum_to_fixnum) \ | 
					
						
							|  |  |  | 	_(bignum_xor) \ | 
					
						
							|  |  |  | 	_(bits_double) \ | 
					
						
							|  |  |  | 	_(bits_float) \ | 
					
						
							|  |  |  | 	_(byte_array) \ | 
					
						
							|  |  |  | 	_(callback) \ | 
					
						
							|  |  |  | 	_(callstack) \ | 
					
						
							| 
									
										
										
										
											2010-04-19 21:08:15 -04:00
										 |  |  | 	_(callstack_bounds) \ | 
					
						
							| 
									
										
										
										
											2010-03-29 20:40:17 -04:00
										 |  |  | 	_(callstack_for) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(callstack_to_array) \ | 
					
						
							|  |  |  | 	_(check_datastack) \ | 
					
						
							| 
									
										
										
										
											2011-10-31 20:43:18 -04:00
										 |  |  | 	_(clear_samples) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(clone) \ | 
					
						
							|  |  |  | 	_(code_blocks) \ | 
					
						
							|  |  |  | 	_(code_room) \ | 
					
						
							|  |  |  | 	_(compact_gc) \ | 
					
						
							|  |  |  | 	_(compute_identity_hashcode) \ | 
					
						
							|  |  |  | 	_(context_object) \ | 
					
						
							| 
									
										
										
										
											2010-03-29 20:40:17 -04:00
										 |  |  | 	_(context_object_for) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(current_callback) \ | 
					
						
							|  |  |  | 	_(data_room) \ | 
					
						
							|  |  |  | 	_(datastack) \ | 
					
						
							| 
									
										
										
										
											2010-03-29 20:40:17 -04:00
										 |  |  | 	_(datastack_for) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(die) \ | 
					
						
							|  |  |  | 	_(disable_gc_events) \ | 
					
						
							|  |  |  | 	_(dispatch_stats) \ | 
					
						
							|  |  |  | 	_(displaced_alien) \ | 
					
						
							|  |  |  | 	_(dlclose) \ | 
					
						
							|  |  |  | 	_(dll_validp) \ | 
					
						
							|  |  |  | 	_(dlopen) \ | 
					
						
							|  |  |  | 	_(dlsym) \ | 
					
						
							| 
									
										
										
										
											2011-05-20 18:11:50 -04:00
										 |  |  | 	_(dlsym_raw) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(double_bits) \ | 
					
						
							|  |  |  | 	_(enable_gc_events) \ | 
					
						
							|  |  |  | 	_(existsp) \ | 
					
						
							|  |  |  | 	_(exit) \ | 
					
						
							|  |  |  | 	_(fclose) \ | 
					
						
							|  |  |  | 	_(fflush) \ | 
					
						
							|  |  |  | 	_(fgetc) \ | 
					
						
							|  |  |  | 	_(fixnum_divint) \ | 
					
						
							|  |  |  | 	_(fixnum_divmod) \ | 
					
						
							|  |  |  | 	_(fixnum_shift) \ | 
					
						
							|  |  |  | 	_(fixnum_to_bignum) \ | 
					
						
							|  |  |  | 	_(fixnum_to_float) \ | 
					
						
							|  |  |  | 	_(float_add) \ | 
					
						
							|  |  |  | 	_(float_bits) \ | 
					
						
							|  |  |  | 	_(float_divfloat) \ | 
					
						
							|  |  |  | 	_(float_eq) \ | 
					
						
							|  |  |  | 	_(float_greater) \ | 
					
						
							|  |  |  | 	_(float_greatereq) \ | 
					
						
							|  |  |  | 	_(float_less) \ | 
					
						
							|  |  |  | 	_(float_lesseq) \ | 
					
						
							|  |  |  | 	_(float_multiply) \ | 
					
						
							|  |  |  | 	_(float_subtract) \ | 
					
						
							|  |  |  | 	_(float_to_bignum) \ | 
					
						
							|  |  |  | 	_(float_to_fixnum) \ | 
					
						
							|  |  |  | 	_(fopen) \ | 
					
						
							| 
									
										
										
										
											2010-04-14 00:21:28 -04:00
										 |  |  | 	_(format_float) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(fputc) \ | 
					
						
							|  |  |  | 	_(fread) \ | 
					
						
							|  |  |  | 	_(fseek) \ | 
					
						
							|  |  |  | 	_(ftell) \ | 
					
						
							|  |  |  | 	_(full_gc) \ | 
					
						
							|  |  |  | 	_(fwrite) \ | 
					
						
							| 
									
										
										
										
											2011-10-31 20:43:18 -04:00
										 |  |  | 	_(get_samples) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(identity_hashcode) \ | 
					
						
							|  |  |  | 	_(innermost_stack_frame_executing) \ | 
					
						
							|  |  |  | 	_(innermost_stack_frame_scan) \ | 
					
						
							|  |  |  | 	_(jit_compile) \ | 
					
						
							|  |  |  | 	_(load_locals) \ | 
					
						
							|  |  |  | 	_(lookup_method) \ | 
					
						
							|  |  |  | 	_(mega_cache_miss) \ | 
					
						
							|  |  |  | 	_(minor_gc) \ | 
					
						
							|  |  |  | 	_(modify_code_heap) \ | 
					
						
							|  |  |  | 	_(nano_count) \ | 
					
						
							|  |  |  | 	_(optimized_p) \ | 
					
						
							|  |  |  | 	_(quot_compiled_p) \ | 
					
						
							|  |  |  | 	_(quotation_code) \ | 
					
						
							|  |  |  | 	_(reset_dispatch_stats) \ | 
					
						
							|  |  |  | 	_(resize_array) \ | 
					
						
							|  |  |  | 	_(resize_byte_array) \ | 
					
						
							|  |  |  | 	_(resize_string) \ | 
					
						
							|  |  |  | 	_(retainstack) \ | 
					
						
							| 
									
										
										
										
											2010-03-29 20:40:17 -04:00
										 |  |  | 	_(retainstack_for) \ | 
					
						
							| 
									
										
										
										
											2011-10-28 18:42:33 -04:00
										 |  |  | 	_(sampling_profiler) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(save_image) \ | 
					
						
							|  |  |  | 	_(save_image_and_exit) \ | 
					
						
							|  |  |  | 	_(set_context_object) \ | 
					
						
							|  |  |  | 	_(set_datastack) \ | 
					
						
							|  |  |  | 	_(set_innermost_stack_frame_quot) \ | 
					
						
							|  |  |  | 	_(set_retainstack) \ | 
					
						
							|  |  |  | 	_(set_slot) \ | 
					
						
							|  |  |  | 	_(set_special_object) \ | 
					
						
							|  |  |  | 	_(set_string_nth_fast) \ | 
					
						
							|  |  |  | 	_(size) \ | 
					
						
							|  |  |  | 	_(sleep) \ | 
					
						
							|  |  |  | 	_(special_object) \ | 
					
						
							|  |  |  | 	_(string) \ | 
					
						
							|  |  |  | 	_(strip_stack_traces) \ | 
					
						
							|  |  |  | 	_(tuple) \ | 
					
						
							|  |  |  | 	_(tuple_boa) \ | 
					
						
							|  |  |  | 	_(unimplemented) \ | 
					
						
							|  |  |  | 	_(uninitialized_byte_array) \ | 
					
						
							|  |  |  | 	_(word) \ | 
					
						
							|  |  |  | 	_(word_code) \ | 
					
						
							|  |  |  | 	_(wrapper) | 
					
						
							| 
									
										
										
										
											2009-09-27 14:42:18 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-19 14:05:14 -04:00
										 |  |  | #define EACH_ALIEN_PRIMITIVE(_) \
 | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(signed_cell,fixnum,from_signed_cell,to_fixnum) \ | 
					
						
							|  |  |  | 	_(unsigned_cell,cell,from_unsigned_cell,to_cell) \ | 
					
						
							|  |  |  | 	_(signed_8,s64,from_signed_8,to_signed_8) \ | 
					
						
							|  |  |  | 	_(unsigned_8,u64,from_unsigned_8,to_unsigned_8) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 16:03:27 -04:00
										 |  |  | 	_(signed_4,s32,from_signed_cell,to_fixnum) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 10:09:28 -04:00
										 |  |  | 	_(unsigned_4,u32,from_unsigned_cell,to_cell) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 16:03:27 -04:00
										 |  |  | 	_(signed_2,s16,from_signed_cell,to_fixnum) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 10:09:28 -04:00
										 |  |  | 	_(unsigned_2,u16,from_unsigned_cell,to_cell) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 16:03:27 -04:00
										 |  |  | 	_(signed_1,s8,from_signed_cell,to_fixnum) \ | 
					
						
							| 
									
										
										
										
											2010-07-19 10:09:28 -04:00
										 |  |  | 	_(unsigned_1,u8,from_unsigned_cell,to_cell) \ | 
					
						
							| 
									
										
										
										
											2010-05-11 23:24:25 -04:00
										 |  |  | 	_(float,float,allot_float,to_float) \ | 
					
						
							|  |  |  | 	_(double,double,allot_float,to_double) \ | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	_(cell,void *,allot_alien,pinned_alien_offset) | 
					
						
							| 
									
										
										
										
											2010-03-19 14:05:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define DECLARE_PRIMITIVE(name) VM_C_API void primitive_##name(factor_vm *parent);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define DECLARE_ALIEN_PRIMITIVE(name, type, from, to) \
 | 
					
						
							| 
									
										
										
										
											2010-03-26 22:44:43 -04:00
										 |  |  | 	DECLARE_PRIMITIVE(alien_##name) \ | 
					
						
							|  |  |  | 	DECLARE_PRIMITIVE(set_alien_##name) | 
					
						
							| 
									
										
										
										
											2010-03-19 14:05:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | EACH_PRIMITIVE(DECLARE_PRIMITIVE) | 
					
						
							|  |  |  | EACH_ALIEN_PRIMITIVE(DECLARE_ALIEN_PRIMITIVE) | 
					
						
							| 
									
										
										
										
											2009-05-04 02:46:13 -04:00
										 |  |  | } |