vm ptr passed to untag_check
							parent
							
								
									e2993558a8
								
							
						
					
					
						commit
						82e1ea7110
					
				| 
						 | 
				
			
			@ -139,7 +139,7 @@ DEFINE_ALIEN_ACCESSOR(cell,void *,box_alien,pinned_alien_offset)
 | 
			
		|||
inline void factorvm::vmprim_dlopen()
 | 
			
		||||
{
 | 
			
		||||
	gc_root<byte_array> path(dpop(),this);
 | 
			
		||||
	path.untag_check();
 | 
			
		||||
	path.untag_check(this);
 | 
			
		||||
	gc_root<dll> library(allot<dll>(sizeof(dll)),this);
 | 
			
		||||
	library->path = path.value();
 | 
			
		||||
	ffi_dlopen(library.untagged());
 | 
			
		||||
| 
						 | 
				
			
			@ -156,7 +156,7 @@ inline void factorvm::vmprim_dlsym()
 | 
			
		|||
{
 | 
			
		||||
	gc_root<object> library(dpop(),this);
 | 
			
		||||
	gc_root<byte_array> name(dpop(),this);
 | 
			
		||||
	name.untag_check();
 | 
			
		||||
	name.untag_check(this);
 | 
			
		||||
 | 
			
		||||
	symbol_char *sym = name->data<symbol_char>();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -242,7 +242,7 @@ stack_frame *innermost_stack_frame(callstack *stack)
 | 
			
		|||
stack_frame *factorvm::innermost_stack_frame_quot(callstack *callstack)
 | 
			
		||||
{
 | 
			
		||||
	stack_frame *inner = innermost_stack_frame(callstack);
 | 
			
		||||
	tagged<quotation>(frame_executing(inner)).untag_check();
 | 
			
		||||
	tagged<quotation>(frame_executing(inner)).untag_check(this);
 | 
			
		||||
	return inner;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -278,8 +278,8 @@ inline void factorvm::vmprim_set_innermost_stack_frame_quot()
 | 
			
		|||
	gc_root<callstack> callstack(dpop(),this);
 | 
			
		||||
	gc_root<quotation> quot(dpop(),this);
 | 
			
		||||
 | 
			
		||||
	callstack.untag_check();
 | 
			
		||||
	quot.untag_check();
 | 
			
		||||
	callstack.untag_check(this);
 | 
			
		||||
	quot.untag_check(this);
 | 
			
		||||
 | 
			
		||||
	jit_compile(quot.value(),true);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -146,7 +146,7 @@ inline void factorvm::vmprim_save_image()
 | 
			
		|||
	gc();
 | 
			
		||||
 | 
			
		||||
	gc_root<byte_array> path(dpop(),this);
 | 
			
		||||
	path.untag_check();
 | 
			
		||||
	path.untag_check(this);
 | 
			
		||||
	save_image((vm_char *)(path.untagged() + 1));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +161,7 @@ inline void factorvm::vmprim_save_image_and_exit()
 | 
			
		|||
	where we might throw an error, so we have to throw an error here since
 | 
			
		||||
	later steps destroy the current image. */
 | 
			
		||||
	gc_root<byte_array> path(dpop(),this);
 | 
			
		||||
	path.untag_check();
 | 
			
		||||
	path.untag_check(this);
 | 
			
		||||
 | 
			
		||||
	/* strip out userenv data which is set on startup anyway */
 | 
			
		||||
	for(cell i = 0; i < USER_ENV; i++)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,9 @@
 | 
			
		|||
namespace factor
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
// I've had to copy inline implementations here to make dependencies work. Hopefully this can be better factored
 | 
			
		||||
// I've had to copy inline implementations here to make dependencies work. Am hoping to move this code back into include files
 | 
			
		||||
// once the rest of the reentrant changes are done. -PD
 | 
			
		||||
 | 
			
		||||
//tagged.hpp
 | 
			
		||||
 | 
			
		||||
// write_barrier.hpp
 | 
			
		||||
 | 
			
		||||
inline card *factorvm::addr_to_card(cell a)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,8 +45,8 @@ inline void factorvm::vmprim_fopen()
 | 
			
		|||
{
 | 
			
		||||
	gc_root<byte_array> mode(dpop(),this);
 | 
			
		||||
	gc_root<byte_array> path(dpop(),this);
 | 
			
		||||
	mode.untag_check();
 | 
			
		||||
	path.untag_check();
 | 
			
		||||
	mode.untag_check(this);
 | 
			
		||||
	path.untag_check(this);
 | 
			
		||||
 | 
			
		||||
	for(;;)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -396,7 +396,7 @@ VM_ASM_API cell lazy_jit_compile_impl(cell quot_, stack_frame *stack)
 | 
			
		|||
inline void factorvm::vmprim_quot_compiled_p()
 | 
			
		||||
{
 | 
			
		||||
	tagged<quotation> quot(dpop());
 | 
			
		||||
	quot.untag_check();
 | 
			
		||||
	quot.untag_check(this);
 | 
			
		||||
	dpush(tag_boolean(quot->code != NULL));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,9 +29,9 @@ struct tagged
 | 
			
		|||
 | 
			
		||||
	bool type_p(cell type_) const { return type() == type_; }
 | 
			
		||||
 | 
			
		||||
	TYPE *untag_check() const {
 | 
			
		||||
	TYPE *untag_check(factorvm *myvm) const {
 | 
			
		||||
		if(TYPE::type_number != TYPE_COUNT && !type_p(TYPE::type_number))
 | 
			
		||||
			type_error(TYPE::type_number,value_);
 | 
			
		||||
			myvm->type_error(TYPE::type_number,value_);
 | 
			
		||||
		return untagged();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ struct tagged
 | 
			
		|||
 | 
			
		||||
template <typename TYPE> TYPE *factorvm::untag_check(cell value)
 | 
			
		||||
{
 | 
			
		||||
	return tagged<TYPE>(value).untag_check();
 | 
			
		||||
	return tagged<TYPE>(value).untag_check(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename TYPE> TYPE *untag_check(cell value)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue