From 700e03a6a61caa508b81a059b8508e983cef97b7 Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Sun, 23 Aug 2009 21:19:35 +0100 Subject: [PATCH] removed some vm-> forwarding functions --- vm/alien.cpp | 8 +------- vm/code_heap.cpp | 6 ------ vm/code_heap.hpp | 3 --- vm/mach_signal.cpp | 2 +- vm/os-unix.cpp | 2 +- vm/os-windows-nt.cpp | 2 +- 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/vm/alien.cpp b/vm/alien.cpp index bed24d1037..282f5c2fc9 100755 --- a/vm/alien.cpp +++ b/vm/alien.cpp @@ -93,12 +93,6 @@ void *factorvm::alien_pointer() return unbox_alien() + offset; } -void *alien_pointer() -{ - return vm->alien_pointer(); -} - - /* define words to read/write values at an alien address */ #define DEFINE_ALIEN_ACCESSOR(name,type,boxer,to) \ PRIMITIVE(alien_##name) \ @@ -232,7 +226,7 @@ char *factorvm::unbox_alien() VM_C_API char *unbox_alien() { - printf("*PHIL unbox_alien\n");fflush(stdout); + printf("PHIL unbox_alien\n");fflush(stdout); return vm->unbox_alien(); } diff --git a/vm/code_heap.cpp b/vm/code_heap.cpp index d91e349db7..372e194cf6 100755 --- a/vm/code_heap.cpp +++ b/vm/code_heap.cpp @@ -9,17 +9,11 @@ void factorvm::init_code_heap(cell size) new_heap(&code,size); } - bool factorvm::in_code_heap_p(cell ptr) { return (ptr >= code.seg->start && ptr <= code.seg->end); } -bool in_code_heap_p(cell ptr) -{ - return vm->in_code_heap_p(ptr); // used by os specific signal handlers -} - /* Compile a word definition with the non-optimizing compiler. Allocates memory */ void factorvm::jit_compile_word(cell word_, cell def_, bool relocate) { diff --git a/vm/code_heap.hpp b/vm/code_heap.hpp index 32e1dacfee..a357699591 100755 --- a/vm/code_heap.hpp +++ b/vm/code_heap.hpp @@ -1,8 +1,5 @@ namespace factor { - -bool in_code_heap_p(cell ptr); // Used by platform specific code - struct factorvm; typedef void (*code_heap_iterator)(code_block *compiled,factorvm *myvm); diff --git a/vm/mach_signal.cpp b/vm/mach_signal.cpp index d8eea06f0b..df5d78d35e 100644 --- a/vm/mach_signal.cpp +++ b/vm/mach_signal.cpp @@ -41,7 +41,7 @@ static void call_fault_handler( a divide by zero or stack underflow in the listener */ /* Are we in compiled Factor code? Then use the current stack pointer */ - if(in_code_heap_p(MACH_PROGRAM_COUNTER(thread_state))) + if(vm->in_code_heap_p(MACH_PROGRAM_COUNTER(thread_state))) signal_callstack_top = (stack_frame *)MACH_STACK_POINTER(thread_state); /* Are we in C? Then use the saved callstack top */ else diff --git a/vm/os-unix.cpp b/vm/os-unix.cpp index 67327e7d30..c96addb6f4 100644 --- a/vm/os-unix.cpp +++ b/vm/os-unix.cpp @@ -107,7 +107,7 @@ static stack_frame *uap_stack_pointer(void *uap) delivered during stack frame setup/teardown or while transitioning from Factor to C is a sign of things seriously gone wrong, not just a divide by zero or stack underflow in the listener */ - if(in_code_heap_p(UAP_PROGRAM_COUNTER(uap))) + if(vm->in_code_heap_p(UAP_PROGRAM_COUNTER(uap))) { stack_frame *ptr = (stack_frame *)ucontext_stack_pointer(uap); if(!ptr) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index 9187b88986..49594ed14a 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -21,7 +21,7 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe) PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord; CONTEXT *c = (CONTEXT*)pe->ContextRecord; - if(in_code_heap_p(c->EIP)) + if(vm->in_code_heap_p(c->EIP)) signal_callstack_top = (stack_frame *)c->ESP; else signal_callstack_top = NULL; -- 2.34.1