Merge branch 'reentrantvm' of git://github.com/phildawes/factor
						commit
						349cb41a29
					
				
							
								
								
									
										27
									
								
								vm/alien.cpp
								
								
								
								
							
							
						
						
									
										27
									
								
								vm/alien.cpp
								
								
								
								
							| 
						 | 
					@ -87,12 +87,12 @@ void *factor_vm::alien_pointer()
 | 
				
			||||||
#define DEFINE_ALIEN_ACCESSOR(name,type,boxer,to) \
 | 
					#define DEFINE_ALIEN_ACCESSOR(name,type,boxer,to) \
 | 
				
			||||||
	PRIMITIVE(alien_##name) \
 | 
						PRIMITIVE(alien_##name) \
 | 
				
			||||||
	{ \
 | 
						{ \
 | 
				
			||||||
		PRIMITIVE_GETVM()->boxer(*(type*)PRIMITIVE_GETVM()->alien_pointer());	\
 | 
							((factor_vm*)myvm)->boxer(*(type*)((factor_vm*)myvm)->alien_pointer());	\
 | 
				
			||||||
	} \
 | 
						} \
 | 
				
			||||||
	PRIMITIVE(set_alien_##name) \
 | 
						PRIMITIVE(set_alien_##name) \
 | 
				
			||||||
	{ \
 | 
						{ \
 | 
				
			||||||
		type *ptr = (type *)PRIMITIVE_GETVM()->alien_pointer(); \
 | 
							type *ptr = (type *)((factor_vm*)myvm)->alien_pointer(); \
 | 
				
			||||||
		type value = PRIMITIVE_GETVM()->to(dpop()); \
 | 
							type value = ((factor_vm*)myvm)->to(dpop()); \
 | 
				
			||||||
		*ptr = value; \
 | 
							*ptr = value; \
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -184,8 +184,7 @@ char *factor_vm::alien_offset(cell obj)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API char *alien_offset(cell obj, factor_vm *myvm)
 | 
					VM_C_API char *alien_offset(cell obj, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->alien_offset(obj);
 | 
				
			||||||
	return VM_PTR->alien_offset(obj);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* pop an object representing a C pointer */
 | 
					/* pop an object representing a C pointer */
 | 
				
			||||||
| 
						 | 
					@ -196,8 +195,7 @@ char *factor_vm::unbox_alien()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API char *unbox_alien(factor_vm *myvm)
 | 
					VM_C_API char *unbox_alien(factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->unbox_alien();
 | 
				
			||||||
	return VM_PTR->unbox_alien();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* make an alien and push */
 | 
					/* make an alien and push */
 | 
				
			||||||
| 
						 | 
					@ -211,8 +209,7 @@ void factor_vm::box_alien(void *ptr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_alien(void *ptr, factor_vm *myvm)
 | 
					VM_C_API void box_alien(void *ptr, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_alien(ptr);
 | 
				
			||||||
	return VM_PTR->box_alien(ptr);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* for FFI calls passing structs by value */
 | 
					/* for FFI calls passing structs by value */
 | 
				
			||||||
| 
						 | 
					@ -223,8 +220,7 @@ void factor_vm::to_value_struct(cell src, void *dest, cell size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void to_value_struct(cell src, void *dest, cell size, factor_vm *myvm)
 | 
					VM_C_API void to_value_struct(cell src, void *dest, cell size, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_value_struct(src,dest,size);
 | 
				
			||||||
	return VM_PTR->to_value_struct(src,dest,size);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* for FFI callbacks receiving structs by value */
 | 
					/* for FFI callbacks receiving structs by value */
 | 
				
			||||||
| 
						 | 
					@ -237,8 +233,7 @@ void factor_vm::box_value_struct(void *src, cell size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_value_struct(void *src, cell size,factor_vm *myvm)
 | 
					VM_C_API void box_value_struct(void *src, cell size,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_value_struct(src,size);
 | 
				
			||||||
	return VM_PTR->box_value_struct(src,size);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* On some x86 OSes, structs <= 8 bytes are returned in registers. */
 | 
					/* On some x86 OSes, structs <= 8 bytes are returned in registers. */
 | 
				
			||||||
| 
						 | 
					@ -252,8 +247,7 @@ void factor_vm::box_small_struct(cell x, cell y, cell size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_small_struct(cell x, cell y, cell size, factor_vm *myvm)
 | 
					VM_C_API void box_small_struct(cell x, cell y, cell size, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_small_struct(x,y,size);
 | 
				
			||||||
	return VM_PTR->box_small_struct(x,y,size);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* On OS X/PPC, complex numbers are returned in registers. */
 | 
					/* On OS X/PPC, complex numbers are returned in registers. */
 | 
				
			||||||
| 
						 | 
					@ -269,8 +263,7 @@ void factor_vm::box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size, factor_vm *myvm)
 | 
					VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_medium_struct(x1, x2, x3, x4, size);
 | 
				
			||||||
	return VM_PTR->box_medium_struct(x1, x2, x3, x4, size);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::primitive_vm_ptr()
 | 
					void factor_vm::primitive_vm_ptr()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,8 +10,7 @@ void factor_vm::box_boolean(bool value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_boolean(bool value, factor_vm *myvm)
 | 
					VM_C_API void box_boolean(bool value, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_boolean(value);
 | 
				
			||||||
	return VM_PTR->box_boolean(value);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool factor_vm::to_boolean(cell value)
 | 
					bool factor_vm::to_boolean(cell value)
 | 
				
			||||||
| 
						 | 
					@ -21,8 +20,7 @@ bool factor_vm::to_boolean(cell value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API bool to_boolean(cell value, factor_vm *myvm)
 | 
					VM_C_API bool to_boolean(cell value, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_boolean(value);
 | 
				
			||||||
	return VM_PTR->to_boolean(value);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -209,8 +209,7 @@ void factor_vm::save_callstack_bottom(stack_frame *callstack_bottom)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_ASM_API void save_callstack_bottom(stack_frame *callstack_bottom, factor_vm *myvm)
 | 
					VM_ASM_API void save_callstack_bottom(stack_frame *callstack_bottom, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->save_callstack_bottom(callstack_bottom);
 | 
				
			||||||
	return VM_PTR->save_callstack_bottom(callstack_bottom);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,7 +97,7 @@ void factor_vm::undefined_symbol()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void undefined_symbol()
 | 
					void undefined_symbol()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return SIGNAL_VM_PTR()->undefined_symbol();
 | 
						return tls_vm()->undefined_symbol();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Look up an external library symbol referenced by a compiled code block */
 | 
					/* Look up an external library symbol referenced by a compiled code block */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,8 +91,7 @@ void factor_vm::nest_stacks()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void nest_stacks(factor_vm *myvm)
 | 
					void nest_stacks(factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->nest_stacks();
 | 
				
			||||||
	return VM_PTR->nest_stacks();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* called when leaving a compiled callback */
 | 
					/* called when leaving a compiled callback */
 | 
				
			||||||
| 
						 | 
					@ -112,8 +111,7 @@ void factor_vm::unnest_stacks()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void unnest_stacks(factor_vm *myvm)
 | 
					void unnest_stacks(factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->unnest_stacks();
 | 
				
			||||||
	return VM_PTR->unnest_stacks();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* called on startup */
 | 
					/* called on startup */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,13 +15,13 @@ void critical_error(const char *msg, cell tagged)
 | 
				
			||||||
	print_string("You have triggered a bug in Factor. Please report.\n");
 | 
						print_string("You have triggered a bug in Factor. Please report.\n");
 | 
				
			||||||
	print_string("critical_error: "); print_string(msg);
 | 
						print_string("critical_error: "); print_string(msg);
 | 
				
			||||||
	print_string(": "); print_cell_hex(tagged); nl();
 | 
						print_string(": "); print_cell_hex(tagged); nl();
 | 
				
			||||||
	SIGNAL_VM_PTR()->factorbug();
 | 
						tls_vm()->factorbug();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void out_of_memory()
 | 
					void out_of_memory()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	print_string("Out of memory\n\n");
 | 
						print_string("Out of memory\n\n");
 | 
				
			||||||
	SIGNAL_VM_PTR()->dump_generations();
 | 
						tls_vm()->dump_generations();
 | 
				
			||||||
	exit(1);
 | 
						exit(1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,7 +146,7 @@ void factor_vm::memory_signal_handler_impl()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void memory_signal_handler_impl()
 | 
					void memory_signal_handler_impl()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->memory_signal_handler_impl();
 | 
						tls_vm()->memory_signal_handler_impl();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::misc_signal_handler_impl()
 | 
					void factor_vm::misc_signal_handler_impl()
 | 
				
			||||||
| 
						 | 
					@ -156,7 +156,7 @@ void factor_vm::misc_signal_handler_impl()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void misc_signal_handler_impl()
 | 
					void misc_signal_handler_impl()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->misc_signal_handler_impl();
 | 
						tls_vm()->misc_signal_handler_impl();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::fp_signal_handler_impl()
 | 
					void factor_vm::fp_signal_handler_impl()
 | 
				
			||||||
| 
						 | 
					@ -166,7 +166,7 @@ void factor_vm::fp_signal_handler_impl()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void fp_signal_handler_impl()
 | 
					void fp_signal_handler_impl()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->fp_signal_handler_impl();
 | 
						tls_vm()->fp_signal_handler_impl();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -193,8 +193,7 @@ void factor_vm::inline_gc(cell *gc_roots_base, cell gc_roots_size)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm)
 | 
					VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						myvm->inline_gc(gc_roots_base,gc_roots_size);
 | 
				
			||||||
	VM_PTR->inline_gc(gc_roots_base,gc_roots_size);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -250,8 +250,7 @@ void *factor_vm::inline_cache_miss(cell return_address)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void *inline_cache_miss(cell return_address, factor_vm *myvm)
 | 
					VM_C_API void *inline_cache_miss(cell return_address, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->inline_cache_miss(return_address);
 | 
				
			||||||
	return VM_PTR->inline_cache_miss(return_address);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::primitive_reset_inline_cache_stats()
 | 
					void factor_vm::primitive_reset_inline_cache_stats()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										60
									
								
								vm/math.cpp
								
								
								
								
							
							
						
						
									
										60
									
								
								vm/math.cpp
								
								
								
								
							| 
						 | 
					@ -395,8 +395,7 @@ fixnum factor_vm::to_fixnum(cell tagged)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API fixnum to_fixnum(cell tagged,factor_vm *myvm)
 | 
					VM_C_API fixnum to_fixnum(cell tagged,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_fixnum(tagged);
 | 
				
			||||||
	return VM_PTR->to_fixnum(tagged);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cell factor_vm::to_cell(cell tagged)
 | 
					cell factor_vm::to_cell(cell tagged)
 | 
				
			||||||
| 
						 | 
					@ -406,8 +405,7 @@ cell factor_vm::to_cell(cell tagged)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API cell to_cell(cell tagged, factor_vm *myvm)
 | 
					VM_C_API cell to_cell(cell tagged, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_cell(tagged);
 | 
				
			||||||
	return VM_PTR->to_cell(tagged);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_signed_1(s8 n)
 | 
					void factor_vm::box_signed_1(s8 n)
 | 
				
			||||||
| 
						 | 
					@ -417,8 +415,7 @@ void factor_vm::box_signed_1(s8 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_signed_1(s8 n,factor_vm *myvm)
 | 
					VM_C_API void box_signed_1(s8 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_signed_1(n);
 | 
				
			||||||
	return VM_PTR->box_signed_1(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_unsigned_1(u8 n)
 | 
					void factor_vm::box_unsigned_1(u8 n)
 | 
				
			||||||
| 
						 | 
					@ -428,8 +425,7 @@ void factor_vm::box_unsigned_1(u8 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_unsigned_1(u8 n,factor_vm *myvm)
 | 
					VM_C_API void box_unsigned_1(u8 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_unsigned_1(n);
 | 
				
			||||||
	return VM_PTR->box_unsigned_1(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_signed_2(s16 n)
 | 
					void factor_vm::box_signed_2(s16 n)
 | 
				
			||||||
| 
						 | 
					@ -439,8 +435,7 @@ void factor_vm::box_signed_2(s16 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_signed_2(s16 n,factor_vm *myvm)
 | 
					VM_C_API void box_signed_2(s16 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_signed_2(n);
 | 
				
			||||||
	return VM_PTR->box_signed_2(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_unsigned_2(u16 n)
 | 
					void factor_vm::box_unsigned_2(u16 n)
 | 
				
			||||||
| 
						 | 
					@ -450,8 +445,7 @@ void factor_vm::box_unsigned_2(u16 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_unsigned_2(u16 n,factor_vm *myvm)
 | 
					VM_C_API void box_unsigned_2(u16 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_unsigned_2(n);
 | 
				
			||||||
	return VM_PTR->box_unsigned_2(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_signed_4(s32 n)
 | 
					void factor_vm::box_signed_4(s32 n)
 | 
				
			||||||
| 
						 | 
					@ -461,8 +455,7 @@ void factor_vm::box_signed_4(s32 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_signed_4(s32 n,factor_vm *myvm)
 | 
					VM_C_API void box_signed_4(s32 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_signed_4(n);
 | 
				
			||||||
	return VM_PTR->box_signed_4(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_unsigned_4(u32 n)
 | 
					void factor_vm::box_unsigned_4(u32 n)
 | 
				
			||||||
| 
						 | 
					@ -472,8 +465,7 @@ void factor_vm::box_unsigned_4(u32 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_unsigned_4(u32 n,factor_vm *myvm)
 | 
					VM_C_API void box_unsigned_4(u32 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_unsigned_4(n);
 | 
				
			||||||
	return VM_PTR->box_unsigned_4(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_signed_cell(fixnum integer)
 | 
					void factor_vm::box_signed_cell(fixnum integer)
 | 
				
			||||||
| 
						 | 
					@ -483,8 +475,7 @@ void factor_vm::box_signed_cell(fixnum integer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_signed_cell(fixnum integer,factor_vm *myvm)
 | 
					VM_C_API void box_signed_cell(fixnum integer,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_signed_cell(integer);
 | 
				
			||||||
	return VM_PTR->box_signed_cell(integer);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_unsigned_cell(cell cell)
 | 
					void factor_vm::box_unsigned_cell(cell cell)
 | 
				
			||||||
| 
						 | 
					@ -494,8 +485,7 @@ void factor_vm::box_unsigned_cell(cell cell)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_unsigned_cell(cell cell,factor_vm *myvm)
 | 
					VM_C_API void box_unsigned_cell(cell cell,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_unsigned_cell(cell);
 | 
				
			||||||
	return VM_PTR->box_unsigned_cell(cell);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_signed_8(s64 n)
 | 
					void factor_vm::box_signed_8(s64 n)
 | 
				
			||||||
| 
						 | 
					@ -508,8 +498,7 @@ void factor_vm::box_signed_8(s64 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_signed_8(s64 n,factor_vm *myvm)
 | 
					VM_C_API void box_signed_8(s64 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_signed_8(n);
 | 
				
			||||||
	return VM_PTR->box_signed_8(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
s64 factor_vm::to_signed_8(cell obj)
 | 
					s64 factor_vm::to_signed_8(cell obj)
 | 
				
			||||||
| 
						 | 
					@ -528,8 +517,7 @@ s64 factor_vm::to_signed_8(cell obj)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API s64 to_signed_8(cell obj,factor_vm *myvm)
 | 
					VM_C_API s64 to_signed_8(cell obj,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_signed_8(obj);
 | 
				
			||||||
	return VM_PTR->to_signed_8(obj);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_unsigned_8(u64 n)
 | 
					void factor_vm::box_unsigned_8(u64 n)
 | 
				
			||||||
| 
						 | 
					@ -542,8 +530,7 @@ void factor_vm::box_unsigned_8(u64 n)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_unsigned_8(u64 n,factor_vm *myvm)
 | 
					VM_C_API void box_unsigned_8(u64 n,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_unsigned_8(n);
 | 
				
			||||||
	return VM_PTR->box_unsigned_8(n);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u64 factor_vm::to_unsigned_8(cell obj)
 | 
					u64 factor_vm::to_unsigned_8(cell obj)
 | 
				
			||||||
| 
						 | 
					@ -562,8 +549,7 @@ u64 factor_vm::to_unsigned_8(cell obj)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API u64 to_unsigned_8(cell obj,factor_vm *myvm)
 | 
					VM_C_API u64 to_unsigned_8(cell obj,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_unsigned_8(obj);
 | 
				
			||||||
	return VM_PTR->to_unsigned_8(obj);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
void factor_vm::box_float(float flo)
 | 
					void factor_vm::box_float(float flo)
 | 
				
			||||||
| 
						 | 
					@ -573,8 +559,7 @@ void factor_vm::box_float(float flo)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_float(float flo, factor_vm *myvm)
 | 
					VM_C_API void box_float(float flo, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_float(flo);
 | 
				
			||||||
	return VM_PTR->box_float(flo);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
float factor_vm::to_float(cell value)
 | 
					float factor_vm::to_float(cell value)
 | 
				
			||||||
| 
						 | 
					@ -584,8 +569,7 @@ float factor_vm::to_float(cell value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API float to_float(cell value,factor_vm *myvm)
 | 
					VM_C_API float to_float(cell value,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_float(value);
 | 
				
			||||||
	return VM_PTR->to_float(value);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::box_double(double flo)
 | 
					void factor_vm::box_double(double flo)
 | 
				
			||||||
| 
						 | 
					@ -595,8 +579,7 @@ void factor_vm::box_double(double flo)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API void box_double(double flo,factor_vm *myvm)
 | 
					VM_C_API void box_double(double flo,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->box_double(flo);
 | 
				
			||||||
	return VM_PTR->box_double(flo);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double factor_vm::to_double(cell value)
 | 
					double factor_vm::to_double(cell value)
 | 
				
			||||||
| 
						 | 
					@ -606,8 +589,7 @@ double factor_vm::to_double(cell value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API double to_double(cell value,factor_vm *myvm)
 | 
					VM_C_API double to_double(cell value,factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->to_double(value);
 | 
				
			||||||
	return VM_PTR->to_double(value);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* The fixnum+, fixnum- and fixnum* primitives are defined in cpu_*.S. On
 | 
					/* The fixnum+, fixnum- and fixnum* primitives are defined in cpu_*.S. On
 | 
				
			||||||
| 
						 | 
					@ -620,7 +602,7 @@ inline void factor_vm::overflow_fixnum_add(fixnum x, fixnum y)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_ASM_API void overflow_fixnum_add(fixnum x, fixnum y, factor_vm *myvm)
 | 
					VM_ASM_API void overflow_fixnum_add(fixnum x, fixnum y, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_add(x,y);
 | 
						((factor_vm*)myvm)->overflow_fixnum_add(x,y);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
 | 
					inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
 | 
				
			||||||
| 
						 | 
					@ -631,7 +613,7 @@ inline void factor_vm::overflow_fixnum_subtract(fixnum x, fixnum y)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_ASM_API void overflow_fixnum_subtract(fixnum x, fixnum y, factor_vm *myvm)
 | 
					VM_ASM_API void overflow_fixnum_subtract(fixnum x, fixnum y, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_subtract(x,y);
 | 
						((factor_vm*)myvm)->overflow_fixnum_subtract(x,y);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
 | 
					inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
 | 
				
			||||||
| 
						 | 
					@ -645,7 +627,7 @@ inline void factor_vm::overflow_fixnum_multiply(fixnum x, fixnum y)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_ASM_API void overflow_fixnum_multiply(fixnum x, fixnum y, factor_vm *myvm)
 | 
					VM_ASM_API void overflow_fixnum_multiply(fixnum x, fixnum y, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PRIMITIVE_OVERFLOW_GETVM()->overflow_fixnum_multiply(x,y);
 | 
						((factor_vm*)myvm)->overflow_fixnum_multiply(x,y);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,7 +25,7 @@ void flush_icache(cell start, cell len)
 | 
				
			||||||
		: "r0","r1","r2");
 | 
							: "r0","r1","r2");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(result < 0)
 | 
						if(result < 0)
 | 
				
			||||||
		SIGNAL_VM_PTR->critical_error("flush_icache() failed",result);
 | 
							tls_vm()critical_error("flush_icache() failed",result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,19 +45,19 @@ VM_C_API int inotify_rm_watch(int fd, u32 wd)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API int inotify_init()
 | 
					VM_C_API int inotify_init()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	VM_PTR->not_implemented_error();
 | 
						myvm->not_implemented_error();
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API int inotify_add_watch(int fd, const char *name, u32 mask)
 | 
					VM_C_API int inotify_add_watch(int fd, const char *name, u32 mask)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	VM_PTR->not_implemented_error();
 | 
						myvm->not_implemented_error();
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_C_API int inotify_rm_watch(int fd, u32 wd)
 | 
					VM_C_API int inotify_rm_watch(int fd, u32 wd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	VM_PTR->not_implemented_error();
 | 
						myvm->not_implemented_error();
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -139,7 +139,7 @@ void factor_vm::memory_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void memory_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
					void memory_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->memory_signal_handler(signal,siginfo,uap);
 | 
						tls_vm()->memory_signal_handler(signal,siginfo,uap);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
					void factor_vm::misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
| 
						 | 
					@ -151,7 +151,7 @@ void factor_vm::misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
					void misc_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->misc_signal_handler(signal,siginfo,uap);
 | 
						tls_vm()->misc_signal_handler(signal,siginfo,uap);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
					void factor_vm::fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@ void factor_vm::fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
					void fpe_signal_handler(int signal, siginfo_t *siginfo, void *uap)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SIGNAL_VM_PTR()->fpe_signal_handler(signal, siginfo, uap);
 | 
						tls_vm()->fpe_signal_handler(signal, siginfo, uap);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void sigaction_safe(int signum, const struct sigaction *act, struct sigaction *oldact)
 | 
					static void sigaction_safe(int signum, const struct sigaction *act, struct sigaction *oldact)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,7 @@ LONG factor_vm::exception_handler(PEXCEPTION_POINTERS pe)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
 | 
					FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return SIGNAL_VM_PTR()->exception_handler(pe);
 | 
						return tls_vm()->exception_handler(pe);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool handler_added = 0;
 | 
					bool handler_added = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,14 +6,14 @@ namespace factor
 | 
				
			||||||
  #define PRIMITIVE(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm)
 | 
					  #define PRIMITIVE(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm)
 | 
				
			||||||
  #define PRIMITIVE_FORWARD(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm) \
 | 
					  #define PRIMITIVE_FORWARD(name) extern "C" __attribute__ ((regparm (1)))  void primitive_##name(void *myvm) \
 | 
				
			||||||
  {									\
 | 
					  {									\
 | 
				
			||||||
	PRIMITIVE_GETVM()->primitive_##name();				\
 | 
						((factor_vm*)myvm)->primitive_##name();				\
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  extern "C" typedef void (*primitive_type)(void *myvm);
 | 
					  extern "C" typedef void (*primitive_type)(void *myvm);
 | 
				
			||||||
  #define PRIMITIVE(name) extern "C" void primitive_##name(void *myvm)
 | 
					  #define PRIMITIVE(name) extern "C" void primitive_##name(void *myvm)
 | 
				
			||||||
  #define PRIMITIVE_FORWARD(name) extern "C" void primitive_##name(void *myvm) \
 | 
					  #define PRIMITIVE_FORWARD(name) extern "C" void primitive_##name(void *myvm) \
 | 
				
			||||||
  {									\
 | 
					  {									\
 | 
				
			||||||
	PRIMITIVE_GETVM()->primitive_##name();				\
 | 
						((factor_vm*)myvm)->primitive_##name();				\
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
extern const primitive_type primitives[];
 | 
					extern const primitive_type primitives[];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -371,8 +371,7 @@ cell factor_vm::lazy_jit_compile_impl(cell quot_, stack_frame *stack)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VM_ASM_API cell lazy_jit_compile_impl(cell quot_, stack_frame *stack, factor_vm *myvm)
 | 
					VM_ASM_API cell lazy_jit_compile_impl(cell quot_, stack_frame *stack, factor_vm *myvm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ASSERTVM();
 | 
						return myvm->lazy_jit_compile_impl(quot_,stack);
 | 
				
			||||||
	return VM_PTR->lazy_jit_compile_impl(quot_,stack);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void factor_vm::primitive_quot_compiled_p()
 | 
					void factor_vm::primitive_quot_compiled_p()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,13 +37,13 @@ struct tagged
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	explicit tagged(cell tagged) : value_(tagged) {
 | 
						explicit tagged(cell tagged) : value_(tagged) {
 | 
				
			||||||
#ifdef FACTOR_DEBUG
 | 
					#ifdef FACTOR_DEBUG
 | 
				
			||||||
		untag_check(SIGNAL_VM_PTR());
 | 
							untag_check(tls_vm());
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	explicit tagged(Type *untagged) : value_(factor::tag(untagged)) {
 | 
						explicit tagged(Type *untagged) : value_(factor::tag(untagged)) {
 | 
				
			||||||
#ifdef FACTOR_DEBUG
 | 
					#ifdef FACTOR_DEBUG
 | 
				
			||||||
		untag_check(SIGNAL_VM_PTR()); 
 | 
							untag_check(tls_vm()); 
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										41
									
								
								vm/vm.hpp
								
								
								
								
							
							
						
						
									
										41
									
								
								vm/vm.hpp
								
								
								
								
							| 
						 | 
					@ -690,47 +690,6 @@ struct factor_vm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef FACTOR_REENTRANT
 | 
					 | 
				
			||||||
        #define FACTOR_SINGLE_THREADED_TESTING
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef FACTOR_SINGLE_THREADED_SINGLETON
 | 
					 | 
				
			||||||
/* calls are dispatched using the singleton vm ptr */
 | 
					 | 
				
			||||||
        extern factor_vm *vm;
 | 
					 | 
				
			||||||
        #define PRIMITIVE_GETVM() vm
 | 
					 | 
				
			||||||
        #define PRIMITIVE_OVERFLOW_GETVM() vm
 | 
					 | 
				
			||||||
        #define VM_PTR vm
 | 
					 | 
				
			||||||
        #define ASSERTVM()
 | 
					 | 
				
			||||||
        #define SIGNAL_VM_PTR() vm
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef FACTOR_SINGLE_THREADED_TESTING
 | 
					 | 
				
			||||||
/* calls are dispatched as per multithreaded, but checked against singleton */
 | 
					 | 
				
			||||||
        extern factor_vm *vm;
 | 
					 | 
				
			||||||
        #define ASSERTVM() assert(vm==myvm)
 | 
					 | 
				
			||||||
        #define PRIMITIVE_GETVM() ((factor_vm*)myvm)
 | 
					 | 
				
			||||||
        #define PRIMITIVE_OVERFLOW_GETVM() ASSERTVM(); myvm
 | 
					 | 
				
			||||||
        #define VM_PTR myvm
 | 
					 | 
				
			||||||
        #define SIGNAL_VM_PTR() tls_vm()
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef FACTOR_REENTRANT_TLS
 | 
					 | 
				
			||||||
/* uses thread local storage to obtain vm ptr */
 | 
					 | 
				
			||||||
        #define PRIMITIVE_GETVM() tls_vm()
 | 
					 | 
				
			||||||
        #define PRIMITIVE_OVERFLOW_GETVM() tls_vm()
 | 
					 | 
				
			||||||
        #define VM_PTR tls_vm()
 | 
					 | 
				
			||||||
        #define ASSERTVM()
 | 
					 | 
				
			||||||
        #define SIGNAL_VM_PTR() tls_vm()
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef FACTOR_REENTRANT
 | 
					 | 
				
			||||||
        #define PRIMITIVE_GETVM() ((factor_vm*)myvm)
 | 
					 | 
				
			||||||
        #define PRIMITIVE_OVERFLOW_GETVM() ((factor_vm*)myvm)
 | 
					 | 
				
			||||||
        #define VM_PTR myvm
 | 
					 | 
				
			||||||
        #define ASSERTVM()
 | 
					 | 
				
			||||||
        #define SIGNAL_VM_PTR() tls_vm()
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
extern unordered_map<THREADHANDLE, factor_vm *> thread_vms;
 | 
					extern unordered_map<THREADHANDLE, factor_vm *> thread_vms;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue