vm: remove DEFPUSHPOP macro
							parent
							
								
									9f79cb0002
								
							
						
					
					
						commit
						9705768e3f
					
				| 
						 | 
				
			
			@ -55,11 +55,30 @@ struct context {
 | 
			
		|||
#define rs_bot (ctx->retainstack_region->start)
 | 
			
		||||
#define rs_top (ctx->retainstack_region->end)
 | 
			
		||||
 | 
			
		||||
DEFPUSHPOP(d,ds)
 | 
			
		||||
DEFPUSHPOP(r,rs)
 | 
			
		||||
inline cell dpeek()
 | 
			
		||||
{
 | 
			
		||||
	return *(cell *)ds;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline void drepl(cell tagged)
 | 
			
		||||
{
 | 
			
		||||
	*(cell *)ds = tagged;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline cell dpop()
 | 
			
		||||
{
 | 
			
		||||
	cell value = dpeek();
 | 
			
		||||
	ds -= sizeof(cell);
 | 
			
		||||
	return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline void dpush(cell tagged)
 | 
			
		||||
{
 | 
			
		||||
	ds += sizeof(cell);
 | 
			
		||||
	drepl(tagged);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
VM_C_API void nest_stacks(stack_frame *magic_frame, factor_vm *vm);
 | 
			
		||||
VM_C_API void unnest_stacks(factor_vm *vm);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,7 +40,6 @@ namespace factor
 | 
			
		|||
#include "layouts.hpp"
 | 
			
		||||
#include "platform.hpp"
 | 
			
		||||
#include "primitives.hpp"
 | 
			
		||||
#include "stacks.hpp"
 | 
			
		||||
#include "segments.hpp"
 | 
			
		||||
#include "contexts.hpp"
 | 
			
		||||
#include "run.hpp"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,19 +0,0 @@
 | 
			
		|||
namespace factor
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
#define DEFPUSHPOP(prefix,ptr) \
 | 
			
		||||
	inline cell prefix##peek() { return *(cell *)ptr; } \
 | 
			
		||||
	inline void prefix##repl(cell tagged) { *(cell *)ptr = tagged; } \
 | 
			
		||||
	inline cell prefix##pop() \
 | 
			
		||||
	{ \
 | 
			
		||||
		cell value = prefix##peek(); \
 | 
			
		||||
		ptr -= sizeof(cell); \
 | 
			
		||||
		return value; \
 | 
			
		||||
	} \
 | 
			
		||||
	inline void prefix##push(cell tagged) \
 | 
			
		||||
	{ \
 | 
			
		||||
		ptr += sizeof(cell); \
 | 
			
		||||
		prefix##repl(tagged); \
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue