removed some global functions from callstack.cpp

db4
Phil Dawes 2009-08-17 21:37:18 +01:00
parent 1887a16ca3
commit 551a800d2f
2 changed files with 2 additions and 63 deletions

View File

@ -11,11 +11,6 @@ void factorvm::check_frame(stack_frame *frame)
#endif
}
void check_frame(stack_frame *frame)
{
return vm->check_frame(frame);
}
callstack *factorvm::allot_callstack(cell size)
{
callstack *stack = allot<callstack>(callstack_size(size));
@ -23,11 +18,6 @@ callstack *factorvm::allot_callstack(cell size)
return stack;
}
callstack *allot_callstack(cell size)
{
return vm->allot_callstack(size);
}
stack_frame *factorvm::fix_callstack_top(stack_frame *top, stack_frame *bottom)
{
stack_frame *frame = bottom - 1;
@ -38,11 +28,6 @@ stack_frame *factorvm::fix_callstack_top(stack_frame *top, stack_frame *bottom)
return frame + 1;
}
stack_frame *fix_callstack_top(stack_frame *top, stack_frame *bottom)
{
return vm->fix_callstack_top(top,bottom);
}
/* We ignore the topmost frame, the one calling 'callstack',
so that set-callstack doesn't get stuck in an infinite loop.
@ -61,11 +46,6 @@ stack_frame *factorvm::capture_start()
return frame + 1;
}
stack_frame *capture_start()
{
return vm->capture_start();
}
inline void factorvm::vmprim_callstack()
{
stack_frame *top = capture_start();
@ -109,21 +89,12 @@ code_block *factorvm::frame_code(stack_frame *frame)
return (code_block *)frame->xt - 1;
}
code_block *frame_code(stack_frame *frame)
{
return vm->frame_code(frame);
}
cell factorvm::frame_type(stack_frame *frame)
{
return frame_code(frame)->type;
}
cell frame_type(stack_frame *frame)
{
return vm->frame_type(frame);
}
cell factorvm::frame_executing(stack_frame *frame)
{
code_block *compiled = frame_code(frame);
@ -138,22 +109,12 @@ cell factorvm::frame_executing(stack_frame *frame)
}
}
cell frame_executing(stack_frame *frame)
{
return vm->frame_executing(frame);
}
stack_frame *factorvm::frame_successor(stack_frame *frame)
{
check_frame(frame);
return (stack_frame *)((cell)frame - frame->size);
}
stack_frame *frame_successor(stack_frame *frame)
{
return vm->frame_successor(frame);
}
/* Allocates memory */
cell factorvm::frame_scan(stack_frame *frame)
{
@ -181,11 +142,6 @@ cell factorvm::frame_scan(stack_frame *frame)
}
}
cell frame_scan(stack_frame *frame)
{
return vm->frame_scan(frame);
}
namespace
{
@ -196,8 +152,8 @@ struct stack_frame_accumulator {
void operator()(stack_frame *frame, factorvm *myvm)
{
gc_root<object> executing(frame_executing(frame),myvm);
gc_root<object> scan(frame_scan(frame),myvm);
gc_root<object> executing(myvm->frame_executing(frame),myvm);
gc_root<object> scan(myvm->frame_scan(frame),myvm);
frames.add(executing.value());
frames.add(scan.value());
@ -234,11 +190,6 @@ stack_frame *factorvm::innermost_stack_frame(callstack *stack)
return frame;
}
stack_frame *innermost_stack_frame(callstack *stack)
{
return vm->innermost_stack_frame(stack);
}
stack_frame *factorvm::innermost_stack_frame_quot(callstack *callstack)
{
stack_frame *inner = innermost_stack_frame(callstack);
@ -246,11 +197,6 @@ stack_frame *factorvm::innermost_stack_frame_quot(callstack *callstack)
return inner;
}
stack_frame *innermost_stack_frame_quot(callstack *callstack)
{
return vm->innermost_stack_frame_quot(callstack);
}
/* Some primitives implementing a limited form of callstack mutation.
Used by the single stepper. */
inline void factorvm::vmprim_innermost_stack_frame_executing()

View File

@ -6,13 +6,6 @@ inline static cell callstack_size(cell size)
return sizeof(callstack) + size;
}
stack_frame *fix_callstack_top(stack_frame *top, stack_frame *bottom);
stack_frame *frame_successor(stack_frame *frame);
code_block *frame_code(stack_frame *frame);
cell frame_executing(stack_frame *frame);
cell frame_scan(stack_frame *frame);
cell frame_type(stack_frame *frame);
PRIMITIVE(callstack);
PRIMITIVE(set_callstack);
PRIMITIVE(callstack_to_array);