From 551a800d2f71ca5c9f06fdb17fa1c31f9d182e9a Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Mon, 17 Aug 2009 21:37:18 +0100 Subject: [PATCH] removed some global functions from callstack.cpp --- vm/callstack.cpp | 58 ++---------------------------------------------- vm/callstack.hpp | 7 ------ 2 files changed, 2 insertions(+), 63 deletions(-) diff --git a/vm/callstack.cpp b/vm/callstack.cpp index c330e38064..676e4260c9 100755 --- a/vm/callstack.cpp +++ b/vm/callstack.cpp @@ -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_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 executing(frame_executing(frame),myvm); - gc_root scan(frame_scan(frame),myvm); + gc_root executing(myvm->frame_executing(frame),myvm); + gc_root 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() diff --git a/vm/callstack.hpp b/vm/callstack.hpp index 82fb93a1bc..406d8e7154 100755 --- a/vm/callstack.hpp +++ b/vm/callstack.hpp @@ -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);